SalehAave - 8-correlation in 2022
Updated 2022-08-07
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 lst_top5 as (
select top 5
SYMBOL
,AAVE_TOKEN as ATOKEN_ADDRESS
,sum(ISSUED_TOKENS) as amount
,sum(SUPPLIED_USD) as amount_usd
from flipside_prod_db.aave.deposits
where AAVE_VERSION='Aave V2'
group by 1,2
order by amount_usd DESC
)
,lst_state as (
select
BLOCK_HOUR::date as day
,symbol
,ATOKEN_ADDRESS
,avg(SUPPLY_RATE)*100 as supply
,avg( BORROW_RATE_STABLE)*100 as borrow_stable
,avg( BORROW_RATE_VARIABLE)*100 as borrow_VARIABLE
,avg( UTILIZATION_RATE)*100 as UTILIZATION_RATE
,avg(TOTAL_LIQUIDITY_USD) as supply_usd
,avg(TOTAL_LIQUIDITY_TOKEN) as liquidity
from flipside_prod_db.aave.market_stats
join lst_top5 using(ATOKEN_ADDRESS)
-- where BLOCK_HOUR::date =(select max(BLOCK_HOUR::date) from flipside_prod_db.aave.market_stats)
where AAVE_VERSION='Aave V2'
and symbol in('WBTC' ,'USDC')
group by 1,2,3
)
select
day
,sum(iff(SYMBOL='USDC',BORROW_STABLE,0)) as BORROW_STABLE_USDC
Run a query to Download Data