polybot

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.

AI agent (MCP) Claude · GPT · custom Strategies 10 × BaseStrategy Operator (CLI) approvals · config polybot core Signal → sizing Risk gate (caps/limits) Executor + audit log SQLite · DuckDB · NNG pub/sub Polymarket CLOB Kalshi Opinion Binance (hedge)

The stack, layer by layer

01

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.

02

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.

03

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.

04

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.

05

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.

06

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. 1

    Install

    pip install polybot-trader, then copy .env.example to .env and add your Polymarket private key and proxy address.

  2. 2

    Initialise

    Run polybot db init to create the SQLite operational store and DuckDB analytics store.

  3. 3

    Enable a strategy in shadow

    polybot strategy enable arbitrage, then polybot strategy shadow arbitrage --enable so it paper-trades without touching funds.

  4. 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. 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. 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.