Query editor
WITH live_pools (pool, venue, pair, fee_or_tick) AS (VALUES(0xd0b53D9277642d899DF5C87A3966A349A798F224, 'UniV3', 'WETH/USDC', '500'),(0xcDAC0d6c6C59727a65F871236188350531885C43, 'Aero', 'WETH/USDC', 'vAMM'),(0x47cA96Ea59C13F72745928887f84C9F52C3D7348, 'AeroCL', 'cbETH/WETH', 'ts1'),(0x861A2922bE165a5Bd41b1E482B49216b465e1B5F, 'AeroCL', 'wstETH/WETH', 'ts1')),window_trades AS (SELECTt.project_contract_address AS pool,t.project, t.version, t.block_time, t.amount_usd, t.tx_hash, t.tx_fromFROM dex.trades tWHERE t.blockchain = 'base'AND t.block_month IN (DATE '2026-06-01', DATE '2026-07-01')AND t.block_time >= TIMESTAMP '2026-06-16 00:00:00'AND t.block_time < TIMESTAMP '2026-07-16 00:00:00'AND t.project_contract_address IN (0xd0b53D9277642d899DF5C87A3966A349A798F224,0xcDAC0d6c6C59727a65F871236188350531885C43,0x47cA96Ea59C13F72745928887f84C9F52C3D7348,0x861A2922bE165a5Bd41b1E482B49216b465e1B5F))SELECTlp.venue,lp.pair,lp.fee_or_tick,lp.pool,COUNT(wt.tx_hash) AS swaps,COUNT(DISTINCT wt.tx_hash) AS txs,COUNT(DISTINCT wt.tx_from) AS distinct_senders,ROUND(SUM(wt.amount_usd), 0) AS volume_usd,ROUND(AVG(wt.amount_usd), 2) AS avg_trade_usd,ROUND(COUNT(wt.tx_hash) / (30.0 * 24.0), 1) AS swaps_per_hr,MIN(wt.block_time) AS first_seen,MAX(wt.block_time) AS last_seen,MIN(wt.project) AS dune_project,MIN(wt.version) AS dune_versionFROM live_pools lpLEFT JOIN window_trades wt ON wt.pool = lp.poolGROUP BY 1, 2, 3, 4ORDER BY volume_usd DESC NULLS LAST;