Query editor
-- v4meta: daily hooked-pool volume by token, top 15 tokens by trailing 30d hooked volume,-- stacked-bar friendly (one row per day per token).---- Mechanism: decoded uniswap_v4_robinhood.poolmanager_evt_swap joined to the hooked roster on-- poolId, then joined to that same swap's dex.trades row on (tx_hash, evt_index) for USD.-- Why not dex.trades alone: recon section 3 proves every v4 pool's dex.trades rows share one-- project_contract_address (the PoolManager singleton), so dex.trades cannot tell hooked pools-- from hookless ones. Why not prices.usd: it carries only WETH and USDG for this chain over 7d,-- so per-token pricing would collapse this chart to two series. The (tx_hash, evt_index) join-- gets exact per-pool attribution AND Dune's own USD pricing at a measured 97.6 percent match-- rate. See v4meta_a's header for the full smoke-test record.---- Grouping key is token_address, never token_symbol: two distinct ERC20s can share a ticker, and-- on this chain they routinely do (the launchpad has minted thousands of near-duplicate symbols).-- symbol is display only, resolved through an arbitrary() aggregate so it cannot multiply rows.with roster as (selectid as pool_id,currency1 as token_addressfrom uniswap_v4_robinhood.poolmanager_evt_initializewhere hooks <> 0x0000000000000000000000000000000000000000),hooked as (selectdate_trunc('day', s.evt_block_time) as day,r.token_address,t.amount_usdfrom uniswap_v4_robinhood.poolmanager_evt_swap sjoin roster ron s.id = r.pool_idjoin dex.trades ton t.tx_hash = s.evt_tx_hashand t.evt_index = s.evt_indexand t.blockchain = 'robinhood'and t.block_time > now() - interval '30' daywhere s.evt_block_time > now() - interval '30' day),daily as (select day, token_address, sum(amount_usd) as volume_usdfrom hookedgroup by 1, 2),top_tokens as (select token_address, sum(volume_usd) as vol_30dfrom dailygroup by 1order by vol_30d desclimit 15),sym as (select contract_address, arbitrary(symbol) as symbolfrom tokens.erc20where blockchain = 'robinhood'group by 1)selectd.day,coalesce(y.symbol, cast(d.token_address as varchar)) as token,d.volume_usdfrom daily d