ArioMK-Avg and Med
    Updated 2023-09-15

    select
    avg(case
    when AMOUNT_IN_USD is not null then AMOUNT_IN_USD
    when AMOUNT_IN_USD is null
    and AMOUNT_OUT_USD is not null then AMOUNT_OUT_USD
    else (AMOUNT_IN * price)
    end) as "Avg Swap Volume"
    ,median(case
    when AMOUNT_IN_USD is not null then AMOUNT_IN_USD
    when AMOUNT_IN_USD is null
    and AMOUNT_OUT_USD is not null then AMOUNT_OUT_USD
    else (AMOUNT_IN * price)
    end) as "Median Swap Volume"
    from
    base.defi.ez_dex_swaps
    join base.price.ez_hourly_token_prices on TOKEN_IN = TOKEN_ADDRESS
    and date_trunc(hour, block_timestamp) = HOUR
    where
    platform = 'maverick'
    and block_timestamp::date >= '2023-08-09'


    Run a query to Download Data