with balances as (
select
address,
sum(balance/pow(10,decimal)) as asset
from
osmosis.core.fact_daily_balances
where
currency = 'uosmo' and date='2022-01-01'
group by
address
)
select
*,
row_number() over (order by asset desc) as rn,
concat(lpad(rn,3,'0') , ' - ', address) as wallet
from
balances
order by
asset desc
limit 100