The Polytraders operating loop, stage by stage.
Every trade passes through the same eleven stages. Each stage has a single responsibility, a clear backend surface, and a reference TypeScript implementation in packages/polytraders-*. The platform mock at /mock-app/ shows what each stage looks like in operation; these dev pages show how to code each one.
Shared operating rule: net_edge = p_hat − q_exec − fees − uncertainty_buffer. No stage may skip the one before it — that is what makes a trade explainable and safe enough to scale.
These 11 stages are the runtime loop. The order we build them — 8 phases, each gated by an exit check — lives on the plan. Every stage page below also shows which phases advance it.
Market registry and instrument truth
Without a clean registry there is no shared notion of "the market". Every downstream stage reads from this one source.
Ingestion and order-book reconstruction
Turn the live websocket / REST feed into a continuously valid order book, or refuse to trade against it.
Canonical state and the event log
Every stage agrees on the same facts because they all read from one append-only event log.
Signal engine
Measure market state. Never decide whether to trade.
Fair-value engine
Turn the shared feature vector into a calibrated probability and a sensible uncertainty band.
Execution estimate
Before placing an order, predict the price you would actually fill at — and the probability you will get filled at all.
Decision, risk, and sizing
The single gate that turns a forecast into an approved trade. No stage downstream may bypass it.
Order manager and reconciliation
Live trading fails at the edges — retries, missed cancels, duplicate acks. The OMS keeps local state aligned with the exchange.
Inventory, settlement, and accounting
Turn raw fills into a clean capital ledger — free, reserved, redeemable, realised.
Replay, backtesting, and validation
The platform becomes trustworthy when the same raw inputs recreate the same state, the same decisions, and the same simulated fills.
Monitoring, incident response, and rollout
A first-class system fails safely, explains itself clearly, and improves after each incident.
One trade, traced end to end
The shared language: one market, one set of artefacts, one explainable trade path from raw data to final outcome.