Skip to content
Dune Analytics

@devinwalsh / Aave Fees

SQL query results

Loading
 

SQL query

1WITH RAW AS
2  (SELECT a._fees/1e18 AS fees,
3          a."_amountMinusFees"/1e18 AS amtminusfees,
4          a.evt_tx_hash,
5          a.evt_block_time,
6          p.price,
7          p.symbol
8   FROM aave."LendingPool_evt_Repay" a
9   LEFT JOIN prices."usd" p ON p.contract_address=a._reserve
10   AND date_trunc('minute', a.evt_block_time)=p.minute
11   WHERE a.evt_block_time >= (now()::timestamptz - interval '1 week'))--AND a.evt_tx_hash = '\x4c3cf1cc49c6f4b12ec9ea42867f6eb32a29852ea14bf9b35f751f1738830f46')
12
13SELECT date_trunc('day', evt_block_time) AS DAY,
14       sum(fees*price) AS fees_usd
15FROM RAW
16GROUP BY 1
17LIMIT 10