jackguy2023-10-29 11:10 AM
    Updated 2024-01-30
    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
    date_trunc('week', block_timestamp) as week,
    count(DISTINCT tx_hash) as events,
    sum(ABS(AMOUNT0_USD)) * 0.0649 * 0.0015 as fee_volume

    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 between '2023-01-01' and '2024-01-01'
    GROUP BY 1
    Last run: about 1 year agoAuto-refreshes every 6 hours
    WEEK
    EVENTS
    FEE_VOLUME
    1
    2023-07-10 00:00:00.00079542329374.485110418
    2
    2023-11-13 00:00:00.000110685519592.577713951
    3
    2023-12-18 00:00:00.000121578473949.696004587
    4
    2023-04-17 00:00:00.000102800403160.123840908
    5
    2023-01-23 00:00:00.000137461617764.491153232
    6
    2023-01-02 00:00:00.00099233265051.991785399
    7
    2023-04-24 00:00:00.00089982397082.078007351
    8
    2023-03-13 00:00:00.0002017581318124.28614589
    9
    2023-09-25 00:00:00.00075738225209.471475269
    10
    2023-12-04 00:00:00.000114947443587.911243196
    11
    2023-06-26 00:00:00.00085120399618.337549563
    12
    2023-05-29 00:00:00.00073543256313.138694591
    13
    2023-10-09 00:00:00.00089319187741.69611813
    14
    2023-04-10 00:00:00.000112973452752.619812086
    15
    2023-03-20 00:00:00.000152505714176.242503322
    16
    2023-07-17 00:00:00.00074889233754.252930148
    17
    2023-07-03 00:00:00.00070419288488.832608674
    18
    2023-11-20 00:00:00.000104709430877.27545566
    19
    2023-01-16 00:00:00.000150832641412.829862112
    20
    2023-05-15 00:00:00.00081324225076.318877883
    53
    3KB
    39s