Skip to main content

Connection

const ws = new WebSocket('wss://exchange-ws1.bulk.trade');
Exchange WebSocket URL: wss://exchange-ws1.bulk.trade

Ping-Pong Keepalive

The server sends a WebSocket ping frame every 30 seconds. The client must reply with a pong frame; if no pong is received within 10 seconds, the server disconnects the connection. Ping/pong are transport-level frames, not application (JSON) messages. Many client libraries respond to ping automatically. See Connection Management for details.

Stream Types

Market Data

Real-time price feeds, order books, and trades

Account Updates

Live position and order updates

Trading

Submit orders via WebSocket for lowest latency

Connection Management

Subscriptions, reconnection, and best practices

Quick Example

const WebSocket = require('ws');

const ws = new WebSocket('wss://exchange-ws1.bulk.trade');

ws.on('open', () => {
  // Subscribe to ticker
  ws.send(JSON.stringify({
    method: 'subscribe',
    subscription: [{
      type: 'ticker',
      symbol: 'BTC-USD'
    }]
  }));
});

ws.on('message', (data) => {
  const message = JSON.parse(data);
  
  // Handle subscription confirmation
  if (message.type === 'subscriptionResponse') {
    console.log('Subscribed to:', message.topics);
    return;
  }
  
  // Handle ticker updates
  if (message.type === 'ticker') {
    console.log('Ticker:', message.data.ticker);
  }
});

Subscription Response Format

All subscriptions return a confirmation with topic strings:
// Request
{
  "method": "subscribe",
  "subscription": [
    {"type": "ticker", "symbol": "BTC-USD"},
    {"type": "trades", "symbol": "BTC-USD"}
  ]
}

// Response
{
  "type": "subscriptionResponse",
  "topics": [
    "ticker.BTC-USD",
    "trades.BTC-USD"
  ]
}
Use the topic strings to unsubscribe later.

Unsubscribe

{
  "method": "unsubscribe",
  "topic": "ticker.BTC-USD"
}

Rate Limits

  • Maximum 100 subscriptions per connection
  • Maximum 1000 messages per second
  • Violating limits will result in disconnection

Next Steps

Market Data Streams

Ticker, Candles, Trades, Order Book

Account Stream

Real-time positions and orders