banbannardETH Derivatives 4
Updated 2022-09-12Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
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