Repository: github.com/Yves176/polymarket-trade-engine
Automated trading engine for Polymarket binary prediction markets with an integrated strategy test harness. Supports short-window markets (5-minute and 15-minute) across major crypto assets.
- Overview
- Supported Markets
- Features
- Architecture
- Prerequisites
- Installation
- Configuration
- Usage
- Strategy Development
- Backtesting
- Documentation
- Design Decisions
- Contributing
- License
polymarket-trade-engine is a modular, extensible trading engine built specifically for Polymarket binary prediction markets. It provides a complete runtime for executing automated strategies on short-window crypto markets, alongside a full-featured test harness for backtesting and forward-testing those strategies before deploying capital.
The engine communicates with Polymarket's Central Limit Order Book (CLOB) via its standard REST and WebSocket APIs, handles order lifecycle management, and exposes a clean interface for plugging in custom trading logic.
| Asset | Windows | Market Type |
|---|---|---|
| BTC | 5-minute, 15-minute | Binary (Up / Down) |
| ETH | 5-minute, 15-minute | Binary (Up / Down) |
| XRP | 5-minute, 15-minute | Binary (Up / Down) |
| SOL | 5-minute, 15-minute | Binary (Up / Down) |
| DOGE | 5-minute, 15-minute | Binary (Up / Down) |
Additional markets can be added via configuration as Polymarket expands its offerings.
- Live Trading — connects to Polymarket's CLOB API and executes orders in real time
- Strategy Test Harness — run, validate, and compare strategies against historical data without risking capital
- Order Lifecycle Management — handles order placement, cancellation, partial fills, and expiry automatically
- Market Polling & WebSocket Feed — subscribes to live order book updates for low-latency signal generation
- Position Tracking — maintains real-time position state across active markets
- Risk Controls — configurable per-trade size limits, exposure caps, and cooldown periods
- Structured Logging — timestamped, level-based logs with optional JSON output for downstream ingestion
- Extensible Strategy Interface — implement a single interface to plug in any custom strategy