freemartianTotal Transactions
    Updated 2025-01-14
    with prices AS(
    SELECT hour::date AS price_day, AVG(price) AS price
    FROM ethereum.price.ez_prices_hourly
    WHERE symbol = 'WETH'
    AND hour::date >= '2024-12-06'
    GROUP BY 1
    ),

    total_transactions as(
    SELECT
    *, tx_fee * price AS tx_fee_usd
    FROM ink.core.fact_transactions
    left join prices on (block_timestamp::date = price_day)
    WHERE block_timestamp::date >= '2024-12-09 '
    )



    SELECT
    count(DISTINCT tx_hash) as transactions,
    count(DISTINCT from_address) AS user,
    SUM(tx_fee) AS fees,
    AVG(tx_fee) AS average_fee,
    SUM(tx_fee_usd) AS fee_usd,
    avg(tx_fee_usd) AS average_fee_usd
    FROM total_transactions
    -- left join prices on (price_day = day)
    WHERE block_timestamp::date >= '2024-12-09 '



    Last run: 2 months ago
    TRANSACTIONS
    USER
    FEES
    AVERAGE_FEE
    FEE_USD
    AVERAGE_FEE_USD
    1
    4006789664499.6102735210.0000023984975333025.3046004640.008242336844
    1
    77B
    2s