datavortextotal fees
    Updated 2025-04-28
    WITH SwapData AS (
    SELECT DISTINCT
    tx_hash,
    block_timestamp
    FROM
    ink.core.ez_decoded_event_logs
    WHERE
    event_name = 'Swap'
    AND origin_to_address = '0xa8c1c38ff57428e5c3a34e0899be5cb385476507'
    AND block_timestamp IS NOT NULL
    AND tx_succeeded = TRUE
    ),

    HourlyEthPrices AS (
    SELECT
    DATE_TRUNC('hour', HOUR) AS price_hour,
    PRICE AS eth_price_usd
    FROM
    ink.price.ez_prices_hourly
    WHERE
    SYMBOL = 'WETH'
    ),

    SwapFees AS (
    SELECT
    sd.tx_hash,
    sd.block_timestamp,
    t.TX_FEE AS tx_fee_eth,
    DATE_TRUNC('hour', sd.block_timestamp) AS swap_hour
    FROM SwapData sd
    JOIN ink.core.fact_transactions t
    ON sd.tx_hash = t.tx_hash
    ),

    FeesWithPrices AS (
    SELECT DISTINCT
    Last run: 11 days ago
    total_fees_usd
    average_fee_usd
    total_tx_count
    1
    7014.8415461040.01770847766396129
    1
    39B
    5s