Skip to main content

parse_ws_order

Function parse_ws_order 

Source
pub fn parse_ws_order(data: &Value) -> Result<Order>
Expand description

Parse a WebSocket order update message into an Order.

Bitget order update format:

{
  "instId": "BTCUSDT",
  "ordId": "123456",
  "clOrdId": "client123",
  "side": "buy",
  "ordType": "limit",
  "px": "50000",
  "sz": "0.1",
  "fillPx": "49999",
  "fillSz": "0.05",
  "avgPx": "49999",
  "status": "partially_filled",
  "fee": "-0.5",
  "feeCcy": "USDT",
  "uTime": "1700000000000",
  "cTime": "1700000000000"
}