Query editor
-- index: revenue scenarios for a {{position_usd}} position-- Regime labels are fixed for the dashboard: current, normal (healthy july median), best case (all-- volume re-hooked). Price and pool-volume CTEs mirror index_a's approach exactly (same v3_px /-- v4_last_swap / weth_px_v4 / v4_px / px / latest_px chain, copied in rather than a hardcoded price),-- since dex.trades cannot address the hooked v4 pool directly (docs/notes/robinhood-schema.md-- section 3). See index_a's header comment for the full explanation.-- Eligible supply is wired live from query_8202024 (index: eligible supply and holder counts)-- instead of the census's 943M placeholder, per Task 2 Step 3.with v3_px as (select block_time, amount_usd / nullif(token_bought_amount, 0) as price_usdfrom dex.tradeswhere blockchain = 'robinhood'and project_contract_address = 0xD29893fFac8b29eC4Db2cfE0CDB3FE1377c028Ffand token_bought_address = 0x56910D4409F3a0C78C64DD8D0545FF0705389870and amount_usd > 10order by block_time desclimit 1),v4_last_swap as (selectevt_block_time as block_time,abs(cast(amount0 as double)) / 1e18 as eth_amt,abs(cast(amount1 as double)) / 1e18 as index_amtfrom uniswap_v4_robinhood.poolmanager_evt_swapwhere id = 0x00dd2df2f17d431cf3a0938f06c9cf9abc5e9643b6cc466ca3f71f3af246edf3order by evt_block_time desclimit 1),weth_px_v4 as (select avg(price) as weth_usdfrom prices.usdwhere blockchain = 'robinhood'and symbol = 'WETH'and minute between (select block_time from v4_last_swap) - interval '1' hourand (select block_time from v4_last_swap) + interval '1' hour),v4_px as (select v.block_time, (v.eth_amt * w.weth_usd) / nullif(v.index_amt, 0) as price_usdfrom v4_last_swap v cross join weth_px_v4 w),px as (select price_usd, block_time from v3_pxunion allselect price_usd, block_time from v4_px),latest_px as (select price_usd from px where price_usd is not null order by block_time desc limit 1),v4_last7 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 '7' day),weth_px_7d as (select date_trunc('hour', minute) as hour, avg(price) as weth_usdfrom prices.usdwhere blockchain = 'robinhood'