skip to content
ksegit
LON --:--:--

PolyBotCrab

Multi-wallet, multi-strategy automated trading platform for Polymarket prediction markets - eight strategies from sub-500ms latency arbitrage to Stoikov market making.

[DATA][FULL]private repo · walkthrough on request

python · fastapi · react · typescript · timescaledb · redis · docker · claude api · ollama

Problem

Top Polymarket traders exploit structural edges - latency on 5/15-minute crypto markets, NegRisk sum enforcement, cross-platform spreads against Kalshi. Replicating those strategies across multiple wallets needs sub-second execution, tick-level history, inventory management and real observability - not a script in a terminal.

Approach

A full platform: Python FastAPI backend consuming async WebSocket market feeds through py-clob-client, TimescaleDB for tick history, Redis Streams for event flow, and a React 18 + Vite + TypeScript dashboard (Recharts, shadcn/ui) covering markets, wallets, strategies, alerts, a backtester and a strategy code editor.

 Polymarket WS feeds ──► FastAPI async engine ──► Redis Streams
                              │                        │
                    strategy engine (S1-S8)      TimescaleDB ticks
                              │                        │
                       py-clob-client orders     React dashboard
                              │                   + backtester
                    Ollama (Mistral 7B) / Claude API - S7, dry-run

Eight strategies ship: NegRisk rebalancing arbitrage ($1.00 sum enforcement), sub-500ms latency arb, wick fishing, high-probability bonds, cross-platform arb, Stoikov market making with inventory management, an experimental AI information-edge strategy (always dry-run first), and copy trading.

Tradeoffs

  • Local + hosted AI. Ollama (Mistral 7B) handles cheap high-frequency inference; the Claude API is reserved for the harder reasoning - cost and latency against quality, chosen per call site.
  • Dry-run as a contract. The AI strategy cannot trade live by default; experimental edges earn capital only after paper results.
  • Docker Compose over k8s. GPU passthrough and full-stack test targets (make test-e2e-fullstack - frontend + backend + DB + Redis) matter more at this scale than orchestration ceremony.

Outcome

A running platform with the full test pyramid - Vitest/RTL and Playwright on the frontend, pytest on the backend, containerized integration and full-stack E2E suites driven from make targets.