banbannardETH Derivatives 4
    Updated 2022-09-12
    with base as (select date_trunc('week', block_timestamp) as week,
    sum(amount_in_usd) as swap_vol_sell
    FROM ethereum.core.ez_dex_swaps
    where week >= '{{start_date}}'
    and symbol_in in ('aETH', 'rETH', 'stETH')
    group by 1),

    base2 as (select date_trunc('week', block_timestamp) as week,
    sum(amount_out_usd) as swap_vol_buy
    FROM ethereum.core.ez_dex_swaps
    where week >= '{{start_date}}'
    and symbol_out in ('aETH', 'rETH', 'stETH')
    group by 1)

    select a.week,
    swap_vol_sell,
    swap_vol_buy
    from base a
    join base2 b
    on a.week = b.week
    Run a query to Download Data