Query editor
WITH m AS (SELECT DISTINCTquestion,market_description,date_diff('minute', market_start_time, market_end_time) AS dur_min,CASEWHEN STRPOS(LOWER(market_description), '15 minute') > 0OR STRPOS(LOWER(question), '15m') > 0OR regexp_like(question, '\d{1,2}:\d{2}(AM|PM|am|pm)?-\d{1,2}:\d{2}') THEN 'intraday window (5/15-min)'WHEN STRPOS(LOWER(market_description), 'hour') > 0 THEN 'hourly'ELSE 'daily / other'END AS window_type,CASEWHEN STRPOS(LOWER(market_description), 'pyth') > 0 THEN 'Pyth'WHEN STRPOS(LOWER(market_description), 'chainlink') > 0 THEN 'Chainlink'WHEN STRPOS(LOWER(market_description), 'wsj') > 0 OR STRPOS(LOWER(market_description),'wall street journal') > 0 THEN 'WSJ'ELSE 'other/unspecified'END AS price_sourceFROM polymarket_polygon.market_detailsWHERE LOWER(question) LIKE '%up or down%'AND category = 'finance'AND market_end_time >= TIMESTAMP '2026-09-01'AND market_end_time < TIMESTAMP '2026-10-13')SELECTwindow_type,price_source,COUNT(*) AS markets,ROUND(MIN(dur_min)/60.0, 1) AS min_h,ROUND(APPROX_PERCENTILE(dur_min,0.5)/60.0, 1) AS median_h,ARBITRARY(question) AS sample_questionFROM mGROUP BY 1, 2ORDER BY markets DESC