A prediction market scanner with research-first architecture. Fetches markets from Polymarket, researches them via SearXNG, and analyzes with LLM to find trading opportunities.
┌─────────────────┐ ┌──────────────────┐ ┌─────────────┐
│ Market Fetcher │────▶│ Research Engine │────▶│ Analyzer │
│ (Polymarket) │ │ (SearXNG) │ │ (Ollama) │
└─────────────────┘ └──────────────────┘ └─────────────┘
│ │ │
└────────────────────────┴──────────────────────┘
│
┌────────▼────────┐
│ SQLite DB │
│ (markets.db) │
└─────────────────┘
cd /home/max/projects/polymarket-v6
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtFetch all markets, research new/stale ones, analyze with LLM:
python -m src.scanner --full
python -m src.scanner --full --limit 100 # Test with 100 marketsOnly process truly NEW markets discovered since last run:
python -m src.scanner --incrementalUpdate prices, clean resolved markets:
python -m src.scanner --maintenancepython -m src.scanner --opportunities
python -m src.scanner --opportunities --min-edge 0.10 # Higher edge thresholdpython -m src.scanner --stats| Flag | Default | Description |
|---|---|---|
--db |
data/markets.db |
SQLite database path |
--searxng |
http://100.112.76.34:8888 |
SearXNG URL |
--ollama |
http://100.112.76.34:11434 |
Ollama URL |
--model |
qwen2.5:32b |
Ollama model |
--limit |
None | Limit markets to process |
--min-edge |
0.05 | Minimum edge for BUY signal |
--min-confidence |
0.6 | Minimum confidence |
marketstable stores all market data- Tracks
first_seen_atto identify new markets - Preserves research and analysis on upsert
- Indexes on status, edge, and first_seen
- BUY: Edge > 5% AND Confidence > 60%
- AVOID: Edge < -10% AND Confidence > 70%
- SKIP: Everything else
Conservative sizing based on liquidity:
- Liquidity < $500: max $10
- Liquidity $500-2000: max $25
- Liquidity $2000-10000: max $50
- Liquidity > $10000: max $100
Actual size scaled by edge × confidence.
- Research-First: Web research happens BEFORE LLM analysis
- No Liquidity Filter: Catches small market opportunities
- Parallel Research: 200 concurrent SearXNG searches
- Incremental Mode: Only processes truly new markets
- Proper Maintenance: Cleans resolved markets, updates prices