Polytraders Dev Guide
internal
v3 spine Phase 1 · Shared contracts 9 demo-wired · 0 shadow-ready · 0 production-live · 100 pending · 109 total 15/33 infra tasks the plan status board

← Principles & schemas

Developer runbook

From git-clone to first decision in fifteen minutes. Anything longer is a bug — file an issue against this page.

1. Local prerequisites

2. Clone and bootstrap

git clone https://github.com/polytraders/core.git
cd core
make bootstrap   # installs deps, runs migrations, starts local stack
make seed        # loads fixture markets, fills, and oracle proposals
make smoke       # runs a 30-second smoke test across all live bots

3. Run a single bot in shadow mode

POLYTRADERS_MODE=shadow_only \
POLYTRADERS_BOT=risk.liquidity_guard \
POLYTRADERS_LOG_LEVEL=debug \
make run-bot

# In another shell, replay fixture intents:
make replay FIXTURE=fixtures/intents/2026-05-01.jsonl

4. Author a new bot

  1. Pick a layer + slug. Create bots/<layer>/<slug>.json and copy from templates/reference_bot_schema.md.
  2. Set "is_reference": false until all 27 checklist fields are green.
  3. Write the pseudocode under reference_implementation first. Do not start typing the implementation language until the pseudocode reviews clean.
  4. Author the wire examples (wire_examples) using fixtures captured from staging — never invented.
  5. List your reason codes. Reuse global codes where possible; add bot-specific codes only when none of the global ones fit.
  6. Declare metrics, alerts, dependencies, security surfaces, V2 compatibility. Then implement.
  7. Run make checklist BOT=<layer>.<slug> until 27/27 green.
  8. Open the PR. CI gates on checklist completeness, schema validity, and reason-code stability (no rewords of existing codes).

5. Promotion

See Promotion gates for the criteria each readiness state must meet. Promotion is observable, not subjective: gates are derived from production metrics, never sign-off lists.

6. Common foot-guns