Skip to content
Dune Analytics

@devinwalsh / Fork of (#7146) Aave - Cumulative Daily Borrow Volume per Asset

Fork of (#7146) Aave - Cumulative Daily Borrow Volume per Asset

Loading
 

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

Loading
 

SQL query

1WITH borrows AS 
2(
3SELECT
4date_trunc('day', evt_block_time) as day,
5t.symbol as token,
6sum("_amount"/10^decimals) as amount
7FROM aave."LendingPool_evt_Borrow" borrows
8LEFT JOIN erc20."tokens" t ON borrows."_reserve" = t.contract_address
9GROUP BY 1,2
10),
11
12p AS 
13(
14SELECT
15* 
16FROM prices.usd
17)
18
19SELECT 
20day, 
21sum(sum(amount*price)) over (PARTITION BY token ORDER BY day) as all_time_borrows_usd
22from borrows
23LEFT JOIN p ON borrows.day = p.minute
24WHERE p.symbol = borrows.token
25GROUP BY 1
...

Result visualizations

Fork of (#7146) Aave - Cumulative Daily Borrow Volume per Asset

Loading