jackguyThe Law Offices of NEAR
    Updated 2023-04-12

    SELECT
    day,
    amount as new_contracts,
    sum(amount) over (order by day) as total_contracts
    FROM (
    select
    min_day as day,
    count(*) as amount
    from (
    select
    PERMISSION:FunctionCall:receiver_id as id,
    min(date_trunc('day', block_timestamp)) as min_day
    from near.core.fact_actions_events_addkey
    WHERE tx_hash in (
    SELECT
    DISTINCT tx_hash
    FROM near.core.fact_actions_events
    WHERE ACTION_NAME = 'DeployContract'
    )
    group by 1
    --having min_day > CURRENT_DATE - 90
    )
    group by 1
    )



    Run a query to Download Data