with new_user as ( select min(block_timestamp) as day, tx_signer
from near.core.fact_transactions
group by 2)
,
tb1 as ( select trunc(day,'week') as weekly,
count(DISTINCT tx_signer) as totall_users,
sum(totall_users) over (order by weekly asc) as cumulative_users
from new_user
group by 1)
select weekly,
totall_users,
cumulative_users
from tb1