Skip to main content

parse_ws_fill_report

Function parse_ws_fill_report 

Source
pub fn parse_ws_fill_report(
    ws_fill: &DydxWsFillSubaccountMessageContents,
    instrument_cache: &InstrumentCache,
    order_id_map: &DashMap<String, (u32, u32)>,
    order_contexts: &DashMap<u32, OrderContext>,
    encoder: &ClientOrderIdEncoder,
    account_id: AccountId,
    ts_init: UnixNanos,
) -> Result<FillReport>
Expand description

Parses a WebSocket fill update into a FillReport.

Converts the WebSocket fill format to the HTTP Fill format, then delegates to the existing HTTP parser for consistency. Correlates the fill back to the originating order using the order_id_map (built from WS order updates).

ยงErrors

Returns an error if:

  • Instrument lookup fails for the market symbol.
  • Field parsing fails (price, size, fee, etc.).
  • HTTP parser fails.