Query editor
with pools as (selectname,pool,token0 as token0,token1 as token1,tickSpacing as tickspacefrom dune.blackhole_foundation.result_bh_pool_metadata),pool_tokens as (select token0 as token from poolsunionselect token1 as token from pools),token_pool as (select distincta.tokenId,b.name pool_name,a.pool Pool_address,tickspacefrom blackhole_avalanche_c.nonfungiblepositionmanager_evt_increaseliquidity ajoin pools b on a.pool=b.pool),owners AS (SELECTtokenid,"to" AS current_ownerFROM(SELECTb.tokenid,b."to",ROW_NUMBER() OVER (PARTITION BY b.tokenid ORDER BY b.evt_block_time DESC) AS rnFROMblackhole_avalanche_c.nonfungiblepositionmanager_evt_transfer bwhere b.tokenId in (select distinct tokenId from token_pool)) tWHERE rn = 1)selecttokenId,pool_name,Pool_address,current_owner wallet_address,sum(liquidity) as liquidityfrom(selecta.tokenId,b.pool_name,b.Pool_address,c.current_owner,sum(actualLiquidity) as liquidityfrom blackhole_avalanche_c.nonfungiblepositionmanager_evt_increaseliquidity a