SocioCryptoTotal Transactions including Transfers statistics
    Updated 2023-05-22
    -- forked from Total Transactions including Transfers @ https://flipsidecrypto.xyz/edit/queries/4cd7f34b-62d6-4fd1-84d7-f48ec1e1a7ac

    -- forked from Function Call - Method Name @ https://flipsidecrypto.xyz/edit/queries/f1a8b762-b6f8-4145-851b-ddeaa708bd25

    -- forked from Function Call @ https://flipsidecrypto.xyz/edit/queries/36b029a9-4427-4d01-9a22-170ae9cc9cf1

    SELECT --date_trunc('day',block_timestamp) as date,
    --action_name,
    count(DISTINCT a.tx_hash) as n_txns,
    count(DISTINCT signer_id) as n_users,
    avg(gas_used) as avg_gas_used,
    sum(gas_used) as gas_used,
    avg(TRANSACTION_FEE)/pow(10,24) as avg_tx_fee,
    sum(TRANSACTION_FEE)/pow(10,24) as tx_fee
    FROM near.core.fact_actions_events a
    LEFT JOIN near.core.fact_transactions b
    ON a.tx_hash = b.tx_hash
    WHERE receiver_id = 'nearhorizon.near'
    AND a.block_timestamp::date <=current_date -1
    --GROUP BY 1,2




    Run a query to Download Data