Query editor
-- Daily TOTAL fees (measured bankr fees + both-legs LP-fee creator fees) pivoted by top 100-- tokens (ranked by LAST-30-DAY total fees; data window also last 30 days) for stacked bar chart.-- Robinhood Chain (4663).---- PERF (2026-07-26): the universe reads the MATERIALIZED VIEW-- dune.bankrofficial.result_bankr_rh_token_list instead of query_7904569. Dune inlines a-- query_NNNN ref as a SQL view and re-plans it at EVERY reference, and the tokens CTE is-- referenced 4x here — that expansion is what pushed this query past Trino's stage limit-- ("too many stages"). The matview is a plain table scan. It lags live by ~1.5h, which only-- affects tokens launched within that window (no material fees yet).---- CONTRACT-VERIFIED fee model (2026-07-17; validated against on-chain FeesManager pull totals):-- Bankr fees = numeraire transfers router(0x6f02)->integrator(0xF60633) attributed per-tx per-token-- (measured, never imputed: the hook fee is 0.625% of the swap OUTPUT leg steady-state but-- decays 100%->0.625% over each pool's FIRST 10 SECONDS anti-snipe window, so fee/volume is-- non-constant at launch).-- Creator fees = 95% of the per-swap LP fee (per-swap 'fee' field; 7000 = 0.700% on ~95% of-- swaps but NOT all — never a constant) charged on BOTH input legs:-- buys (user pays numeraire): num_in x fee/1e6 (accrues in the numeraire)-- sells (user pays token): num_out x fee/(1e6 - fee) (accrues in-kind in the token, valued-- in the numeraire at swap time; claimable — creator side is always exactly 95%, custom splits-- only subdivide it among wallets).-- Conversion swaps (sender = fee router; the hook selling collected token fees) are excluded from-- volume math but DO pay the LP fee on their token input, so they enter the sell-side-- creator-fee term (and ONLY that term). Fee-transfer attribution per tx stays intact.-- The FeesManager->PoolManager WETH flow is a zero-net settlement wash of the hook fee — never counted.-- STOCK-PAIRED launches (numeraire = a tokenized stock, 18-dec): pools gated on the Doppler-- initializer hooks 0x4e34...a544 + fee 8388608 (competing scam/organic pools on the same-- token/stock pairs use hooks=0x0). Numeraire legs valued at daily stock USD (query_8038736).-- Stock-denominated bankr fee transfers have amount_usd = NULL in tokens.transfers — valued as-- decimal-normalized amount x stock_usd, never SUM(amount_usd).---- FEE V3 (added 2026-07-31): RH flipped to fee v3 ~2026-07-28. Post-flip pools accrue Bankr-- fees on FeesManager 0x9982538F41f2ae29ddb9d3D9307010052984FDbB and claim LUMPILY (in the-- quote token) to the treasury Safe 0x5f8DA8..595E508 + flywheel Safe 0x042455..419b13, so-- the per-swap router->integrator transfers (and the measured creator model) do not exist-- for them. Tokens with created_at >= 2026-07-28 therefore use MODELED daily fees instead:-- total = (bankr 0.007125 + creator 0.00665 = 0.013775) x quote-side volume, BUYS AND SELLS-- (fix 2026-11-06: the hook charges buys AND sells; FeesManager Release intervals =-- 13,775 pips of buy+sell volume, so a buy-only base read half)-- (valued at swap time; WETH at minute ETH, stock at daily stock USD). Pre-flip tokens keep-- the measured legs (their legacy fee route keeps flowing forever). The measured CTEs-- exclude v3 tokens and daily_modeled includes ONLY them — disjoint, no double counting.WITH tokens AS (SELECT token_address, token_symbol, numeraire, is_stock_paired, created_atFROM dune.bankrofficial.result_bankr_rh_token_list),stock_registry AS (SELECT numeraire_address FROM query_8038711),stock_prices AS (SELECT CAST(day AS date) AS day, stock_address, stock_usd FROM query_8038736),stock_tokens AS (SELECT DISTINCT token_address FROM tokens WHERE is_stock_paired),pools AS (-- WETH-numeraire pools (legacy gate, unchanged)SELECT i.id,CASE WHEN i.currency0 = 0x0bd7d308f8e1639fab988df18a8011f41eacad73 THEN i.currency1 ELSE i.currency0 END AS token_address,