adriaparcerisasfba 3.2
Updated 2023-03-09
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
›
⌄
--How many unique borrowers of SNX, UNI, & MKR are there on Aave V2?
--What is total cumulative borrow for each asset on Aave V2?
--Can you visualize borrowing of each asset over time?
SELECT
trunc(block_timestamp,'{{granularity}}') as date,
BORROW_RATE_MODE,
count(distinct borrower_address) as borrowers,
sum(borrowed_usd) as borrowed_in_usd,
sum(borrowed_in_usd) over (partition by borrow_rate_mode order by date) as total_borrowed_usd
from ethereum.aave.ez_borrows where symbol = '{{token}}'
and aave_version = 'Aave V2' and block_timestamp>=current_date-INTERVAL '{{period}}'
group by 1,2 order by 1 asc, 2 desc
Run a query to Download Data