with new_wallets as (
select
b.block_timestamp::date as date,
address
from algorand.account a
join algorand.block b on a.created_at = b.block_id
where b.block_timestamp::date >= '2022-05-01'
and b.block_timestamp::date <= '2022-05-10'
)
select
date,
count(address) as n_wallets,
sum(n_wallets) over (order by date asc rows between unbounded preceding and current row) as cum_n_wallets
from new_wallets
group by date
order by date desc