with tb as ( select
min(block_timestamp) as date_ ,
tx_receiver
from near.core.fact_transactions
where TX_HASH in ( select tx_hash
from near.core.fact_actions_events
where action_name = 'DeployContract' )
group by 2)
select
trunc(date_,'day') as date ,
count(DISTINCT tx_receiver) as total_contracts
from tb
group by 1
order by 1