adriaparcerisaseth derivatives 7: swaps aETH
Updated 2022-09-13
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
›
⌄
WITH
swaps_in as (
select
trunc(block_timestamp,'month') as months,
sum(amount_in) as amount_in,
count(distinct tx_hash) as swaps_in
from ethereum.core.ez_dex_swaps
where symbol_in ='aETH'
group by 1
),
swaps_out as (
select
trunc(block_timestamp,'month') as months,
sum(amount_out) as amount_out,
count(distinct tx_hash) as swaps_out
from ethereum.core.ez_dex_swaps
where symbol_out ='aETH'
group by 1
)
SELECT
x.months,
amount_in,
amount_out*(-1) as amount_outs,
amount_in-amount_out as net_amount,
swaps_in,
swaps_out*(-1) as swaps_outs,
swaps_in-swaps_out as net_swaps
from swaps_in x
left join swaps_out y on x.months=y.months
order by 1 asc
Run a query to Download Data