SalehJup_all-Hourly
    Updated 2024-05-19
    with lst_jup_price as (
    select
    date_trunc('hour',recorded_hour) as hour_price
    ,avg(close) as jup_price
    from solana.price.ez_token_prices_hourly
    where token_address='JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN'
    group by 1
    )
    select
    date_trunc(hour,block_timestamp) as date
    ,jup_price
    ,median(amount) as "Median $Jup Volume"
    ,count(DISTINCT a.tx_id) as "Deposits Tx(#)"
    ,count(DISTINCT tx_from) as "Users(#)"
    ,avg(amount) as "Average $Jup Volume"
    ,sum(amount) as "$Jup Volume"
    ,max(amount) as "Max $Jup Volume"
    from solana.core.fact_transfers a
    join lst_jup_price on hour_price = date_trunc(hour,block_timestamp)
    where block_timestamp::date >= '2024-03-01'
    and mint = 'JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN'
    and tx_id in (select
    DISTINCT tx_id
    from solana.core.fact_events
    where program_id='voTpe3tHQ7AjQHMapgSue2HJFAh2cGsdokqN3XqmVSj'
    and block_timestamp::date >= '2024-03-01')
    group by 1,2
    order by 1



    QueryRunArchived: QueryRun has been archived