- This is a multi-module Maven repo (
pom.xmlat the root). - Core modules:
polybot-core/: shared domain, events, WS clients, Polymarket/Gamma integrations.strategy-service/: trading logic (gabagool replication), order lifecycle, sizing/risk gates.executor-service/: order execution + PAPER simulator (PaperExchangeSimulator).ingestor-service/: ingestion pipelines (WS/REST) into ClickHouse/Kafka.analytics-service/: ClickHouse sinks + schema init SQL inanalytics-service/clickhouse/init/.
- Supporting:
research/: Python reports/backtests (match %, coverage, calibration).logs/: runtime logs +.pidfiles created by scripts.
./start-all-services.sh: builds (if needed) and starts infra + services../stop-all-services.sh: stops all services using PID files.mvn -DskipTests package: build all jars.mvn test: run unit tests.- Health checks:
curl http://localhost:8081/actuator/health(strategy)curl http://localhost:8123 --data "SELECT 1"(ClickHouse HTTP)
- Java: keep existing formatting (4-space indent),
PascalCaseclasses,camelCasemethods/fields. - Prices/sizes: prefer
BigDecimaland explicit tick handling (typically0.01for up/down markets). - YAML: 2-space indent; keep defaults in
*/src/main/resources/application-develop.yaml. - ClickHouse migrations: add new files as
analytics-service/clickhouse/init/00xx_description.sql(append-only). - Python in
research/: prefer CLI scripts with clear flags; use stdlib where feasible to avoid arch issues.
- Tests live in
*/src/test/java(JUnit). Run per-module:mvn test -pl strategy-service. - Keep tests deterministic (inject clocks/randomness where possible) and avoid live network calls.
- History favors small, descriptive commits (e.g., “dynamic sizing”, “small fixes”). Use an imperative subject and mention the module when helpful.
- PRs should include: what changed, which services/modules are affected, how to reproduce (commands + expected output), and any config/SQL migration notes.
- Repo is public: never commit private keys, API credentials, or RPC tokens. Use
.envlocally and keep secrets out of YAML committed to git.