maybeyonaseth_rem_aave_inflow
Updated 2022-09-18Copy 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
›
⌄
-- aave inflows
with inflows as (
select
block_timestamp,
tx_hash,
'deposit' as event,
issued_tokens as amt,
supplied_usd as amt_usd
from ethereum.aave.ez_deposits
where symbol = 'WETH'
union all
select
block_timestamp,
tx_hash,
'repay' as event,
repayed_tokens as amt,
repayed_usd as amt_usd
from ethereum.aave.ez_repayments
where symbol = 'WETH'
)
select * from (
select
date(block_timestamp) as date,
event,
count(tx_hash) as txs,
sum(amt) as eth_vol,
sum(amt_usd) as usd_vol,
avg(amt) as avg_eth
from inflows
group by 1,2
order by date desc
limit 180
Run a query to Download Data