MufasaTotal number of transactions that were delegated over the time
    Updated 2023-01-03
    with delegated_txns as (
    SELECT
    COUNT(DISTINCT tx_signer) as count_of_stakers,
    COUNT(DISTINCT events.TX_HASH) as count_of_txns,
    SUM(txns.tx:actions[0]:FunctionCall:deposit/pow(10,24)) volume_of_staked_near,
    SUM(txns.tx:actions[0]:FunctionCall:deposit/pow(10,24))/COUNT(DISTINCT tx_signer) as per_staker_near_value
    FROM near.core.fact_actions_events_function_call events
    JOIN near.core.fact_transactions txns
    ON events.tx_hash = txns.tx_hash
    WHERE method_name = 'deposit_and_stake'
    AND events.block_timestamp::date < CURRENT_DATE
    AND txns.block_timestamp::date < CURRENT_DATE
    )
    select * from delegated_txns
    Run a query to Download Data