Based on PRD v1.0 (Polymarket Execution Gateway)
Goal: Can sign and broadcast a simple order to the network.
- 1.1 Config & Secrets (C-01)
- Load
.env/config.yaml - Support
PROXY_ADDRESS(EOA) &PRIVATE_KEY - Setup Multi-environment (Mainnet/Amoy)
- Load
- 1.2 Optimized Signer (E-01)
- Port
polymarket-go-sdksigning logic - Pre-calculate Domain Separator & TypeHash (Performance)
- Unit Test: Benchmark Signing (<1ms)
- Port
- 1.3 Basic REST API (Interface)
-
POST /v1/orders(Basic Passthrough) -
GET /health
-
Goal: High-performance, non-blocking order placement.
- 2.1 Optimistic Nonce Manager (E-02)
- Fetch initial nonce on startup
- Atomic local increment
- Auto-resync on "Nonce too low"
- 2.2 Connection Management (D-02)
- Global HTTP Client (Keep-Alive, Connection Pooling)
- 2.3 Basic Rate Limiter (E-03)
- Token Bucket implementation for API limits
Goal: Zero-latency data access via Shadow Orderbook.
- 3.1 WebSocket Client (D-02)
- Connect to Polymarket CLOB WS
- Handle Ping/Pong
- Reconnect Logic (Exponential Backoff)
- 3.2 Shadow Orderbook (D-01)
- In-Memory Orderbook Structure (
map[string]*Orderbook) - Handle Snapshots & Deltas
-
GET /v1/markets/:id/book(Read from memory)
- In-Memory Orderbook Structure (
Goal: Safety mechanisms for 24/7 operation.
- 4.1 Fat Finger Check (R-01)
- Max Order Value check
- Price Deviation check
- 4.2 Kill Switch (R-02)
-
DELETE /panicendpoint
-
- 4.3 Graceful Shutdown
- Cancel open orders on SIGTERM
Goal: Preparing for AI Agent integration.
- 5.1 Semantic Error Codes
- 5.2 Read-Only Mode
- 5.3 Structured Logging (Audit)