Query editor
-- index: position KPIs for a {{position_usd}} position-- 2026-08-05 fix (audit C2): price_usd is the price at the most recent trade this query saw WHEN IT-- LAST RAN, not a live tick. The audit caught the board 8 widget describing this as "live price"-- while showing a cached result 21 hours old and 9 to 21 percent below same-day Blockscout,-- DexScreener and GeckoTerminal reads. This SQL itself always computes the latest trade as of-- execution time; the staleness is entirely a function of Dune's cached-result age between runs,-- which this query cannot see or report on its own (Dune does not expose "when did I last run" as-- a selectable column). Fix here is limited to language: every "live price" phrase below is now-- "most recent trade price at last query run"; the widget-facing correction (retitle the panel with-- an explicit run timestamp, or move it to a refresh schedule) is a Dune widget-description edit-- with no repo mirror, queued in docs/dashboards.md's "2026-08-05 queued board-text corrections"-- section for Task 4 to apply live.-- Most recent trade price at last query run is derived from the most recent trade across both-- pools. The hookless v3 pool is directly addressable in dex.trades. The hooked v4 pool is not:-- dex.trades attributes all v4 pool rows to the shared PoolManager address, never to a per-pool-- identity (docs/notes/robinhood-schema.md section 3), so its price comes from the decoded-- uniswap_v4_robinhood.poolmanager_evt_swap table keyed by poolId, with the native ETH leg priced-- against prices.usd WETH (same USD price as ETH).-- index_e reuses this exact price CTE approach so both pages agree on price.-- 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