How it works
Signals in. Risk-checked orders out.
polybot is a control loop, not a workflow. Strategies and agents emit signals; the core sizes them, enforces your risk invariants, and routes them to venues — with a full audit trail on every action.
How it works
Signals in. Risk-checked orders out.
Strategies and AI models emit signals. The core sizes them, checks them against your risk invariants, and routes them to venues — with agents and operators gating anything that goes live.
The stack, layer by layer
Principals
Three kinds of actor drive polybot: strategies (10 BaseStrategy subclasses), AI agents (via the MCP server) and you (the operator, at the CLI). All of them produce signals or proposals — none of them place orders directly.
Domain model
Pydantic types for Market, Order, Position, Signal and PriceUpdate. Strategies reason about these objects; the executor translates signals into venue-specific orders. State is fundamental, not incidental.
Risk gate
Before any order is submitted, the platform checks it against per-market, per-category, per-venue and global USD caps plus daily loss limits. The same invariants apply to every strategy and every venue.
Execution & venues
The executor routes risk-checked orders to Polymarket, Kalshi, Opinion or Binance through the BaseVenue abstraction, and reconciles fills, partial fills and cancellations back into position state.
Data & analytics
A SQLite operational store (ACID) holds live state; a DuckDB analytics store powers strategy assessment. Services talk over NNG pub/sub, and Prometheus metrics scrape into Grafana.
Observability & audit
Every signal, order and MCP tool call is written to an audit log with timestamp and actor. A FastAPI + WebSocket dashboard shows real-time P&L and order flow.
Quickstart in six steps
- 1
Install
pip install polybot-trader, then copy .env.example to .env and add your Polymarket private key and proxy address.
- 2
Initialise
Run polybot db init to create the SQLite operational store and DuckDB analytics store.
- 3
Enable a strategy in shadow
polybot strategy enable arbitrage, then polybot strategy shadow arbitrage --enable so it paper-trades without touching funds.
- 4
Start and watch
polybot start brings up the stack and the dashboard at http://localhost:8000/ui. Watch shadow fills and P&L accumulate.
- 5
Connect an agent (optional)
polybot mcp start exposes the MCP server so Claude, GPT or any MCP client can analyse strategies and propose changes you approve at the CLI.
- 6
Promote to live
Once a strategy proves out in shadow, promote it per-strategy to live. Risk caps and approval gates stay enforced.
Need an agent system built like this?
Cryptuon builds production AI agents, MCP integrations, and trading systems. polybot is our open-source showcase.