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

Config & defaults

How every bot is configured, defaulted, overridden, versioned, and audited.

Naming

Defaults, warnings, hard limits

Every numeric parameter has three values: default, warning, hard. The bot must crash on init if its config violates a hard limit; it must emit a warning ReportEnvelope on every decision while a warning is breached.

Override precedence (highest wins)

  1. Kill switch. Always wins.
  2. Operator override (audited, time-bound, scoped).
  3. Per-market override stored in BotConfig.
  4. Strategy-level override.
  5. Bot defaults.

Any override that survives a deploy must be reflected in the approved config. The Config Drift Detector flags drift on every reconcile.

Environments

Versioning

Every BotConfig carries configVersion. Any decision-affecting change bumps the version. The version is part of every emitted ReportEnvelope, so a decision is always traceable to the exact config that produced it.

Audit

Config changes are recorded as audit ReportEnvelopes carrying GOV_CONFIG_DRIFT when production differs from the approved baseline. The Config Drift Detector runs on every deploy and on a 5-minute heartbeat.