select
date_trunc('week',block_timestamp) as dt,
RECIPIENT_LABEL_TYPE,
--RECIPIENT_LABEL_SUBTYPE,
--RECIPIENT_LABEL,
--RECIPIENT_ADDRESS_NAME,
count(distinct sender) as senders,
sum(senders) over (partition by RECIPIENT_LABEL_TYPE order by dt) as cum_senders
from terra.transfer_events
where block_timestamp>='2022-01-01'
and RECIPIENT_LABEL_TYPE in ('layer2','defi','dex','cex','nft')
group by 1,2