polymarket-hft
[!CAUTION] > Early Development (Pre-0.1.0) - API wrappers are not fully tested. Breaking changes may occur. Do not use in production.
A high-frequency trading (HFT) system for Polymarket with built-in API clients and CLI.
Architecture Overview
The system is designed as a modular, event-driven architecture:
Clients → Ingestors → Dispatcher → Policy Engine → Action Executor
↓
State Manager + Archiver
Supported Clients & APIs - Currently implemented clients and APIs are:
| API | Protocol | Status |
|---|---|---|
| Polymarket Data API | REST | ✅ |
| Polymarket Gamma Markets | REST | ✅ |
| Polymarket CLOB | REST + WebSocket | ✅ |
| Polymarket RTDS | WebSocket | ✅ |
| CoinMarketCap Standard | REST | ✅ |
Storage - State Manager and Archiver are implemented using Redis and TimescaleDB.
Policy Engine — Define trading rules via YAML/JSON without code:
policies:
- id: btc_alert
conditions:
field: price
asset: "BTC"
operator: crosses_below
value: 80000
actions:
- type: notification
channel: telegram
template: "BTC below $80K!"
Action Executor - supports notifications, orders and audit logging.
See Architecture and Policy Engine for details.
Documentation
| Document | Description |
|---|---|
| Client Documentation | Usage guide for all API clients |
| CLI Guide | Command-line interface usage |
| CLI Examples | Practical CLI examples |
| Architecture | System design and HFT engine |
| Policy Engine | User-defined policy DSL |
| API Docs | Full API reference |
Quick Start
As a Library
[]
= "0.0.6"
use Client;
async
As a CLI
[!NOTE] > CoinMarketCap Integration: The CoinMarketCap client is designed for the Basic Plan (free tier). You will need an API key from CoinMarketCap Developer Portal.
See Client Documentation and CLI Guide for details.
Roadmap
- ✅ v0.0.x - API clients (Data, Gamma, CLOB, RTDS) and CLI
- 🚧 v0.1.x - HFT Engine: Dispatcher, State Management, Strategy Engine
- 📋 v1.0.x - Production-ready with validated trading strategies
See Architecture for detailed HFT engine design.
Contributing
&&
License
MIT License - see LICENSE.
Disclaimer
Unofficial SDK, not affiliated with Polymarket. Use at your own risk for educational and research purposes.
Links
- Polymarket | API Docs | GitHub | Issues