cyphereth borrowed from aave
Updated 2022-09-17
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
with eth_borrowed as (select
date_trunc('day', block_timestamp) as day,
sum(borrowed_tokens) as eth_borrowed
from ethereum.aave.ez_borrows
where contains(symbol, 'ETH')
and day >= current_date() - 30
group by DAY),
eth_repayed as (select
date_trunc('day', block_timestamp) as day,
sum(repayed_tokens) as eth_repayed
from ethereum.aave.ez_repayments
where contains(symbol, 'ETH')
and day >= current_date() - 30
group by DAY)
SELECT
b.day,
b.eth_borrowed,
r.eth_repayed,
b.eth_borrowed - r.eth_repayed as net_borrowed
from eth_borrowed b, eth_repayed r
where b.day = r.day
Run a query to Download Data