generate_external_order_status_events

Function generate_external_order_status_events 

Source
pub fn generate_external_order_status_events(
    order: &OrderAny,
    report: &OrderStatusReport,
    account_id: &AccountId,
    instrument: &InstrumentAny,
    ts_now: UnixNanos,
) -> Vec<OrderEventAny>
Expand description

Generates the appropriate order events for an external order and order status report.

After creating an external order, we need to transition it to its actual state based on the order status report from the venue. For terminal states like Canceled/Expired/Filled, we return multiple events to properly transition through states.