Updated 2023-08-27
    -- forked from solt1 copy @ https://flipsidecrypto.xyz/edit/queries/e98829fc-c12a-441d-a1b3-e38feec2db59

    -- forked from solt1 @ https://flipsidecrypto.xyz/edit/queries/85212599-f22b-4d08-97ff-f9435ea2dd21


    SELECT
    date_trunc('day',block_timestamp) as date,
    PLATFORM,
    count(distinct tx_hash) as "Trades",
    count(distinct ORIGIN_FROM_ADDRESS) as "Swappers",
    sum(AMOUNT_IN_USD) as volume_usd,
    avg(AMOUNT_IN_USD) as avg_usd,
    median(AMOUNT_IN_USD) as median_usd,
    sum(volume_usd) over (order by date) as total_volume
    from avalanche.core.ez_dex_swaps
    where (TOKEN_IN = '0x94025780a1ab58868d9b2dbbb775f44b32e8e6e5' or TOKEN_OUT = '0x94025780a1ab58868d9b2dbbb775f44b32e8e6e5')
    group by 1,2



    Run a query to Download Data