Skip to main content

Error format

When the server encounters an error processing a message, it sends an error event:
{
  "type": "error",
  "data": {
    "message": "Event ID is required"
  },
  "timestamp": 1700000000000
}
The data.message field contains a human-readable description of the error.

Common errors

Invalid message format

Sent when the message is not valid JSON.
{
  "type": "error",
  "data": { "message": "Invalid message format" },
  "timestamp": 1700000000000
}

Missing required fields

Sent when a required field is missing from the message.
{
  "type": "error",
  "data": { "message": "Event ID is required" },
  "timestamp": 1700000000000
}
Other examples:
  • “Symbols required to subscribe to asset prices”
  • “Room name is required”

Unknown message type

Sent when the type field does not match any known message type.
{
  "type": "error",
  "data": { "message": "unknown message type: INVALID_TYPE" },
  "timestamp": 1700000000000
}

Unsupported values

Sent when a field value is not supported.
{
  "type": "error",
  "data": { "message": "Unsupported currency. Supported currencies are USD and NGN" },
  "timestamp": 1700000000000
}
{
  "type": "error",
  "data": { "message": "Unsupported symbol: DOGEUSDT. Supported symbols are BTCUSDT, ETHUSDT, SOLUSDT, XAUUSD, EURUSD, GBPUSD, USDNGN" },
  "timestamp": 1700000000000
}

Wrong endpoint

Sent when you try to subscribe to a channel on the wrong endpoint.
{
  "type": "error",
  "data": { "message": "channel \"asset_prices\" is not available on /ws/v1/markets; use /ws/v1/realtime instead" },
  "timestamp": 1700000000000
}

Rate limit exceeded

Sent when the client sends too many messages.
{
  "type": "error",
  "data": { "message": "rate limit exceeded: too many messages" },
  "timestamp": 1700000000000
}

Rate limits

LimitValueScope
Message rate10 messages/secondPer connection
WebSocket upgrades are rate-limited per IP. When the message rate is exceeded, the server sends a rate limit error but keeps the connection open. Slow down your message rate to resume normal operation.

Best practices

  • Always handle error events. Check msg.type === "error" and log the message for debugging.
  • Don’t retry immediately on errors. If you receive a rate limit error, slow down before sending more messages.
  • Use the right endpoint. Each endpoint only accepts specific channels. See the error message for which endpoint to use.
  • Validate before sending. Check that required fields like eventId, marketIds, and symbols are present before sending to avoid unnecessary round-trips.