with table1 as (select near.core.fact_actions_events.block_timestamp as date_time,
receiver_id as receiver,
row_number() over (partition by receiver_id order by near.core.fact_actions_events.block_timestamp asc) as num_r
from near.core.fact_actions_events join near.core.fact_receipts
on near.core.fact_receipts.tx_hash = near.core.fact_actions_events.tx_hash
where date_trunc('day', near.core.fact_actions_events.block_timestamp) >= '2022-01-01' -- since the beginning of 2022
and action_name ilike '%DEPLOYCONTRACT%'
group by receiver, date_time
qualify num_r = 1)
select count(receiver) as total,
date_trunc('MONTH', date_time) as d_time
from table1
group by d_time
order by d_time