MLDZMNwrr12
    Updated 2023-01-19
    with t1 as (select
    distinct b.TX_RECEIVER as contract_name,
    min(b.block_timestamp) as first_appear
    FROM near.core.fact_actions_events_function_call a
    INNER JOIN near.core.fact_transactions b
    ON a.TX_HASH = b.TX_HASH
    INNER JOIN near.core.fact_receipts as c
    ON a.TX_HASH=c.TX_HASH
    WHERE ACTION_NAME = 'FunctionCall'
    AND METHOD_NAME <> 'new'
    group by 1
    )
    SELECT
    date_trunc('day',first_appear) as date,
    count(distinct contract_name) as no_contracts,
    sum(no_contracts) over (order by date) as cumulative_contracts
    from t1
    where date>=CURRENT_DATE-30
    group by 1
    order by 1
    Run a query to Download Data