datavortexTotals
    Updated 2024-12-08
    WITH total_seconds AS (
    SELECT
    366 * 24 * 60 * 60 AS total_seconds_in_2024
    ),
    ETHPrice AS (
    SELECT
    AVG(price) AS eth_price
    FROM
    base.price.ez_prices_hourly
    WHERE
    symbol = 'ETH'
    ),
    transaction_metrics AS (
    SELECT
    COUNT(DISTINCT tx_hash) AS total_transactions,
    COUNT(DISTINCT from_address) AS active_users,
    SUM(tx_fee) AS total_gas_in_eth,
    AVG(tx_fee) AS avg_transaction_fee_in_eth,
    COUNT(DISTINCT tx_hash) / (366 * 24 * 60 * 60) AS avg_transactions_per_second,
    SUM(tx_fee) / COUNT(DISTINCT tx_hash) AS avg_gas_fee_per_transaction_in_eth,
    SUM(tx_fee) / COUNT(DISTINCT from_address) AS avg_gas_spent_per_user_in_eth
    FROM
    base.core.fact_transactions
    WHERE
    block_timestamp >= '2024-01-01'
    AND block_timestamp <= '2024-12-31'
    AND status = 'SUCCESS'
    ),
    gas_conversion AS (
    SELECT
    tm.total_transactions,
    tm.active_users,
    tm.total_gas_in_eth,
    tm.avg_transaction_fee_in_eth,
    tm.avg_transactions_per_second,
    tm.avg_gas_fee_per_transaction_in_eth,
    QueryRunArchived: QueryRun has been archived