Query editor
WITH init AS (SELECT id, currency0, currency1, fee, tickSpacing, hooksFROM uniswap_v4_base.poolmanager_evt_initializeWHERE (currency0 = 0x0000000000000000000000000000000000000000AND currency1 = 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)OR (currency0 = 0x4200000000000000000000000000000000000006AND currency1 = 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)OR (currency0 = 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913AND currency1 = 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf)),sw AS (SELECT id, count(*) AS n_swaps_90d,count_if(amount0 = 0) AS n_swaps_zero_amount0FROM uniswap_v4_base.poolmanager_evt_swapWHERE evt_block_date >= DATE '2026-05-10'GROUP BY id)SELECTCASE WHEN i.currency0 = 0x0000000000000000000000000000000000000000 THEN 'ETH/USDC'WHEN i.currency0 = 0x4200000000000000000000000000000000000006 THEN 'WETH/USDC'ELSE 'USDC/cbBTC' END AS pair,to_hex(i.id) AS pool_id,i.fee AS posted_fee_pips,i.tickSpacing AS tick_spacing,to_hex(i.hooks) AS hook,bitwise_and(from_big_endian_64(from_hex(lpad(to_hex(i.hooks), 40, '0')) ), 16383) AS hook_perm_bits_lo14,coalesce(s.n_swaps_90d, 0) AS n_swaps_90d,coalesce(s.n_swaps_zero_amount0, 0) AS n_zero_amount0FROM init iLEFT JOIN sw s ON s.id = i.idWHERE coalesce(s.n_swaps_90d, 0) > 0ORDER BY n_swaps_90d DESC