Query editor
-- v4meta: fee flow leaderboard, trailing 7d. Gross swap fees charged on the hooked pool itself,-- by token. This is the fee the hook had to work with. It is NOT holder revenue: what each hook-- does with the fee (burn, reflect, route to a treasury, leave it as LP yield) differs per hook-- and is not decoded here.---- Measured vs estimated, and why they are separate columns:-- Measured: the Swap event carries its own fee column (uint24 ppm, the fee actually applied to-- that swap). Where it is a usable rate, this query multiplies it by that swap's USD size. That-- is a real, per-swap, on-chain number.-- Estimated: many hooked pools report fee = 0 on the Swap event AND carry-- fee = 8388608 = 0x800000 on Initialize, which is the Uniswap v4 DYNAMIC-FEE FLAG, not a rate-- (74,034 of 97,020 hooked pools carry it; reading it as ppm would report an 838 percent fee).-- On those swaps the hook is almost certainly taking its cut through beforeSwap return deltas,-- which this table does not decode, so the real rate is unknown. The brief's assumed 3 percent-- is applied to that volume and reported in its own column.-- An earlier version summed measured and estimated into one number and ranked on the total.-- That put fabricated values on top: observed real fees run a median near 225 ppm-- (0.0225 percent), so a 3 percent assumption dwarfs every measured row. Ranking is therefore-- driven by measured fee only, and the estimate rides alongside as a labeled unknown.---- USD comes from each swap's own dex.trades row via a (tx_hash, evt_index) join; see v4meta_a's-- header for why prices.usd cannot price this chain's tokens.with roster as (selectid as pool_id,currency1 as token_address,fee as fee_ppmfrom uniswap_v4_robinhood.poolmanager_evt_initializewhere hooks <> 0x0000000000000000000000000000000000000000),priced as (selectr.token_address,t.amount_usd,casewhen s.fee > 0 and s.fee < 1000000 then cast(s.fee as double)when r.fee_ppm is not null and r.fee_ppm <> 8388608 and r.fee_ppm > 0 then cast(r.fee_ppm as double)else nullend as fee_ppm_measuredfrom 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 '7' daywhere s.evt_block_time > now() - interval '7' dayand t.amount_usd is not null),sym as (select contract_address, arbitrary(symbol) as symbolfrom tokens.erc20where blockchain = 'robinhood'group by 1),agg as (selecttoken_address,sum(amount_usd) as hooked_usd_7d,