saeide-ahmadi-7OSMO:ratio of liquid to staked
Updated 2022-10-27
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
›
⌄
with balances as (
select
date_trunc('week', date) as day,
case
when balance_type = 'liquid' then
balance / pow (10,decimal)
else 0
end as liquid,
case
when balance_type = 'staked' then
balance / pow (10,decimal)
else 0
end as staked
from
osmosis.core.fact_daily_balances
where
currency = 'uosmo' and date>'2022-01-01' and date<'2022-10-24'
)
select
day,
sum(liquid) as liquids,
sum(staked) as stakeds,
case
when liquids!=0 and stakeds!=0 then
liquids / stakeds
else 0
end as ratio
from
balances
group by
day
order by
day asc
Run a query to Download Data