Query editor
-- Use Case 5 — Polymarket Hormuz crisis: daily YES probabilities-- Three markets covering the full arc of the Feb–May 2026 Iran/Hormuz crisis:-- 1. "Will Iran close the Strait of Hormuz by March 31?" ($49.6M notional)-- 2. "Strait of Hormuz traffic returns to normal by end of April?" ($8.0M)-- 3. "Strait of Hormuz traffic returns to normal by end of May?" ($3.9M)---- Output: daily volume-weighted YES probability + daily volume + trade count-- Only includes hours with actual trades (not forward-filled).-- Join externally to Brent ICE futures daily closes for the co-movement chart.WITH closure_market AS (SELECTCAST(hour AS date) AS day,'closure_by_mar31' AS series,COALESCE(SUM(vwap * volume_usd) / NULLIF(SUM(volume_usd), 0),MAX(close)) AS yes_prob,SUM(volume_usd) AS day_volume_usd,SUM(trade_count) AS day_tradesFROM polymarket_polygon.ohlcv_hourlyWHERE market_id = '0x561cd8d035bac38ed04e23d7882a126da38d7ead9d6679f722ad62c0c9d54ad2'AND outcome = 'Yes'AND block_month >= date '2026-01-01'AND block_month <= date '2026-03-31'AND NOT is_forward_filledGROUP BY 1),reopening_apr_market AS (SELECTCAST(hour AS date) AS day,'reopen_by_end_apr' AS series,COALESCE(SUM(vwap * volume_usd) / NULLIF(SUM(volume_usd), 0),MAX(close)) AS yes_prob,SUM(volume_usd) AS day_volume_usd,SUM(trade_count) AS day_tradesFROM polymarket_polygon.ohlcv_hourlyWHERE market_id = '0x924a2942747dd75703321a7c8d809c68f6a514c3b0f2a2e64274e02310634669'AND outcome = 'Yes'AND block_month >= date '2026-03-01'AND block_month <= date '2026-05-31'AND NOT is_forward_filledGROUP BY 1),reopening_may_market AS (SELECTCAST(hour AS date) AS day,'reopen_by_end_may' AS series,COALESCE(SUM(vwap * volume_usd) / NULLIF(SUM(volume_usd), 0),MAX(close)) AS yes_prob,SUM(volume_usd) AS day_volume_usd,SUM(trade_count) AS day_tradesFROM polymarket_polygon.ohlcv_hourlyWHERE market_id = '0x518a5b030b205706b8ffe6bbad9bd3de59548348e5c0471827f5de21e513333c'AND outcome = 'Yes'AND block_month >= date '2026-03-01'