Skip to main content

Connection

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

Stream Types


Quick Example

const WebSocket = require('ws');

const ws = new WebSocket('wss://exchange-wss.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