Research: Order Management and Matcher
Objectiveβ
Define a functional state on top of 007 that introduces order matching while preserving pricing behavior and extending observability to order operations.
Inputs Reviewedβ
spec.mdplan.mdtasks.mdsystem/architecture.mdsystem/runtime-topology.md- state
006observability stack and dashboard/probe patterns
Key Decisionsβ
- Build on top of state
007while preserving observability patterns from state006. - Treat order management as additive to existing trade workflows; do not break current trade ticket path.
- Expose order metrics directly from matcher/API path for precise visibility instead of blackbox-only inference.
- Standardize required metric names in contract artifacts so generated implementations remain comparable.
- Keep generation and runtime steps deterministic and scriptable.
- Implement matcher as Spring Boot (not Python) for operational consistency with existing JVM services.
- Persist order state in shared DB so active orders survive order-matcher restart and recover without re-seeding.
Risks and Mitigationsβ
- Risk: behavior drift from predecessor state.
- Mitigation: state smoke tests and conformance checks.
- Risk: order lifecycle regressions (open order count incorrect, stale statuses).
- Mitigation: enforce metric contracts (
traderx_orders_open_total,traderx_orders_unfilled_total) in smoke checks.
- Mitigation: enforce metric contracts (
- Risk: observability noise without actionable dashboards.
- Mitigation: require focused order dashboards (queue depth, lifecycle rates, latency, failures).