SocioCryptoActive Contracts
    Updated 2023-01-26
    -- credit to https://app.flipsidecrypto.com/dashboard/near-meta-analysis-ZMxhbA by @adriaparcerisas-zZ024F

    SELECT date_trunc('{{interval}}', call.block_timestamp) as date,
    COUNT(DISTINCT tr.TX_RECEIVER) as "Number of Active Contracts"
    FROM near.core.fact_actions_events_function_call call
    INNER JOIN near.core.fact_transactions tr
    ON call.TX_HASH = tr.TX_HASH
    INNER JOIN near.core.fact_receipts as rc
    ON tr.TX_HASH=rc.TX_HASH
    WHERE ACTION_NAME = 'FunctionCall'
    AND METHOD_NAME <> 'new'
    AND date <='2022-12-31'
    GROUP by date
    ORDER BY date DESC
    Run a query to Download Data