Skip to content

indrarg8899/polyforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PolyForge

Multi-agent autonomous trading system for Polymarket prediction markets, powered by Xiaomi MiMo V2.5 Pro as the long-chain reasoning core.

What It Solves

Polymarket has 1000+ active markets at any moment. Manual traders cannot scan, analyze, and act on edge windows that close in minutes. Existing bots use single-shot heuristics (price drift, volume spikes) and miss the structural reasoning required for binary event resolution — oracle source mismatches, settlement timing, narrative shifts, correlated market arbitrage. PolyForge replaces the human analyst with a 5-agent pipeline where each agent specializes and MiMo provides the deep reasoning step.

Architecture

┌──────────┐  ┌──────────┐  ┌──────────────┐  ┌──────────┐  ┌──────────┐
│  Scout   │→ │ Analyst  │→ │ MiMo Reasoner│→ │   Risk   │→ │ Executor │
│ (markets)│  │ (signals)│  │ (long-chain) │  │ (sizing) │  │  (CLOB)  │
└──────────┘  └──────────┘  └──────────────┘  └──────────┘  └──────────┘
     │             │                │               │             │
     └─────────────┴────────────────┴───────────────┴─────────────┘
                          shared state bus

Agent Roles

Agent Job Model
Scout Poll Polymarket Gamma API every 15s, filter by volume/spread/time-to-resolve, push candidate markets to bus rule-based
Analyst Pull orderbook depth, historical price, anchor-source verification (Coinbase + Chainlink), produce signal dict rule-based + small LLM
MiMo Reasoner Long-chain reasoning over signal + market context, produce trade thesis with confidence score and exit conditions MiMo V2.5 Pro
Risk Manager Apply position sizing (Kelly-fraction with floor/ceiling), portfolio correlation check, daily loss cap deterministic
Executor Submit limit orders via Polymarket CLOB, monitor fill, manage exits, log to SQLite deterministic

Why MiMo

The Reasoner agent runs long-chain CoT for every trade decision. Concretely:

  1. Multi-step verification — cross-check anchor price (Polymarket crypto-price API openPrice) vs Coinbase vs Chainlink Data Streams to detect oracle gaps that flip resolution outcome
  2. Narrative weighting — read Twitter/Discord context, weigh against on-chain signals, reason about asymmetric information
  3. Counter-evidence search — explicitly search for trade-killing facts before sizing, not after
  4. Exit-condition design — generate stop-loss + take-profit + time-stop tuple per trade, tied to specific invalidation events

MiMo handles the reasoning chain end-to-end in a single inference, eliminating the multi-call orchestration overhead that other models require.

Stack

  • Python 3.12, asyncio
  • Polymarket CLOB SDK + Gamma REST API
  • Xiaomi MiMo V2.5 Pro via OpenAI-compatible endpoint
  • SQLite for trade journal, Prometheus for metrics
  • systemd service deployment

Status

  • ✅ Scout + Analyst + Risk Manager: production
  • ✅ Executor: paper trade mode (60+ trades logged)
  • 🟡 MiMo Reasoner: integrated, A/B testing against rule-based reasoner
  • 🔜 Live capital deployment: pending 30-day paper trade Sharpe > 1.0

Quick Start

git clone https://github.com/indrarg8899/polyforge
cd polyforge
pip install -r requirements.txt
cp .env.example .env  # add MIMO_API_KEY, POLYMARKET_PK
python -m polyforge.run --mode paper

License

MIT

About

Multi-agent autonomous Polymarket trader powered by Xiaomi MiMo V2.5 Pro

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages