SocioAnalyticasample tx checks
    Updated 2024-12-11
    -- forked from tst for near.fact_actions_events_function_call RECEIVER_ID and fact_transactions. TX_RECEIVER are consistant @ https://flipsidecrypto.xyz/studio/queries/c9d428b3-0708-4a4f-901f-cf5d5f3cb19d

    -- forked from selfish-beige copy @ https://flipsidecrypto.xyz/studio/queries/cb212126-c204-4411-927f-dd17a29725b2

    -- forked from SocioCrypto / selfish-beige @ https://flipsidecrypto.xyz/SocioCrypto/q/aOkmtvKkLhSQ/selfish-beige

    -- forked from Active Contracts @ https://flipsidecrypto.xyz/studio/queries/f92d7d8d-e9ee-41c0-b80b-6890e411a064
    -- credit to https://app.flipsidecrypto.com/dashboard/near-meta-analysis-ZMxhbA by @adriaparcerisas-zZ024F

    -- with active_contracts as (
    SELECT call.block_timestamp as "call date",
    tr.TX_RECEIVER as "tr TX_RECEIVER",
    call.RECEIVER_ID as "call reciever id",
    call.predecessor_id as "call predecessor_id",
    call.signer_id as "call signer_id",
    call.tx_hash
    FROM near.core.fact_actions_events_function_call call
    INNER JOIN near.core.fact_transactions tr
    ON call.TX_HASH = tr.TX_HASH
    WHERE ACTION_NAME = 'FunctionCall'
    AND METHOD_NAME <> 'new'
    AND call.tx_hash IN ('GkSaEQDuijcKPJY4pV6P3UGz8KPYFEY7zqHgEAkKbbqQ', '3yfAJt4rGz1GsH3v1dmfuQVQfy1F4SKZqDXgqaG3ais6')
    AND "call date" >= current_date - 1
    ORDER BY 2, 1 DESC
    LIMIT 1000
    -- ),
    -- stats as (
    -- SELECT date_trunc('d',block_timestamp_hour) as date,
    -- sum(transaction_count) as txCount,
    -- sum(total_fees_native) as feesNative,
    -- sum(total_fees_usd) as feesUSD
    -- FROM near.stats.ez_core_metrics_hourly
    -- WHERE date >= current_date - 90
    -- )

    QueryRunArchived: QueryRun has been archived