superflyNear Foundations- New Contracts
    Updated 2023-01-11
    SELECT
    date_trunc('day',first_date) as "DATE",
    count(distinct receiver_id ) as new_contracts,
    sum(new_contracts) over (order by "DATE") as cum_new_contracts
    from (select
    receiver_id,
    min(x.block_timestamp) as first_date
    from near.core.fact_actions_events x
    join near.core.fact_receipts y on x.tx_hash=y.tx_hash
    where action_name = 'DeployContract'
    and x.block_timestamp >= '2022-07-01' and x.block_timestamp < '2022-10-01'

    group by 1) where first_date < CURRENT_DATE -1
    group by 1
    order by 1 asc
    Run a query to Download Data