/ Test1 @devinwalsh
About queries and results
Dune Analytics lets you explore, create, and share Ethereum analytics. You can find an endless amount of great queries and dashboards on Dune.
We have decoded Ethereum smart contract data so you can do powerful analysis with simple SQL queries and visualise the query results into beautiful graphs.
Dune Analytics is free for everyone forever. If you want extra features like private queries, export your results and more check out our Pro plan.
SQL query results
SQL query
1WITH borrow AS
2(
3SELECT
4date_trunc('day', evt_block_time) as day,
5t.symbol as token,
6sum("_amount"/10^decimals) as borrow_amount
7FROM aave."LendingPool_evt_Borrow" b
8LEFT JOIN erc20."tokens" t ON b."_reserve" = t.contract_address
9GROUP BY 1,2
10UNION
11SELECT
12date_trunc('day', evt_block_time) as day,
13t.symbol as token,
14sum(-"_amountMinusFees"/10^decimals) as borrow_amount
15FROM aave."LendingPool_evt_Repay" b
16LEFT JOIN erc20."tokens" t ON b."_reserve" = t.contract_address
17GROUP BY 1,2
18),
19
20p AS
21(
22SELECT
23*
24FROM prices.usd
25)...