Skip to main content
Murmo exposes two real-time gateways built on Socket.IO. Both accept your murmo_ API key, so your bot can stream live prices and chat events without repeatedly polling the REST API. Choose the namespace that matches what you need — or connect to both at the same time.

Available namespaces

NamespaceURLPurpose
/perpswss://api.alpha-labs.trade/perpsLive perp market ticks — mark price, mid price, oracle price, funding rate, volume, and open interest.
/chatwss://api.alpha-labs.trade/chatGroup chat messages, proposal updates, and per-user notifications.

Authenticate your connection

Pass your murmo_ API key in the Socket.IO handshake auth.token field. You can also send it as an Authorization: Bearer header. Never put it in the query string — query strings leak into server logs and proxies.
An invalid or missing token causes the server to emit an error event (Authentication required or Invalid token) and immediately disconnect the socket. Always set auth.token to your full murmo_ key before connecting.
import { io } from "socket.io-client";

const socket = io("wss://api.alpha-labs.trade/perps", {
  transports: ["websocket"],
  auth: { token: process.env.MURMO_API_KEY }, // "murmo_..."
});

socket.on("connected", ({ userId }) => {
  console.log("connected as", userId);
});

socket.on("error", (e) => {
  console.error("ws error:", e.message);
});

Connection lifecycle

1

Connect with your key

Initiate the Socket.IO connection with auth.token set to your murmo_ key. On success, the server emits a connected event containing your userId. For /chat, the server also auto-joins you to all your group rooms and a private user:{userId} room at this point.
2

Subscribe to what you need

On /perps, emit subscribe_market with a { symbol } payload for each market you want to track. On /chat, no further subscription is required — your messages and notifications start arriving immediately after connected.
3

Handle errors and reconnects

Auth failures emit error and disconnect. For all other disconnections, Socket.IO reconnects automatically. Re-emit your subscribe_market calls inside your connected handler so subscriptions are restored after every reconnect.

Rate limits

The WebSocket gateways share the same rate-limit budget as the REST API — 1,200 requests per 60 seconds per API key. Each event emitted from the client counts against this limit.

Which gateway should you use?

Market Data

Connect to /perps to subscribe per symbol and receive throttled market_tick pushes with live prices, funding rates, and volume.

Chat & Notifications

Connect to /chat to receive group messages, trade proposal updates, reactions, pins, and per-user notifications in real time.
The market_tick stream sends numeric price and funding fields (optimized for latency), unlike the REST API which uses decimal strings. If you need exact decimal values for accounting or order sizing, fetch prices from GET /api/v1/perps/markets instead.