Alexayopt. stats
    Updated 2022-10-16
    with daily as (select date_trunc('day',block_timestamp) as date, count(distinct tx_hash) as trade_count,
    case when (origin_to_address='0xbe811a0d44e2553d25d11cb8dc0d3f0d0e6430e6' or origin_to_address='0x40e223295f6f216feede416d6b9e198368ed663a' or origin_to_address='0x35f048853b59400fbec80748592904f66374cfc0' or origin_to_address='0xe52180815c81d7711b83412e53259bed6a3ab70a')
    then 'SushiSwap'
    when (origin_to_address='0xe592427a0aece92de3edee1f18e0157c05861564' or origin_to_address='0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45')
    then 'Uniswap'
    end as platform
    from optimism.core.fact_event_logs
    where (origin_to_address='0xe592427a0aece92de3edee1f18e0157c05861564' -- Uniswap V3: Router
    or origin_to_address='0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45' -- Uniswap V3: Router 2
    or origin_to_address='0xbe811a0d44e2553d25d11cb8dc0d3f0d0e6430e6' --sushiswap1
    or origin_to_address='0x40e223295f6f216feede416d6b9e198368ed663a' --sushiswap2
    or origin_to_address='0x35f048853b59400fbec80748592904f66374cfc0' --sushiswap3
    or origin_to_address='0xe52180815c81d7711b83412e53259bed6a3ab70a') --sushiswap4
    and tx_status='SUCCESS'
    group by date, platform
    order by date)
    select avg(trade_count) as mean, median(trade_count) as median, max(trade_count) as max, min(trade_count) as min, platform
    from daily
    group by platform
    Run a query to Download Data