Replace HTTP polling with RTDS WebSocket for real-time trade monitoring

- Add rtds_client.py: persistent WebSocket connection to wss://ws-live-data.polymarket.com
  with auto-reconnect, heartbeat, and trade message parsing
- Rewrite trade_monitor.py: single WebSocket receives ALL trades in real-time,
  replacing per-market HTTP polling loops (zero missed trades, sub-second latency)
- Remove QPS rate limiter and per-market polling infrastructure (no longer needed)
- Update default LLM model to gemini-3.1-pro-preview
- Add websockets and python-socks dependencies

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
SII-leiyu
2026-05-06 12:06:45 +08:00
co-authored by Claude Opus 4.6
parent 265c8fb5a1
commit af5bbd0bce
6 changed files with 503 additions and 517 deletions
+2
View File
@@ -11,6 +11,8 @@ requires-python = ">=3.10"
license = {text = "MIT"}
dependencies = [
"httpx>=0.27.0",
"websockets>=13.0",
"python-socks[asyncio]>=2.0.0",
"pydantic>=2.0.0",
"pydantic-settings>=2.0.0",
"python-dotenv>=1.0.0",