with Top_100_2022_01_01 as (
select
address
, sum(balance/1e6) as total_balance
, dense_rank() over(order by total_balance desc ) as rank
from
osmosis.core.fact_daily_balances
where
CURRENCY = 'uosmo'
and date = '2022-01-01'::DATE
group by address
order by 2 desc
limit 100
)
, current_whales as (
select
address
, sum(balance/1e6) as total_balance
, dense_rank() over(order by total_balance desc ) as rank
from
osmosis.core.fact_daily_balances
where
CURRENCY = 'uosmo'
and date = CURRENT_DATE
group by address
order by 2 desc
limit 100
)
select
'Beginning of the Yaer' as "Wallet Type"
, sum(total_balance) as "Total OSMO Volume"
from
Top_100_2022_01_01
union
select