Elprognerd3 - Monthly net volume
Updated 2023-06-05
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
›
⌄
with t1 as(select date_trunc('month',BLOCK_TIMESTAMP) as date,
'Deposit' as action,
ISSUED_TOKENS as amount,
DEPOSITOR_ADDRESS,
TX_HASH
FROM ethereum.aave.ez_deposits
where aave_market = '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'
union all
select date_trunc('month', BLOCK_TIMESTAMP) as date,
'Withdrawal' as action,
WITHDRAWN_TOKENS as amount,
DEPOSITOR_ADDRESS,
TX_HASH
FROM ethereum.aave.ez_withdraws
where aave_market = '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9')
, t2 as (
SELECT
date,
action,
-1*sum(amount) as "Total volume"
from t1
where action = 'Withdrawal'
GROUP BY 1, 2
union all
SELECT
date,
action,
sum(amount) as "Total volume"
from t1
where action = 'Deposit'
GROUP BY 1, 2
order by 1, 2)
SELECT
date,
Run a query to Download Data