⚠ INTERNAL — Operator UX mock · Design preview of V2 development path · demo-wired ≠ production-live · back to dev guide
Polygon · pUSD 10
📓 Developer Guide 📋 Reason Codes 📈 Shadow Mode
JD John Doe · Admin

OrderLifecycleManager

exec.orderlifecyclemanager
Execution planned Spec started frozen flagship

OrderLifecycleManager is the single source of truth for every order's state machine, tracking transitions from intent through terminal state.

What it does

OrderLifecycleManager is the single source of truth for every order's state machine, tracking transitions from intent through terminal state. It reconciles local state against the CLOB V2 user-state endpoint, detects stuck-in-flight and orphaned orders, and emits ExecutionReports on every transition.

Pipeline placement

runs after: SmartRouter (order signed and submitted to CLOB V2) OrderLifecycleManager runs before: FillQualityAnalyzer, PartialFillHandler, CancelReplaceOptimizer

Applies to: Every live order from submission through terminal state (FILLED, CANCELLED, EXPIRED)

Why it matters

If this failsConsequence
Order state out of syncStrategy layer acts on stale position data, potentially doubling into a filled position or missing a cancellation.
Stuck-in-flight order not detectedAn order that never received an ack occupies position budget indefinitely, blocking new orders.
Orphaned ack not cancelledA resting order with no owning strategy leaks capital and may fill at an unintended price.

Inputs

Polymarket inputs

InputSourceRequiredUse
CLOB V2 user orders endpointclob_authrequiredReconcile local state against exchange state every reconcile_interval_s.
WebSocket user feed — fill and cancel eventsws_userrequiredReceive real-time order state transitions (ack, partial fill, full fill, cancel, expire).

Internal inputs

InputSourceRequiredUse
Signed order from SmartRouterexec.smart_routerrequiredInitialise order state record on first submission.
KillSwitch active flagrisk.kill_switchrequiredCancel all open orders and halt state updates when active.

Authority

What this bot is permitted to do

Reshape

State

Readiness

Spec started

Status

planned

Class

Execution Utility

Default mode

shadow_only

Developer owner

Polytraders core — Execution pod

Capital impact

Direct

Reason codes emitted

CodeSeverityMeaningAction
ORDER_LIFECYCLE_TRANSITIONINFONormal state transition recorded.Emit ExecutionReport; no intervention required.
ORDER_STUCKHARD_REJECTOrder has been PENDING_ACK beyond stuck_order_timeout_s.Cancel order via clob_auth; emit ExecutionReport.
ORDER_ORPHAN_CANCELLEDWARNOrder found during reconcile with no owning strategy record.Cancel order; log warning.
KILL_SWITCH_ACTIVEHARD_REJECTGlobal kill switch active; cancel all open orders.Cancel all open orders; halt processing.
RECONCILE_DISCREPANCYWARNLocal state does not match exchange state after reconcile poll.Overwrite local state with exchange state; emit WARN.

Used by

Reverse index — strategies that currently reference exec.orderlifecyclemanager. If you change this bot's authority or reason codes, these strategies must re-pass shadow.

StrategyStateActivity
US Elect — book-builderdemo-wiredlast triggered 7m ago
NBA H2H — moneyline market-makedemo-wiredlast triggered 14m ago

Showing 2 of 2 · demo-wired ≠ production-live

Why this matters

Execution bots does NOT propose new positions; only routes and shapes approved intents. Understanding the authority boundary prevents misuse and makes promotion-gate reviews faster and more reliable. View raw spec JSON →
Polytraders Operator UX Mock · INTERNAL · demo-wired ≠ production-live · the plan · reason codes · shadow-mode pipeline
⚙ Page Configuration
Current page settings
Loading configuration…