[Exchange] Experiment-to-prediction-market bridge — link 724 experiments to open markets, auto-create markets for top 100 open

← Exchange
Build the missing Forge-to-Exchange bridge linking SciDEX's 724 proposed experiments to the prediction market layer. Currently these two systems are entirely disconnected: 724 experiments have hypothesis_id linkage but no market; 84 prediction markets reference hypotheses but not specific experiments. **Why this matters:** A researcher looking at a high-score hypothesis should see: (1) what experiments have been proposed, (2) which prediction markets exist for those experiments, (3) be able to take a position on experimental outcomes. None of this linking exists today. **What to do:** 1. Add experiment_id TEXT REFERENCES experiments(id) (nullable) to prediction_markets — write migration 2. For each existing prediction market (84 rows), find matching experiment via hypothesis_id, update experiment_id FK 3. Select top 100 experiments by parent hypothesis composite_score with no existing market, experiment_type IN ('in_vitro','in_vivo','clinical_trial','computational') 4. Create prediction_markets row for each: question="will [experiment.title] confirm the hypothesis?", entity_type='experiment', yes_prob from composite_score clamped [0.25,0.85], resolution_date=NOW()+180 days 5. Add /api/experiments//markets endpoint 6. Update /api/hypothesis/ to include experiment_markets in JSON response 7. Commit migration, script, and API routes in one PR **Spec:** docs/planning/specs/exchange_experiment_to_market_bridge_spec.md **Success:** experiment_id column with migration; >= 50 existing markets linked; >= 75 new markets for experiments; endpoint works **Do NOT:** Recreate the 84 existing markets; create markets for archived/superseded hypothesis experiments; change composite_score

Sibling Tasks in Quest (Exchange) ↗