pub fn parse_order_status_report(
order: &BitmexOrder,
instrument: &InstrumentAny,
order_type_cache: &DashMap<ClientOrderId, OrderType>,
ts_init: UnixNanos,
) -> Result<OrderStatusReport>Expand description
Parse a BitMEX order into a Nautilus OrderStatusReport.
§BitMEX Response Quirks
BitMEX may omit ord_status in responses for completed orders. When this occurs,
the parser defensively infers the status from leaves_qty and cum_qty:
leaves_qty=0, cum_qty>0->Filledleaves_qty=0, cum_qty<=0->Canceled- Otherwise -> Returns error (unparsable)
§Errors
Returns an error if:
- Order is missing
ord_statusand status cannot be inferred from quantity fields. - Order is missing
order_qtyand cannot be reconstructed fromcum_qty+leaves_qty.