Skip to Content
Connection

Heartbeat

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

The server sends a HEARTBEAT every 10 seconds to every connection, from the moment it opens and whether or not it has subscribed to anything. It expects no reply: there is no application-level pong. The connection has an idle timeout of 300 seconds, though, so a recommended strategy is to send a native WebSocket ping each time a heartbeat arrives. If no pong comes back, close the socket and reconnect.

Connection-level messages on the shared socket: authentication, generic subscribe and unsubscribe, heartbeats and errors.

Code Sample
const socket = new WebSocket("wss://streams.fast.onetrading.com/");socket.addEventListener("message", (event) => {  console.log(event.data);});

Messages

Sent to every connection every 10 seconds, from the moment it opens. No reply is expected. The connection has an idle timeout of 300 seconds, so a recommended keep-alive strategy is to send a native WebSocket ping each time a heartbeat arrives. If no pong arrives, close the socket and reconnect.

application/json
  1. payload
channel_name*string

SYSTEM.

subscription*string

SYSTEM.

time*integer

Time the heartbeat was sent, in nanoseconds. Stamped by the WebSocket server, so it may be up to 1 second out.

Formatint64
type*string
heartbeat

Heartbeat

{  "channel_name": "SYSTEM",  "subscription": "SYSTEM",  "time": 1738602951685556000,  "type": "HEARTBEAT"}