Motilolabeautiful-lime
    Updated 2024-10-09
    WITH token_prices AS (
    SELECT
    symbol,
    AVG(price) AS token_price_usd
    FROM
    ethereum.price.ez_prices_hourly
    GROUP BY
    symbol
    ),
    jared_swaps AS (
    SELECT
    a.block_timestamp,
    a.block_number,
    b.position,
    a.tx_hash,
    a.platform,
    a.origin_from_address,
    a.origin_to_address,
    a.contract_address,
    a.amount_in,
    a.amount_in_usd,
    a.amount_out,
    a.amount_out_usd,
    a.symbol_in,
    a.symbol_out,
    b.tx_fee AS total_tx_fee
    FROM
    ethereum.defi.ez_dex_swaps a
    JOIN ethereum.core.fact_transactions b ON a.block_number = b.block_number
    AND a.tx_hash = b.tx_hash
    WHERE
    a.origin_to_address = LOWER('0x1f2F10D1C40777AE1Da742455c65828FF36Df387')
    ),
    jared_block_interactions AS (
    SELECT
    block_number,
    QueryRunArchived: QueryRun has been archived