RamaharSwap Pairs Volume
    Updated 2023-07-15
    With T1 as (select
    date(block_timestamp) as dayz,
    tx_hash,
    pool_name,
    concat(symbol_in, '-', symbol_out) as swap_pair,
    coalesce (amount_in, 0) as amount_in,
    coalesce (amount_in_usd, 0) as amount_in_usd,
    coalesce (amount_out, 0) as amount_out,
    coalesce (amount_out_usd, 0) as amount_out_usd,
    case when amount_in_usd is null then amount_out_usd
    when amount_out_usd is null then amount_in_usd
    else (amount_in_usd + amount_out_usd) / 2 end as swap_volume
    from optimism.velodrome.ez_swaps)

    select
    swap_pair,
    sum(swap_volume) as volume
    from T1
    where swap_pair is not null
    group by 1
    having volume is not null
    order by 2 DESC

    Run a query to Download Data