Soheil_MKUntitled Query
Updated 2022-09-15Copy Reference Fork
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
32
›
⌄
with deposit as (
select
BLOCK_TIMESTAMP::date as date,
sum(ISSUED_TOKENS) as ETH_amounts_added,
lag(ETH_amounts_added) ignore nulls over(order by date asc) as lag_ETH_amounts_added,
((ETH_amounts_added - lag_ETH_amounts_added)/ lag_ETH_amounts_added)*100 as ETH_amounts_added_volatility
from ethereum.aave.ez_deposits
where SYMBOL ='WETH'
and date >='2022-07-01'
group by 1
),
withdraw as (
select
BLOCK_TIMESTAMP::date as date,
sum(WITHDRAWN_TOKENS) as ETH_amounts_removed,
lag(ETH_amounts_removed) ignore nulls over(order by date asc) as lag_ETH_amounts_removed,
((ETH_amounts_removed - lag_ETH_amounts_removed)/ lag_ETH_amounts_removed)*100 as ETH_amounts_removed_volatility
from ethereum.aave.ez_withdraws
where SYMBOL ='WETH'
and date >='2022-07-01'
group by 1
)
select
a.date,
a.ETH_amounts_added_volatility,
b.ETH_amounts_removed_volatility
from deposit a
join withdraw b
on a.date=b.date
Run a query to Download Data