feyikemiUniswap Optimism Perc. Diff. copy
    Updated 2025-01-23
    WITH Prices AS (
    SELECT
    date_trunc('day', hour) AS Date,
    avg(price) AS price
    FROM
    optimism.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 * 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
    Prices P ON date_trunc('day', block_timestamp) = P.Date
    WHERE platform ILIKE 'uniswap%'

    UNION

    SELECT
    block_timestamp,
    tx_hash,
    origin_from_address,
    amount_in_usd,
    tx_fee * price AS tx_fee_usd,
    'Uniswap on Optimism' AS Platform
    Last run: about 2 months ago
    METRIC
    SWAP_COUNT_PERCENTAGE_DIFFERENCE
    UNIQUE_SWAPPERS_PERCENTAGE_DIFFERENCE
    TOTAL_SWAP_VOLUME_USD_PERCENTAGE_DIFFERENCE
    TOTAL_SWAP_FEE_USD_PERCENTAGE_DIFFERENCE
    AVERAGE_SWAP_FEE_PERCENTAGE_DIFFERENCE
    AVERAGE_SWAP_VOLUME_PERCENTAGE_DIFFERENCE
    AVERAGE_SWAP_PER_DAY_PERCENTAGE_DIFFERENCE
    AVERAGE_SWAPPERS_PER_DAY_PERCENTAGE_DIFFERENCE
    1
    Percentage Difference113.6075110.1073188.377110027196.301329928188.765868868163.548617316102.3489072569110.10729227
    1
    129B
    397s