Query editor
-- 00 · Classifier: prediction markets on AI solving math, and on breaking encryption-- Venues: Polymarket + Kalshi (prediction_markets.markets). Single markets only, parlays excluded.-- The other queries in this analysis read this one as query_<ID>, so the keyword rules-- and the exclusion list live in one place.with excluded (market_id) as (-- False-positive market_ids go herevalues ('__none__')),base as (selectvenue, market_id, event_id, series_id, question, event_name, yes_outcome_name,category, category_native, link, status, is_resolved, resolved_outcome,settlement_value_usd, market_start_time, market_end_time, settlement_ts,lower(coalesce(question, '') || ' | ' || coalesce(event_name, '')) as txt,lower(coalesce(category_native, '')) as tagsfrom prediction_markets.marketswhere not coalesce(is_parlay, false)),flags as (select*,regexp_like(txt, '\b(ai|a\.i\.|artificial intelligence|agi|llms?|openai|deepmind|gemini|anthropic|claude|chatgpt|gpt-?[0-9o.]*|grok|xai|deepseek|alphaproof|alphageometry|alphaevolve|o3|o4)\b')or regexp_like(tags, '(^|[^a-z])ai([^a-z]|$)') as has_ai,regexp_like(txt, '\b(imo|math(ematical|s)? olympiad|putnam|aimo|frontiermath|millennium prize|riemann|navier[- ]stokes|hodge|yang[- ]mills|p ?(vs\.?|versus|=|!=) ?np|erd(o|ö|ő)s|collatz|twin prime|goldbach|conjecture|theorem|fields medal|unsolved|open (math )?problems?|math(ematics|ematical)?|proofs?)\b')as has_math,regexp_like(txt, '\b(rsa(-?2048)?|ecdsa|elliptic curve|sha-?256|aes(-?256)?|encrypt\w*|decrypt\w*|cryptograph\w*|private keys?|q-day|shor|post-quantum|quantum[- ](resistant|safe|secure|attack)|crack(s|ed|ing)? (rsa|encryption|bitcoin|btc|sha)|break(s|ing)? (rsa|encryption|bitcoin|btc|sha))\b')as has_crypto_break,regexp_like(txt, '\b(quantum|qubits?)\b') as has_quantum,regexp_like(txt, 'satoshi.*(coins?|wallet|btc|bitcoin).*(move|moved|spent|transfer)') as has_satoshi_move,regexp_like(txt, '\b(stock|shares?|share price|market cap|ipo|ticker|close (above|below)|ionq|rigetti|qubt|d-wave|quantum computing inc)\b|\$[0-9]')as looks_like_price_marketfrom base),classified as (select*,casewhen has_ai and has_math then 'ai_solves_math'when has_ai and has_crypto_break then 'ai_breaks_encryption'when has_quantum and (has_crypto_break or has_satoshi_move) then 'quantum_breaks_encryption'when has_crypto_break and not looks_like_price_market then 'encryption_break_other'when has_satoshi_move then 'satoshi_coins_move'when regexp_like(txt, '\b(riemann|navier[- ]stokes|millennium prize|p ?(vs\.?|versus|=|!=) ?np|collatz|twin prime|goldbach|erd(o|ö|ő)s)\b')then 'math_milestone_no_ai_named'when has_quantum and not looks_like_price_market then 'quantum_milestone_context'end as sub_themefrom flags)selectcase when sub_theme in ('ai_solves_math', 'math_milestone_no_ai_named') then 'ai_math'else 'encryption_breaking' end as theme,sub_theme, venue, market_id, event_id, series_id, question, event_name, yes_outcome_name,category, category_native, status, is_resolved, resolved_outcome, settlement_value_usd,market_start_time, market_end_time, settlement_ts, link,has_ai, has_math, has_crypto_break, has_quantum, looks_like_price_marketfrom classified cwhere sub_theme is not nulland not exists (select 1 from excluded e where e.market_id = c.market_id)