Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/bullish-exchange/api-docs/llms.txt

Use this file to discover all available pages before exploring further.

Bullish Exchange provides a suite of WebSocket APIs for receiving real-time market and account data. All WebSocket communication follows the JSON-RPC 2.0 specification — messages sent to the server and responses from the server both follow this format. Private streams require JWT-based authentication, while market data streams are publicly accessible without credentials.

Available Streams

Market Data Streams

Subscribe to real-time order book updates, anonymous trade feeds, market tick data, and index price streams via unauthenticated WebSocket connections.

Private Data Stream

Subscribe to authenticated private events — order updates, trade fills, account balance changes, derivatives positions, and AMM instructions.

WebSocket Servers

Connect to one of the following servers depending on your environment:
EnvironmentServer URL
Productionwss://api.exchange.bullish.com
Production (Registered)wss://registered.api.exchange.bullish.com
Production (Direct Connect)wss://prod.access.bullish.com
Sandboxwss://api.simnext.bullish-test.com
Sandbox (Registered)wss://registered.api.simnext.bullish-test.com
Sandbox (Direct Connect)wss://simnext.access.bullish.com

Connection Limits

Each WebSocket category has a maximum number of open connections. Once the limit is reached, new WebSocket connection requests will be rejected.
CategoryLimit
Unauthenticated WebSocketsMax 100 open connections per IP address
Authenticated WebSocketsMax 10 open connections per API key

Authentication

Connection requests to private WebSocket streams use JWT_COOKIE based authentication. To generate a JWT token, follow the Generate A JWT Token flow. Each WebSocket exposes a set of topics that can be subscribed to after a successful connection.

Sending Messages

Messages sent from the client to the server follow the JSON-RPC 2.0 format. The id field sent by the client is echoed back in the server response, allowing responses to be matched to the originating request. Clients are responsible for ensuring the uniqueness of the id field. There are two types of messages a client can send:
1

Subscribe to a Topic

Send a subscription message to begin receiving a snapshot of existing data followed by real-time updates.Subscribe by <TOPIC> only:
{
  "jsonrpc": "2.0",
  "type": "command",
  "method": "subscribe",
  "params": {
    "topic": "<TOPIC>"
  },
  "id": "<COMMAND_ID>"
}
Subscribe by <TOPIC> and <SYMBOL>:
{
  "jsonrpc": "2.0",
  "type": "command",
  "method": "subscribe",
  "params": {
    "topic": "<TOPIC>",
    "symbol": "<SYMBOL>"
  },
  "id": "<COMMAND_ID>"
}
2

Send a Keepalive Ping

Send periodic keepalive pings to prevent the connection from closing. The WebSocket closes automatically after 5 minutes of inactivity.
{
  "jsonrpc": "2.0",
  "type": "command",
  "method": "keepalivePing",
  "params": {},
  "id": "<COMMAND_ID>"
}

Receiving Messages

The server returns JSON-RPC 2.0 formatted responses. There are three response types:
{
  "jsonrpc": "2.0",
  "id": "1650865877698",
  "result": {
    "responseCode": "200",
    "responseCodeName": "OK",
    "message": "Successfully subscribed"
  }
}

Heartbeat

The heartbeat feature is currently in beta/experimental status.
A heartbeat message is sent approximately every 30 seconds on the heartbeat topic for the following WebSocket APIs: The heartbeat serves to validate end-to-end communication between the exchange and the client. If 3 consecutive heartbeats are missed, you should:
  1. Check the official status page for any announcements about exchange degradation.
  2. If no announcements have been made, disconnect and reconnect the WebSocket — the issue may be isolated to a specific gateway.
If heartbeats stop arriving and no exchange announcement has been made, disconnect and reconnect immediately. The issue may be gateway-specific and reconnecting will route you to a healthy gateway.
The heartbeat response has the following format:
{
  "type": "update",
  "dataType": "V1TAHeartbeat",
  "data": [
    {
      "sequenceNumber": "3",
      "createdAtTimestamp": "1611082473000"
    }
  ]
}
To receive heartbeats, subscribe with:
{
  "jsonrpc": "2.0",
  "type": "command",
  "method": "subscribe",
  "params": {
    "topic": "heartbeat"
  },
  "id": "1611082473000"
}

Build docs developers (and LLMs) love