Updated 2024-01-29

    with tab1 as (
    select 'ARB'as token
    ,date_trunc('week',BLOCK_TIMESTAMP) as week
    ,sum(AMOUNT_IN_USD) as sell_volume
    ,count(distinct ORIGIN_FROM_ADDRESS) as buyers
    ,count(distinct TX_HASH) as buy_swaps
    from arbitrum.defi.ez_dex_swaps
    where BLOCK_TIMESTAMP::date>='2023-10-01'
    and PLATFORM='uniswap-v3'
    and SYMBOL_IN='ARB'
    group by 1,2),
    tab2 as (
    select 'OP'as token
    ,date_trunc('week',BLOCK_TIMESTAMP) as week
    ,sum(AMOUNT_IN_USD) as sell_volume
    ,count(distinct ORIGIN_FROM_ADDRESS) as buyers
    ,count(distinct TX_HASH) as buy_swaps
    from optimism.defi.ez_dex_swaps
    where BLOCK_TIMESTAMP::date>='2023-10-01'
    and PLATFORM='uniswap-v3'
    and SYMBOL_IN='OP'
    group by 1,2)
    select token
    ,round(avg(sell_volume)) as avg_volume
    from tab1
    group by 1
    union all
    select token
    ,round(avg(sell_volume)) as avg_volume
    from tab2
    group by 1


    Last run: about 1 year agoAuto-refreshes every 24 hours
    TOKEN
    AVG_VOLUME
    1
    ARB215203330
    2
    OP30794868
    2
    35B
    4s