Eman-RazAverage/Median Swap Volume Over Time
    Updated 2024-08-14
    with tab1 as (select date_trunc('{{Time_Frame}}',block_timestamp) as "Date", amount_in_usd as amount_usd, amount_in as amount
    from arbitrum.defi.ez_dex_swaps
    where token_in=lower('0x11e969e9B3f89cB16D686a03Cd8508C9fC0361AF')
    and block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}'

    union

    select date_trunc('{{Time_Frame}}',block_timestamp) as "Date", amount_out_usd as amount_usd, amount_out as amount
    from arbitrum.defi.ez_dex_swaps
    where token_out=lower('0x11e969e9B3f89cB16D686a03Cd8508C9fC0361AF')
    and block_timestamp::date between '{{Start_Date}}' and '{{End_Date}}')

    select "Date", avg(amount) as "Average ($LAVA)", median(amount) as "Median ($LAVA)"
    FROM TAB1
    group by 1

    Auto-refreshes every 24 hours
    QueryRunArchived: QueryRun has been archived