0-MID2023-06-13 01:41 AM
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
›
⌄
with tab1 as (
select CURRENCY
,ADDRESS as holder
,BALANCE/pow(10,DECIMAL) as TOP20_balance
from osmosis.core.fact_daily_balances
where DATE=current_date
and CURRENCY='uosmo'
and BALANCE_TYPE='liquid'
order by 2 desc
limit 20),
tab2 as (
select CURRENCY
,ADDRESS as holder
,BALANCE/pow(10,DECIMAL) as total_balance
from osmosis.core.fact_daily_balances
where DATE=current_date
and CURRENCY='uosmo'
and BALANCE_TYPE='liquid')
select sum(TOP20_balance) as t20_bal
,sum(total_balance) as t_bal
,(t20_bal/t_bal)*100 as top20_share
from tab1
left join tab2
on tab1.CURRENCY=tab2.CURRENCY
Run a query to Download Data