Skip to Content
Mark price

Update mark price subscription

Send
/
Serverwss://streams.fast.onetrading.com

A connection has one MARK_PRICE selection. UPDATE_SUBSCRIPTION replaces it, like a new SUBSCRIBE, and answers with SUBSCRIPTION_UPDATED. A request that is rejected leaves the previous selection in place.

The mark price of futures instruments, every 5 seconds. Only futures instrument codes (e.g. BTC_USD_P) have a mark price; a spot instrument code is rejected.

Code Sample
const payload = {  "type": "UPDATE_SUBSCRIPTION",  "channels": [    {      "name": "MARK_PRICE",      "instrument_codes": [        "SOL_USD_P"      ]    }  ]};const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("open", () => {  socket.send(JSON.stringify(payload));});

Messages

Replaces the connection's MARK_PRICE selection, like a new SUBSCRIBE, and answers with SUBSCRIPTION_UPDATED. A request that is rejected leaves the previous selection in place.

application/json
  1. payload
type*string
channels*array<>
Items1 <= items <= 1
switchToSol

Switch the selection to SOL_USD_P

{  "type": "UPDATE_SUBSCRIPTION",  "channels": [    {      "name": "MARK_PRICE",      "instrument_codes": [        "SOL_USD_P"      ]    }  ]}

Reply

Receive

Sent back on the same channel.