Nige7777Aave TVL
Updated 2023-03-26
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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- with c_borrow as (
-- select DISTINCT
-- SUM(Borrowed_USD) OVER (partition by date_tunc('day', block_timestamp)) as Borrowed_USD,
-- date_tunc('day', block_timestamp) Day,
-- SYMBOl,
-- BLOCKCHAIN
-- from
-- aave.borrows b
-- where block_timestamp >= CURRENT_DATE - 1
-- ), c_deposit as (
-- select DISTINCT
-- SUM(supplied_USD) OVER (partition by date_tunc('day', block_timestamp)) as Deposits_USD,
-- date_tunc('day', block_timestamp) Day,
-- SYMBOl,
-- BLOCKCHAIN
-- from
-- aave.deposits d
-- where block_timestamp >= CURRENT_DATE - 1
-- )
-- with c as (
select DISTINCT
AVG(total_liquidity_usd) over (partition by date_trunc('Day', block_hour), Reserve_name order by date_trunc('Day', block_hour), reserve_name) AS Deposits,
AVG(total_stable_debt_usd+ total_variable_debt_usd) over (partition by date_trunc('Day', block_hour), Reserve_name order by date_trunc('Day', block_hour), reserve_name) AS Borrows,
reserve_name as Token,
date_trunc('Day', block_hour) DAY
from aave.market_stats
where block_hour >= CURRENT_DATE - 180
order by DAY desc
-- )
-- select sum(deposits) deposits,
-- sum(borrows) borrows,
Run a query to Download Data