WebSockets

Last updated 26 days ago

WebSocket endpoints for retrieving live market updates.

Rate limit is 200 WebSocket subscriptions per IP address.

WebSocket Subscribe Request

wss://ws.radarrelay.com/v2

Example request

// Once connected, send the following request to subscribe:
{
"type": WebsocketRequestType.SUBSCRIBE,
"topic": WebsocketRequestTopic,
"market": string // e.g. 'ZRX-WETH',
"requestId": number // Optional
}

Response

// Response acknowledgement:
{
"type": WebsocketRequestType.SUBSCRIBE,
"requestId?": number // requestId from originating request
}
// On event:
{
"action": WebsocketAction,
"event": RadarFill | RadarNewOrder | RadarCancelOrder | RadarRemoveOrder,
"requestId?": number // requestId from originating request
}

WebSocket Unsubscribe Request

Unsubscribe to a WebsocketEvent by sending a RadarUnsubscribeRequest.

wss://ws.radarrelay.com/v2

Example request

// Once connected, send the following request to unsubscribe:
{
"type": WebsocketRequestType.UNSUBSCRIBE,
"topic": WebsocketRequestTopic,
"market": string, // e.g. 'ZRX-WETH'
}

Response

// Response acknowledgement:
{
"type": WebsocketRequestType.UNSUBSCRIBE,
"requestId?": number // requestId from originating request
}