select date_trunc('day',date) as date,n_new_user, sum(n_new_user) over ( order by date) as cum_n_new_user
from(
select date_trunc('day',a) as date, count(from_address) as n_new_user
from(
select from_address, min(block_timestamp) as a
from thorchain.transfers
group by from_address
)
group by date order by date asc
)
group by date,2 order by date asc