select
date,
avg(balance/pow(10,decimal))/count(distinct ADDRESS) as OSMO_per_Wallet,
sum(count(distinct ADDRESS)) over (order by date asc rows between unbounded preceding and current row) as cum_holders
from osmosis.core.fact_daily_balances
where (BALANCE_TYPE = 'staked' or BALANCE_TYPE = 'liquid') and currency = 'uosmo' and date >= '2022-01-01'
group by date