parse_ws_position_report

Function parse_ws_position_report 

Source
pub fn parse_ws_position_report(
    ws_position: &DydxPerpetualPosition,
    instruments: &DashMap<InstrumentId, InstrumentAny>,
    account_id: AccountId,
    ts_init: UnixNanos,
) -> Result<PositionStatusReport>
Expand description

Parses a WebSocket position into a PositionStatusReport.

Converts the WebSocket position format to the HTTP PerpetualPosition format, then delegates to the existing HTTP parser for consistency.

ยงErrors

Returns an error if:

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