boomer77aave fees
Updated 2021-09-27
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
›
⌄
with deposits as (select tx_id, aave_version
from aave.deposits
where aave_version in ('Aave V2', 'Aave AMM')
and block_timestamp >= CURRENT_DATE - 365),
v1 as (select tx_id, aave_version
from aave.deposits
where aave_version = 'Aave V1'
and block_timestamp >= CURRENT_DATE - 365),
feesv2 as (select block_timestamp, tx_id, fee_usd
from ethereum.transactions
where tx_id in (select tx_id from deposits)),
feesv1 as (select block_timestamp, tx_id, fee_usd
from ethereum.transactions
where tx_id in (select tx_id from v1))
select a.aave_version, date_trunc('week',b.block_timestamp) as block_week, sum(b.fee_usd)
from deposits a
join fees b on a.tx_id = b.tx_id
group by 1,2
Run a query to Download Data