jackguyUniswap Fe - 4 copy copy
    Updated 2023-10-29
    -- forked from Uniswap Fe - 4 copy @ https://flipsidecrypto.xyz/edit/queries/00a17340-e54c-4252-97fd-b1c26c280ade

    -- forked from Uniswap Fe - 4 @ https://flipsidecrypto.xyz/edit/queries/03cc5b15-6ac6-4b47-ba1e-aeb47a2c76a0

    with tab1 as (
    SELECT
    tx_hash
    FROM ethereum.core.ez_token_transfers
    WHERE to_address LIKE lower('0x37a8f295612602f2774d331e562be9e61B83a327')
    and tx_hash in (
    SELECT tx_hash
    FROM ethereum.uniswapv3.ez_swaps
    ORDER by block_timestamp DESC
    ) AND block_timestamp >= '2023-10-17'

    UNION all

    SELECT
    tx_hash
    from ethereum.core.ez_eth_transfers
    WHERE eth_to_address LIKE lower('0x37a8f295612602f2774d331e562be9e61B83a327')
    and tx_hash in (
    SELECT tx_hash
    FROM ethereum.uniswapv3.ez_swaps
    ORDER by block_timestamp DESC
    ) AND block_timestamp >= '2023-10-17'
    )

    SELECT
    avg(amount0_usd),
    median(amount0_usd)

    FROM ethereum.uniswapv3.ez_swaps
    where pool_address in (SELECT DISTINCT POOL_ADDRESS from ethereum.uniswapv3.ez_swaps where tx_hash in (SELECT tx_hash from tab1))
    and block_timestamp > '2023-10-17'
    AND CASE when tx_hash in (SELECT tx_hash from tab1) then 'used frontend' else 'did not use frontend' end = 'did not use frontend'
    Run a query to Download Data