with balances as (
select
date_trunc('week', date) as day,
b.label as symbol,
sum(balance/pow(10,decimal)) as osmo
from
osmosis.core.fact_daily_balances a join osmosis.core.dim_labels b on a.currency = b.address
where
date>'2022-01-01'
group by
day, symbol
)
select
day,
symbol,
sum(osmo) as "Total OSMO in Wallets"
from
balances
group by
day, symbol
order by
day asc