with datas as (SELECT DISTINCT ADDRESS , sum( BALANCE/pow(10,decimal)) as balance
from osmosis.core.fact_daily_balances
where CURRENCY = 'uosmo'
and DATE = '2022-10-27'
GROUP by 1
order by 2 desc
limit 100)
SELECT row_number() over (order by balance desc) as rank, *
from datas
order by 1