jackguyNFT-token-dash-4 copy copy
    Updated 2023-11-16
    -- forked from NFT-token-dash-4 copy @ https://flipsidecrypto.xyz/edit/queries/c98a6dca-6bc3-4e00-a7d9-7768a1821d64

    -- forked from NFT-token-dash-4 @ https://flipsidecrypto.xyz/edit/queries/b49169f6-3d89-423e-b7e1-116ad6f63e68

    with tab1 as (
    SELECT
    pool_address
    FROM ethereum.uniswapv3.ez_swaps
    where pool_address IN (
    lower('0x5ee84bed805df225ee23aec4160cc0bfcf1bd892'),
    lower('0xe72377ae353edc1d07f6c0be34969a481d030d19'),
    lower('0x882784c5807d5e2e4950ae2327ca5d9b56a1015a'),
    lower('0x92741be6adcb2722681925afce9af0a7306ce90f'),
    lower('0x4a382e0fb2abc4bc087d2f7953a4689ecbb96374'),
    lower('0xb17015d33c97a2caca73be2a8669076a333fd43d'),
    lower('0x01a8227d4e7c3068ad1000c97a059af5c5fa3476')
    )
    AND ( token0_symbol LIKE 'μAZUKI'
    OR token1_symbol LIKE 'μAZUKI' )
    AND BLOCK_TIMESTAMP > current_date - {{ past_days }}
    GROUP BY 1
    ), tab2 as (
    SELECT
    *,
    sum(net_weth) over (ORDER by hour) as weth_bal
    FROM (
    SELECT
    date_trunc('hour', block_timestamp) as hour,
    SUM(CASE when TO_ADDRESS in (SELECT * from tab1) then amount else 0 end) - sum(CASE when FROM_ADDRESS in (SELECT * from tab1) then amount else 0 end) as net_weth
    from ethereum.core.ez_token_transfers
    where ( FROM_ADDRESS in (SELECT * from tab1)
    or TO_ADDRESS in (SELECT * from tab1) )
    and SYMBOL LIKE 'WETH'
    GROUP BY 1
    Run a query to Download Data