The Problem
Polymarket traders and researchers face a fragmented toolchain: market data lives in multiple APIs, trade execution requires signed CLOB requests, and strategy research means stitching together data pipelines by hand. polybot consolidates this into a self-hosted trading infrastructure with data ingestion, analytics, execution, and research tooling.
What This Does
polybot is a Java 21 / Spring Boot multi-service system. polybot-core contains the shared trading primitives: Polymarket CLOB auth (PolymarketAuthHeaders.java, Eip712Signer.java), order construction (PolymarketOrderBuilder.java, LimitOrderRequest.java), WebSocket top-of-book streaming (ClobMarketWebSocketClient.java), and market discovery (PolymarketMarketDiscoveryService.java). The ingestor-service pulls market data, user trades, and on-chain Polygon receipts into ClickHouse via a 20+ file SQL migration chain under analytics-service/clickhouse/init/. The executor-service handles order placement, a paper-trading simulator (PaperExchangeSimulator.java), and on-chain settlement (PolymarketSettlementService.java). The analytics-service exposes query APIs over the ClickHouse data, and infrastructure-orchestrator-service manages Docker Compose lifecycles for the analytics and monitoring stacks.
The research/ directory contains Python scripts for backtesting (backtest/strategybacktest.py), data quality checks (dataqualityreport.py), and strategy replication analysis (finalstrategyfindings.py).
How To Use It
The README documents a full local deployment. Prerequisites are Java 21, Maven 3.8+, Docker with Compose, and Python 3.11.
Setup and run:
git clone https://github.com/ent0n29/polybot.git cd polybot cp .env.example .env set -a; source .env; set +a ./start-all-services.sh
Verify:
curl http://localhost:8080/actuator/health curl http://localhost:8123 --data "SELECT 1"
Configuration: Key env vars in .env.example include POLYMARKETTARGETUSER for research, and POLYMARKETPRIVATEKEY, POLYMARKETAPIKEY, POLYMARKETAPISECRET, POLYMARKETAPIPASSPHRASE for live trading. The README notes Spring Boot does not auto-load .env; export variables in your shell.
Running it: The start script builds Maven artifacts and launches all services with the develop profile. Services listen on ports 8080–8084. Manual startup commands are also documented in the README. Note: the README references a strategy-service on port 8081, but no such directory exists in the file structure—this is a discrepancy to verify.
Real-World Use
A typical workflow: run the stack, use ingestor-service to pull a target user's trades into ClickHouse, then run research/finalanalysis.py to identify their strategies. Once a strategy is understood, configure executor-service to replicate it in paper mode first (ExecutorSimulationProperties.java), validate results via Grafana dashboards, then switch to live trading with the Polymarket credentials.
Code Health & Issues
High - Missing CI/CD: No GitHub Actions or CI config detected. No automated build/test gate before changes merge. Med - Missing strategy-service: README references strategy-service on port 8081, but it's absent from the file tree. Either the README is stale or the service was removed. Med - Non-reproducible builds: Maven pom.xml files declare dependencies without a lockfile. Dependency versions can drift across builds. Low - Test coverage is thin: 14 test files across 200 total. Core crypto and discovery logic has tests; the ingestion and executor services have only application context tests. Low - Secrets risk: .env.example is present, which is good, but live trading keys in environment variables require careful handling. No evidence of committed secrets, but no secret-scanning tooling either.
The Bottom Line
This is a serious, working Polymarket trading stack with real depth in on-chain data ingestion and order signing. It's suited for developers who want to study Polymarket mechanics or run their own trading infrastructure, not for casual users—the multi-service setup and ClickHouse dependency carry real operational overhead. The missing CI and stale README references are the main concerns before production use.