feyikemiUniswap Optimism 2
    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
    PLATFORM
    SWAP_COUNT
    UNIQUE_SWAPPERS
    TOTAL_SWAP_VOLUME_USD
    TOTAL_SWAP_FEE_USD
    AVERAGE_SWAP_FEE
    AVERAGE_SWAP_VOLUME
    AVERAGE_SWAP_PER_DAY
    AVERAGE_SWAPPERS_PER_DAY
    1
    Uniswap on Ethereum1450217658288526879564669616.012999173670.2892117.5821640726147.784784808192336.55835510992.740053
    2
    Uniswap on Optimism39950533240264626322569263.9327991210.37051760.5080701589616.41069496352984.7917773186.533156
    2
    256B
    405s