emirprince95aave total b&d
Updated 2021-11-11
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
›
⌄
with eth_gas_prices as (
SELECT date_trunc('day', block_timestamp) AS day, avg(fee_usd) AS feepaid_usd
FROM ethereum.transactions
where success = 'TRUE'
group by 1)
, borrows as (
select date_trunc('day', block_timestamp) AS day, sum(BORROWED_USD) as borrows_in_usd
from aave.borrows
where blockchain = 'ethereum'
group by 1
)
, deposits as (
select date_trunc('day', block_timestamp) AS day, sum(supplied_usd) as deposits_in_usd
from aave.deposits
where blockchain = 'ethereum'
group by 1
)
, gb as (select b.*, g.feepaid_usd from eth_gas_prices g join borrows b on b.day = g.day)
select gb.*, deposits.deposits_in_usd from deposits join gb on gb.day = deposits.day
Run a query to Download Data