feyikemiUniswap Polygon Perc. Diff.
    Updated 2025-01-23
    WITH MaticPrices AS (
    SELECT
    date_trunc('day', hour) AS Date,
    avg(price) AS price
    FROM
    polygon.price.ez_prices_hourly
    WHERE
    symbol ILIKE 'Matic'
    GROUP BY
    Date
    ),

    WethPrices AS (
    SELECT
    date_trunc('day', hour) AS Date,
    avg(price) AS price
    FROM
    ethereum.price.ez_prices_hourly
    WHERE
    symbol ILIKE 'WETH'
    GROUP BY
    Date
    ),

    DexSwapsWithPrice AS (
    SELECT
    block_timestamp,
    tx_hash,
    origin_from_address,
    amount_in_usd,
    tx_fee * WETHPrices.price AS tx_fee_usd,
    'Uniswap on Ethereum' as Platform
    FROM ethereum.defi.ez_dex_swaps
    JOIN
    ethereum.core.fact_transactions USING (tx_hash)
    JOIN
    QueryRunArchived: QueryRun has been archived