← All posts

· XingAI Polymarket AI

Scanner Computes, Human Confirms: Polymarket AI Phase 1–2

Polymarket AI scans prediction markets, estimates edge, and sizes positions with fractional Kelly. The tempting failure mode: wire a cron job to the CLOB and let edge > 5% auto-trade.

We ship the opposite — documented in ADR-002 and ADR-004.

Worker computes; human approves

Scanner/Worker  →  edge + Kelly + risk gates  →  SQLite cache + audit log
CLI             →  ConfirmationHandler y/n/q  →  approved list only
Execution       →  not in Phase 1–2
LayerMay doMust not
DecisionMakerCompute TradeDecision, write auditPlace orders
ConfirmationHandlerPresent EXECUTE list; collect approvalAuto-approve in production
scan.py --dry-runFilter statsPrompt or execute

auto_approve=True is backtest and paper replay only.

Risk gates before the human sees anything

Thresholds live in config/strategy.yml — no magic numbers in Python:

  • Minimum edge (default 5%)
  • Max single bet % of bankroll
  • Daily loss stop
  • Correlation dedup in OpportunityRanker

The operator approves among pre-filtered decisions — not raw market noise.

Telegram: notify ≠ confirm

Phase 2 optional stub sends a Telegram alert when TELEGRAM_BOT_TOKEN is set. It does not wait for a reply. Approval stays on the CLI.

ADR-004 defines Phase 3 reply confirm (YES <trace_id>) before any mobile path can substitute for terminal approval. ADR-003 adds G1–G7 for live CLOB writes in Phase 4+.

Same brand line as Invest AI

Decision Engine ADR-003 and Invest AI ADR-028 use the same pattern: decision assistant, not auto-trader.

What we said no to

  • Full auto-trader on edge threshold — liability and brand.
  • LLM sizing at request time — breaks audit and reproducibility.
  • Telegram delivery as approval — ADR-004 blocks that confusion early.

Further reading: MCP architecture best practices · Claims supervisor POC