with new_accounts as ( select
FROM_ADDRESS ,
min (BLOCK_TIMESTAMP) min_date
from base.core.fact_transactions
group by 1
)
select min_date::date date ,
count (FROM_ADDRESS) num_new_accounts,
sum (num_new_accounts) over (order by date ) cum_new_accounts
from new_accounts
where min_date >= current_date - 30
group by 1 order by date