danielrMonthly supplied and withdrawn
Updated 2023-06-05Copy 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
33
34
35
36
›
⌄
-- forked from Weekly supplied and withdrawn @ https://flipsidecrypto.xyz/edit/queries/f9522b01-2111-41df-b827-ced9bf32f66f
-- forked from Daily supplied and withdrawn @ https://flipsidecrypto.xyz/edit/queries/eb892687-ad4e-4828-8cf4-ca01b7cf6965
with A as (
SELECT
date_trunc('{{Date_Trunc}}',block_timestamp) as date,
sum(ISSUED_TOKENS) as Amount_Token,
sum(SUPPLIED_USD) as Amount_USD,
'Supplied' as label
from ethereum.aave.ez_deposits
where SYMBOL='AAVE'
and block_timestamp>=CURRENT_DATE - {{Period_From_Current_Date_monthly}}
group by 1
),
B as(
SELECT
date_trunc('{{Date_Trunc}}',block_timestamp) as date,
sum(WITHDRAWN_TOKENS) as Amount_Token,
sum(WITHDRAWN_USD) as Amount_USD,
'Withdrawn' as label
from ethereum.aave.ez_withdraws
where SYMBOL='AAVE'
and block_timestamp>=CURRENT_DATE - {{Period_From_Current_Date_monthly}}
group by 1
),
C as(
select * from A
union all
select * from B
)
select * from C
Run a query to Download Data