alirsOsmo-WB-04-ratio
Updated 2022-10-25
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
›
⌄
with liquid as (select Date,
sum(BALANCE/pow(10,decimal)) as Liquid_Amount
from osmosis.core.fact_daily_balances
where currency = 'uosmo'
and Date>='2022-01-01'
and BALANCE_TYPE='liquid'
group by DATE
order by date
),
Stake as (select Date,
sum(BALANCE/pow(10,decimal)) as Stake_Amount
from osmosis.core.fact_daily_balances
where currency = 'uosmo' and Date>='2022-01-01'
and BALANCE_TYPE='staked'
group by DATE
order by date
)
Select --liquid.date,
Liquid_Amount,Stake_Amount,(Liquid_Amount/ Stake_Amount) * 100 as Ratio_of_Liquid_To_Staked
-- sum(Liquid_Amount) over (order by date) as Cumulative_iquid_Amount,
-- sum(Stake_Amount)over (order by date) as Cumulative_Stake_Amount,
-- sum(Ratio_of_Liquid_To_Staked) over (order by date) as Cumulative_Ratio_of_Liquid_To_Staked
from liquid join Stake using(date)
order by 3 DESC
Run a query to Download Data