Skip to main content

parse_ws_order_status_report

Function parse_ws_order_status_report 

Source
pub fn parse_ws_order_status_report(
    order: &LighterOrder,
    instrument: &InstrumentAny,
    account_id: AccountId,
    ts_init: UnixNanos,
) -> Result<OrderStatusReport>
Expand description

Parses a Lighter account-stream order payload into an [OrderStatusReport].

The venue exposes partial fills implicitly: the order remains in Open status with filled_base_amount > 0. The mapping promotes such an order to [OrderStatus::PartiallyFilled] so downstream consumers do not need to re-derive it.

ยงErrors

Returns an error if any quantity, price, or timestamp field cannot be converted, or if the venue order kind has no Nautilus equivalent.