0-MID Per day average swap stats on uniswap v3
    Updated 2023-03-10
    with tab1 as (
    select BLOCK_TIMESTAMP::date as date
    ,case
    when BLOCK_TIMESTAMP>='2023-02-16' and BLOCK_TIMESTAMP<='2023-02-22' then 'ONE WEEK BEFORE COINBASE ANNOUNCE'
    when BLOCK_TIMESTAMP>='2023-02-23' and BLOCK_TIMESTAMP<='2023-03-01' then 'ONE WEEK AFTER COINBASE ANNOUNCE' end as time_period
    ,sum(AMOUNT_OUT_USD) as swap_volume
    ,count(distinct ORIGIN_FROM_ADDRESS) as swappers
    ,count(distinct TX_HASH) as swap_count
    from optimism.core.ez_dex_swaps
    where BLOCK_TIMESTAMP>='2023-02-16'
    and time_period is not null
    and PLATFORM='uniswap-v3'
    group by 1,2)
    select time_period
    ,avg(swap_volume) as avg_swap_volume
    ,avg(swappers) as avg_swappers
    ,avg(swap_count) as avg_swap_count
    from tab1
    group by 1
    Run a query to Download Data