aureasarsanedesaptos gas 3
    Updated 10 hours ago
    WITH fees AS (
    -- Aptos fees with price
    SELECT
    'aptos' as blockchain,
    AVG(t.gas_used * t.gas_unit_price * p.price)/pow(10,8) as avg_tx_fee_usd
    FROM aptos.core.fact_transactions t
    LEFT JOIN aptos.price.ez_prices_hourly p
    ON DATE_TRUNC('hour', t.block_timestamp) = p.hour
    AND p.symbol = 'APT'
    WHERE t.block_timestamp >= CURRENT_DATE - INTERVAL '{{days}} days'
    AND t.success = TRUE

    UNION ALL
    -- Ethereum fees with price
    SELECT
    'ethereum' as blockchain,
    AVG(t.tx_fee * p.price) as avg_tx_fee_usd
    FROM ethereum.core.fact_transactions t
    LEFT JOIN ethereum.price.ez_prices_hourly p
    ON DATE_TRUNC('hour', t.block_timestamp) = p.hour
    AND p.symbol = 'ETH'
    WHERE t.block_timestamp >= CURRENT_DATE - INTERVAL '{{days}} days'
    AND t.status = 'SUCCESS'

    UNION ALL
    -- Near fees with price
    SELECT
    'near' as blockchain,
    AVG((t.transaction_fee / POW(10, 24)) * p.price) as avg_tx_fee_usd
    FROM near.core.fact_transactions t
    LEFT JOIN near.price.ez_prices_hourly p
    ON DATE_TRUNC('hour', t.block_timestamp) = p.hour
    AND p.symbol = 'NEAR'
    WHERE t.block_timestamp >= CURRENT_DATE - INTERVAL '{{days}} days'
    Last run: about 10 hours ago
    BLOCKCHAIN
    AVG_TX_FEE_USD
    FEE_RANK
    1
    ethereum0.25069090771
    2
    solana0.0099458757022
    3
    near0.0014726464523
    4
    aptos0.00084098418194
    4
    111B
    123s