A comprehensive data tracker and automated trading system for Polymarket prediction markets, focused on earnings trading strategy via IBKR.
/trades (smart Option A weekly timer; Findings #269/#287/#288/#289 โ formerly Dome API, EOL'd Apr 28, 2026)U2โฆ13 since 2026-01-07 (SoT: src/earnings/strategy_changelog.py launch entry; docs/STRATEGY.md)| Document | Purpose |
|---|---|
| docs/AGENT_HANDOFF.md | Onboarding for new agents/operators โ full doc index, deploy, rules, code map. ยง11 has the current state + ranked outstanding work. |
| docs/STRATEGY_PLAYBOOK.md | Forward-looking source of truth for strategy improvements: ranked Action Queue, verified findings (mechanism + bias check), retracted findings (so they don't get re-suggested), implementation notes per rule. Mirrors the dashboard ๐ฏ Action Queue tab. |
| docs/STRATEGY_AUDIT_v3.md | Audit trail โ every hypothesis tested, audit-process learnings, ยง10 Apr 25 retraction of Finding A via the comprehensive simulator. |
| docs/FINDINGS.md | Canonical narrative for every numbered finding (per .cursor/memory.md ยงJ). For the live production baseline, see newest DEPLOYED entries in FINDINGS and docs/AGENT_HANDOFF.md ยง11 (do not use a frozen "Latest: #N" pointer โ drift class C7). Headline weeks (history): #227 (Apr 21โ22 learning loop), #228 (Apr 25 Finding-A retraction), #240 (Apr 26 equity 1m bars infrastructure), #250-#261 (Apr 27 Database Integrity Audit + dashboard rebuild), #262-#274 (Apr 27 evening โ dashboard 500 chain + rigorous re-audit). |
| docs/DATABASE_AUDIT_2026_04_27.md | Frozen baseline of the Apr 27 audit + post-audit appendix listing what shipped (Phase 1-6 outcomes + tonight's findings #267-#274). |
| docs/DATA_ARCHITECTURE.md | DB tables, collectors, retention. v1.6 (Apr 27, post-audit). |
| docs/DATA_INTEGRITY.md | Integrity monitor architecture (replaces v2/v3 watchdogs Apr 27). Rule count is live via GET /api/integrity โ summary.total (src/data_tracker/integrity_monitor.py; was 37 post-#291 May 10, 2026). Volume gate default $1,000 (Config.SIGNAL_MIN_VOLUME_TOTAL, Finding #311). |
| docs/STRATEGY.md | Long-form trading rules, position sizing, schedules, exchange semantics. |
| docs/OPERATIONS.md | Deployment, infrastructure, services, backfill, simulator/report regeneration. |
| docs/API_REFERENCE.md | Polymarket API reference (gamma-api, data-api, clob, WSS) |
| src/ibkr/IBKR_INTEGRATION_SPEC.md | IBKR integration details |
Repo: https://github.com/eumarius/earnings-trading-bot-.git
Flow: local machine โ GitHub โ server
Deploy: [hidden]/deploy/deploy_from_github.sh
CI checks: scripts/verify_retry_backoff_and_block.py runs on every push/PR
Alerts: Telegram on failure (configured via GitHub Actions secrets)
http://[hidden]:8080
ssh root@[hidden]
ps aux | grep -E 'gamma_collector|backfill|uvicorn' | grep -v grep
cd /Users/marius/projects/polymarket-bot
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt -c constraints.txt # prod versions (#473)
cp .env.example .env # Configure DATABASE_URL
# .env file
DATABASE_URL=postgresql+pg8000://user:[REDACTED]@host:25060/defaultdb
# DOME_API_KEY removed Finding #289 (Dome EOL Apr 28, 2026). All consumers migrated to data-api.polymarket.com.
Live state (Apr 25, 2026): 109 closed trades, +$61 net P&L, 33 % win rate. Direction is correct 83 % of the time; the leak is in the stop-loss conversion. See docs/STRATEGY_PLAYBOOK.md ยง1 for the current verdict and ยง2 for the ranked action queue (mirrored in the dashboard ๐ฏ Action Queue tab).
Original projections (kept for reference):
| Phase | Capital | Leverage | Expected ROI |
|---|---|---|---|
| Phase 1 | $25,000 | 2x | +50.6%/season |
| Phase 2 | $110,000 | 6x | +166.2%/season |
Core rules (current):
- Conviction โฅ70 % โ Trade ยท โฅ90 % LONG โ SKIP (Mar 9, Finding #202)
- Beat โฅ70 % โ LONG | Miss โฅ70 % โ SHORT
- BMO > AMC priority ยท BMO exit at 10:32 AM ET (extended hold)
- Volume gate $2K cumulative (max(DB, Gamma) โ Finding #282, Apr 30 2026; previously "DB else Gamma" per Findings #222-#226)
- All stops use STOP-LIMIT with 2 % buffer (Finding #179)
- Up next: skip LONGs in downtrend, drift filter, Mid-cap conviction tightening โ see Action Queue.
See docs/STRATEGY.md for the long-form rules and docs/STRATEGY_PLAYBOOK.md for the operational forward plan.
polymarket-bot/
โโโ docs/ # Documentation
โ โโโ STRATEGY.md # Trading strategy
โ โโโ OPERATIONS.md # Deployment & operations
โ โโโ API_REFERENCE.md # API reference
โ โโโ archive/ # Old documentation
โโโ src/
โ โโโ earnings/ # Trading automation
โ โโโ data_tracker/ # Data collection
โ โ โโโ collectors/ # gamma_collector, backfill scripts
โ โโโ ibkr/ # IBKR integration
โโโ earnings_dashboard/ # Web dashboard
โโโ archive/PROJECT_STATUS.md # Historical snapshot (archived)
โโโ constraints.txt # Full prod venv freeze (install constraints)
โโโ requirements.txt # Dependencies, pinned to prod (#473)
| Component | Status |
|---|---|
| Earnings trader (live) | โ
earnings-trader.service active โ IBKR Live Gateway, ~$2,440 trading capital |
| Data Collection | โ
polymarket-collector.service (markets + orderbooks every 60s) |
| Outcome resolver | โ
polymarket-resolver.timer daily 06:00 ET (Finding #227) |
| Database | โ PostgreSQL + TimescaleDB on DigitalOcean |
| Dashboard | โ Live at http://[hidden]:8080 (๐ Strategy Analysis tab = forward plan; ๐ฏ Action Queue at top of that tab) |
| Strategy work | ๐ Apr 25: Finding #228 retracted v3 Finding A; ranked queue in docs/STRATEGY_PLAYBOOK.md ยง2 |
This bot is for educational purposes. Trading involves risk. Always:
MIT