Pine Analyticsnotable-ivory copy
    Updated 2024-12-09
    -- forked from notable-ivory @ https://flipsidecrypto.xyz/studio/queries/fdad71c3-9f9d-4999-aa96-f76be2617c4c

    with tab1 as (
    SELECT tx_hash
    FROM base.core.ez_token_transfers
    where to_address like lower('0x0b480f79d77524588E29FBdBB3454f66279B16a4')
    AND block_timestamp > '2024-12-01'
    AND tx_hash like '0x68e163f7186c80075be95d9f481a7446d5a27a9e36d1d0fdd527a412a7be97a3'

    union all

    SELECT tx_hash
    FROM base.core.ez_native_transfers
    where to_address like lower('0x0b480f79d77524588E29FBdBB3454f66279B16a4')
    AND block_timestamp > '2024-12-01'
    AND tx_hash like '0x68e163f7186c80075be95d9f481a7446d5a27a9e36d1d0fdd527a412a7be97a3'
    )

    SELECT
    date(block_timestamp) as date,
    count(*) as swaps,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as swappers,
    sum(case when not AMOUNT_IN_USD is NULL then AMOUNT_IN_USD when not AMOUNT_out_USD is NULL then AMOUNT_out_USD end) as swap_volume_usd

    FROM base.defi.ez_dex_swaps
    --where tx_hash in (SELECT * from tab1)
    where block_timestamp > '2024-12-01'
    AND tx_hash like '0x68e163f7186c80075be95d9f481a7446d5a27a9e36d1d0fdd527a412a7be97a3'
    GROUP BY 1



    QueryRunArchived: QueryRun has been archived