select date_Trunc (day,mindate) as date,
count (distinct receiver_id ) as New_Contracts,
sum (New_Contracts) over (order by date) as Cumulative_Deployed_Contracts
from (
select receiver_id,
min (t1.block_timestamp) as mindate
from near.core.fact_actions_events t1 join near.core.fact_receipts t2 on t1.tx_hash = t2.tx_hash
where t1.action_name = 'DeployContract'
group by 1)
where mindate >= '{{From_Date}}'
group by 1
order by 1 desc