Query editor
-- index: hooked vs hookless daily volume and hook share-- The hookless v3 pool is directly addressable in dex.trades via project_contract_address.-- The hooked v4 pool is not (see index_b's header comment and docs/notes/robinhood-schema.md-- section 3: all v4 pools post to dex.trades under the shared PoolManager address, not per pool),-- so the hooked leg is computed from the decoded poolmanager_evt_swap table keyed by poolId,-- with the native ETH leg priced against prices.usd WETH.-- 2026-08-05 fix (audit I3): the hooked v4 pool existed before the hookless v3 pool ever traded, so-- the earliest days had hooked_usd > 0 and hookless_usd = 0, which makes hook_share compute to-- exactly 1.0 (100 percent) for a flat multi-day plateau at the start of the series. That plateau-- reads as "the hook captured everything" when it is really a pre-existence artifact of the v3 pool.-- Fixed by starting the series at the first day the hookless leg has ANY row, per the audit's first-- suggested fix (start at the first day both pools recorded volume).with v4_swaps as (selectevt_block_time as block_time,abs(cast(amount0 as double)) / 1e18 as eth_amtfrom uniswap_v4_robinhood.poolmanager_evt_swapwhere id = 0x00dd2df2f17d431cf3a0938f06c9cf9abc5e9643b6cc466ca3f71f3af246edf3and evt_block_time > now() - interval '90' day),weth_px as (select date_trunc('hour', minute) as hour, avg(price) as weth_usdfrom prices.usdwhere blockchain = 'robinhood'and symbol = 'WETH'and minute > now() - interval '90' daygroup by 1),hooked_daily as (selectdate_trunc('day', s.block_time) as day,sum(s.eth_amt * p.weth_usd) as hooked_usdfrom v4_swaps sjoin weth_px p on date_trunc('hour', s.block_time) = p.hourgroup by 1),hookless_daily as (selectdate_trunc('day', block_time) as day,sum(amount_usd) as hookless_usdfrom dex.tradeswhere blockchain = 'robinhood'and project_contract_address = 0xD29893fFac8b29eC4Db2cfE0CDB3FE1377c028Ffand block_time > now() - interval '90' daygroup by 1),combined as (selectcoalesce(h.day, l.day) as day,coalesce(h.hooked_usd, 0) as hooked_usd,coalesce(l.hookless_usd, 0) as hookless_usdfrom hooked_daily hfull outer join hookless_daily l on h.day = l.day),first_both_day as (-- earliest day the hookless leg has any row at all; days before this predate the v3 pool's-- first trade and are excluded so the series does not open on a false 100 percent plateauselect min(day) as day from hookless_daily)select