gokcinvelodrom swap to
    Updated 2022-12-06
    with pools as (
    select 'Velodrome' as dex,
    count (distinct tx_hash) as swaps,
    count (distinct origin_from_address) as swappers,symbol_out,
    sum(amount_in_usd) as usd
    from optimism.velodrome.ez_swaps
    where block_timestamp >= '2022-06-01'
    group by symbol_out
    union
    select 'Sushiswap' as DEX,
    count (distinct tx_hash) as swaps,
    count (distinct origin_from_address) as swappers,symbol_out,
    sum(amount_in_usd) as usd
    from optimism.sushi.ez_swaps
    where block_timestamp >= '2022-06-01'
    group by symbol_out

    UNION
    select 'Uniswap' as DEX,
    count(distinct tx_hash) as swaps,
    count (distinct origin_from_address) as swappers,'0' as symbol_out,
    '0' as usd
    from optimism.core.fact_event_logs
    where block_timestamp >='2022-06-01' and origin_to_address in ('0xe592427a0aece92de3edee1f18e0157c05861564' ,'0x68b3465833fb72a70ecdf485e0e4c7bd8665fc45') and event_name ='Swap'
    group by symbol_out)
    select symbol_out,
    swaps,
    swappers,
    usd
    from pools
    where dex = 'Velodrome' and usd is not null
    group by symbol_out,2,3,4
    order by usd DESC
    limit 10
    Run a query to Download Data