Updated 2025-06-04
    WITH total_seconds AS (
    SELECT
    366 * 24 * 60 * 60 AS total_seconds_in_2024
    ),
    transaction_metrics AS (
    SELECT
    COUNT(DISTINCT tx_hash) AS total_transactions,
    COUNT(DISTINCT sender) AS active_users,
    SUM((gas_used * gas_unit_price) / 1e8) AS total_fees_in_apt,
    AVG((gas_used * gas_unit_price) / 1e8) AS avg_transaction_fee_in_apt,
    COUNT(DISTINCT tx_hash) / (366 * 24 * 60 * 60) AS avg_transactions_per_second,
    SUM((gas_used * gas_unit_price) / 1e8) / COUNT(DISTINCT tx_hash) AS avg_gas_fee_per_transaction_in_apt,
    SUM((gas_used * gas_unit_price) / 1e8) / COUNT(DISTINCT sender) AS avg_gas_spent_per_user_in_apt
    FROM
    aptos.core.fact_transactions
    WHERE
    block_timestamp >= '2025-01-01'
    AND block_timestamp <= '2025-12-31'
    AND success = 'true'
    ),
    APTPrice AS (
    SELECT
    AVG(price) AS apt_price
    FROM
    aptos.price.ez_prices_hourly
    WHERE
    symbol = 'APT'
    AND hour >= '2024-01-01'
    AND hour <= '2024-12-31'
    ),
    gas_conversion AS (
    SELECT
    tm.total_transactions,
    tm.active_users,
    tm.total_fees_in_apt,
    tm.avg_transaction_fee_in_apt,
    Last run: 14 days ago
    TOTAL_TRANSACTIONS
    ACTIVE_USERS
    TOTAL_FEES_IN_APT
    AVG_TRANSACTION_FEE_IN_APT
    AVG_TRANSACTIONS_PER_SECOND
    AVG_GAS_FEE_PER_TRANSACTION_IN_APT
    AVG_GAS_SPENT_PER_USER_IN_APT
    TOTAL_FEES_IN_USD
    AVG_TRANSACTION_FEE_IN_USD
    AVG_GAS_FEE_PER_TRANSACTION_IN_USD
    AVG_GAS_SPENT_PER_USER_IN_USD
    1
    6690799844451544086439.1810560.00017281641621.1584190.0001291911030.001941779775813430.3517367030.0016262777640.0012157445620.01827299364
    1
    151B
    461s