tongzzezVelo from
    Updated 2022-10-26
    with all_dex as (
    select 'Sushiswap' as dex,
    symbol_in,
    count (distinct tx_hash) as tx,
    count (distinct origin_from_address) as swappers
    from optimism.sushi.ez_swaps
    where block_timestamp >= CURRENT_DATE - 30
    and block_timestamp < CURRENT_DATE
    group by 1,2

    union ALL

    select 'Velodrome' as dex,
    symbol_in,
    count (distinct tx_hash) as tx,
    count (distinct origin_from_address) as swappers
    from optimism.velodrome.ez_swaps
    where block_timestamp >= CURRENT_DATE - 30
    and block_timestamp < CURRENT_DATE
    group by 1,2
    )

    select symbol_in,
    tx,
    swappers,
    row_number() over(order by tx desc) as ranks,
    case when ranks = '10' then '10'
    else concat(' ', ranks)
    end as rank,
    concat(rank,'.', symbol_in) as orders
    from all_dex
    where dex = 'Velodrome'
    order by 2 DESC
    limit 10
    Run a query to Download Data