primo_dataAave - 7. AAVE movements
Updated 2022-08-12
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
›
⌄
--Daily AAVE supplied and withdrawn on Aave protocol.
with supplied as (
select date(block_timestamp) dt
, blockchain
, aave_version
, symbol token
, 'supplied' typ
, count(distinct tx_id) tx_ct
, count(distinct depositor_address) depositer_ct
, sum(supplied_usd) total_amount_usd
from flipside_prod_db.aave.deposits
group by 1,2,3,4
),
withdrawn as (
select date(block_timestamp) dt
, blockchain
, aave_version
, symbol token
, 'withdrawn' typ
, count(distinct tx_id) tx_ct
, count(distinct depositor_address) depositer_ct
, -sum(withdrawn_usd) total_amount_usd
from flipside_prod_db.aave.withdraws
group by 1,2,3,4
)
select *
from
(
select *
from withdrawn
)
union ALL
(
select *
from supplied
Run a query to Download Data