Skip to main content
streamPositionUpdates(initial, priceStream?) takes a previously fetched getOpenPositions() response and emits an updated payload whenever relevant prices change.

Example

How it works

  • the SDK extracts the unique pairId values from initial.pairPositions
  • it subscribes only to those pairs
  • on each price tick, it recalculates price-sensitive fields and emits the full updated OpenPositionsResponse

Reusing an existing price stream

If your app already owns a price WebSocket, pass it as the second argument to avoid opening another connection:

Response schema