Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.bayse.markets/llms.txt

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

Overview

The Bayse Markets WebSocket API provides real-time streaming data for market activity, price changes, order book updates, and live asset prices. Base URL: wss://socket.bayse.markets

Endpoints

EndpointAuthDescription
/ws/v1/marketsNoneMarket activity feeds, price updates, and order book snapshots.
/ws/v1/userPer-messageFill updates for your orders.
/ws/v1/realtimeNoneLive asset prices (crypto and FX).

Quick example

Connect to the markets endpoint and subscribe to price updates:
const ws = new WebSocket("wss://socket.bayse.markets/ws/v1/markets");

ws.addEventListener("open", () => {
  ws.send(JSON.stringify({
    type: "subscribe",
    channel: "prices",
    eventId: "EVENT_ID"
  }));
});

ws.addEventListener("message", (event) => {
  for (const line of event.data.split("\n")) {
    if (line.trim()) {
      const msg = JSON.parse(line);
      console.log(msg.type, msg.data);
    }
  }
});
The server may batch multiple JSON messages into a single WebSocket frame separated by newlines. Always split on \n before parsing. See Connection for details.

Next steps

Connection

Message format, keepalive, and reconnection.

Market data

Activity feeds, price updates, and order book snapshots.

User orders

Real-time fill updates for your orders.

Asset prices

Live crypto and FX price feeds.

Errors

Error handling and rate limits.