Query editor
with ev as (select 'M' as typ, evt_tx_hash as h, evt_block_time as t, evt_block_number as b, evt_index as i, owner, tickLower as tl, tickUpper as tu,cast(amount as double) as lfrom uniswap_v3_ethereum.uniswapv3pool_evt_mintwhere contract_address = 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640 and evt_block_time < timestamp '2026-08-23' and amount > 0union allselect 'B', evt_tx_hash, evt_block_time, evt_block_number, evt_index, owner, tickLower, tickUpper, -cast(amount as double)from uniswap_v3_ethereum.uniswapv3pool_evt_burnwhere contract_address = 0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640 and evt_block_time < timestamp '2026-08-23' and amount > 0),nh as (select distinct h from ev where owner = 0xc36442b4a4522e871399cd717abdd847ab11fe88),npm as (select 'M' as typ, evt_tx_hash as h, evt_index as i, tokenId, cast(liquidity as double) as lfrom uniswap_v3_ethereum.nonfungiblepositionmanager_evt_increaseliquidity where evt_tx_hash in (select h from nh)union allselect 'B', evt_tx_hash, evt_index, tokenId, -cast(liquidity as double)from uniswap_v3_ethereum.nonfungiblepositionmanager_evt_decreaseliquidity where evt_tx_hash in (select h from nh)),m as (select ev.*, n.tokenId, row_number() over (partition by ev.h, ev.i order by n.i - ev.i) as rfrom ev left join npm n on ev.owner = 0xc36442b4a4522e871399cd717abdd847ab11fe88 and n.h = ev.h and n.typ = ev.typ and n.l = ev.l and n.i > ev.i),e as (select typ, t, b, i, tl, tu, l,case when owner = 0xc36442b4a4522e871399cd717abdd847ab11fe88 then concat('nft', cast(tokenId as varchar))else concat(to_hex(owner), '_', cast(tl as varchar), '_', cast(tu as varchar)) end as pidfrom m where r = 1),st as (select pid, min(tl) as tl, min(tu) as tu, sum(l) as l from e where t < timestamp '2026-05-30' group by pid having sum(l) > 1)select 'S' as typ, pid, tl, tu, cast(null as bigint) as b, cast(null as bigint) as i, l from stunion allselect typ, pid, tl, tu, b, i, l from e where t >= timestamp '2026-05-30'