feyikemiTotals
    Updated 2024-12-11
    WITH txn_summary AS (
    SELECT
    COUNT(DISTINCT TX_HASH) AS TOTAL_TXNS,
    COUNT(DISTINCT BLOCK_NUMBER) AS TOTAL_BLOCKS,
    COUNT(DISTINCT FROM_ADDRESS) AS TOTAL_USERS,
    SUM(VALUE) AS TOTAL_TXN_VOL,
    SUM(TX_FEE) AS TOTAL_TXN_FEE,
    AVG(TX_FEE) AS AVG_TXN_FEE,
    FROM base.core.fact_transactions
    WHERE STATUS = 'SUCCESS'
    )
    SELECT
    TOTAL_TXNS,
    TOTAL_BLOCKS,
    TOTAL_USERS,
    TOTAL_TXN_FEE,
    AVG_TXN_FEE,
    TOTAL_TXNS / TOTAL_USERS AS AVG_TXN_PER_USER
    FROM txn_summary
    QueryRunArchived: QueryRun has been archived