PolyBot autonomously identifies and captures pricing discrepancies across Kalshi and Polymarket — two of the world's largest prediction market platforms — using real-time data ingestion, AI-powered contract matching, and automated execution.
Four tightly integrated layers work in unison — ingesting the market, understanding it, finding the edge, and capturing it before the window closes.
Persistent WebSocket connections to both venues deliver every bid, ask, and trade event the instant it occurs. A streaming REST backfill keeps the full contract universe current across restarts.
Transformer-based sentence embeddings map every contract into a high-dimensional semantic space. Approximate nearest-neighbour search surfaces candidate pairs, and an LLM validation pass confirms structural equivalence before any trade.
When a confirmed pair shows a persistent spread after fees and slippage, a strategy engine calculates the optimal stake size, expected value, and risk-adjusted return before signalling execution.
Both legs of the arbitrage are submitted concurrently to minimise legging risk. Fill confirmation, position tracking, and automatic sell-down are handled without human intervention.
Every component was engineered from scratch to handle the specific demands of prediction market structure — binary outcomes, thin liquidity, and event-driven pricing.
Native connectors to Kalshi and Polymarket with automatic reconnect, backpressure handling, and NATS-backed fan-out to all downstream consumers.
bge-large-en-v1.5 embeddings (1024 dimensions) stored in pgvector with an IVFFlat index for sub-millisecond ANN search across the full contract universe.
GPT-4o validates every candidate match for structural equivalence — same event, same resolution criteria, same binary polarity — before a pair is approved.
Markets are classified by category (politics, sports, economics, world events) with per-category controls for whether to ingest, pair, and trade.
Per-pair position limits, maximum portfolio concentration rules, and a kill switch that unwinds all open legs within seconds.
Real-time P&L, open positions, match queue, opportunity log, and execution history — all accessible through a secure web interface.
Ingestion, matching, strategy, execution, selling, risk, and reporting each run as isolated services communicating over NATS — independently deployable and horizontally scalable.
Positions are tracked to expiry. A dedicated selling service monitors fill status and manages the close-out leg with configurable profit-taking thresholds.
PolyBot monitors the two largest regulated prediction market platforms in the United States simultaneously, in real time.
Low-latency data paths in Go feed into a Python AI layer backed by Postgres + pgvector for vector search and NATS for event streaming.
PolyBot is an active research and trading project. If you are a quant, technologist, or investor curious about the prediction market space, we would love to hear from you.
No spam. Just a conversation.