Order Lifecycle
- Audience: Trading API integrators.
- What this page covers: Place/cancel behavior, order status outcomes, and where to query final state.
Place Order Path
- Client submits an order to engine (
POST /ordersorPOST /signed_orders). - Engine validates pair state, market state, and order constraints.
- Engine matches immediately against opposite-side liquidity where possible.
- If quantity remains and order type allows resting, the remaining quantity becomes
openon the book. - Engine emits events (durable outbox first, then async dispatch to Kafka/sinks).
- OMS consumes order events and updates open/history read models.
Match Outcomes
filled: Order is fully executed immediately.partially_filled: Part executes; remainder may stayopenif order type can rest.open: No immediate full execution and remaining amount rests on the book.cancelled: Resting order is cancelled.rejected: Validation or market/pair-state rules reject the request (error_codein response).
Cancel Path
- Client calls
POST /orders/cancelwithpair_idandorder_id. - Engine checks ownership/auth context and order existence.
- If found and cancellable, engine removes it from the book and returns
cancelled. - Cancellation event is emitted; OMS reflects this in history and removes it from the open set.
Where to Read Open Orders and History
- Open orders: OMS
GET /orders/open/:user_id - Order history: OMS
GET /orders/history/:user_id - Single order lookup: OMS
GET /orders/:order_id
Use OMS for user-facing order views. Engine is the execution system of record; OMS is the query/read model.