Afonso_Diaz2023-08-04 11:13 PM
    Updated 2023-08-04
    with

    t as (
    select
    recorded_hour::date as date,
    symbol,
    token_address,
    avg(close) as price_usd
    from solana.core.ez_token_prices_hourly
    group by 1, 2, 3
    ),

    t2 as (
    select
    swapper as new_user,
    min(block_timestamp) as min_date
    from solana.core.fact_swaps
    where swap_program ilike 'jupiter%'
    group by 1
    ),

    t3 as (
    select
    tx_id,
    block_timestamp,
    case
    when block_timestamp::date < '2023-07-27' then 'Before Announcement'
    when block_timestamp::date = '2023-07-27' then 'Announcement Day'
    else 'After Announcement'
    end as timespan,
    swapper,
    a.symbol as symbol_in,
    b.symbol as symbol_out,
    swap_from_amount * a.price_usd as amount_in_usd,
    swap_to_amount * b.price_usd as amount_out_usd
    from solana.core.fact_swaps
    Run a query to Download Data