Skip to main content
The /perps namespace pushes live snapshots for perpetual markets as they update. Subscribe to only the symbols your bot is trading — the server throttles delivery to at most ~4 pushes per second per symbol, so you get low-latency data without flooding your connection. Connect to this namespace at wss://api.alpha-labs.trade/perps.

Events reference

EventDirectionPayloadResponse
subscribe_marketclient → server{ symbol: "BTC" }{ ok: true }
unsubscribe_marketclient → server{ symbol: "BTC" }{ ok: true }
market_tickserver → clientPerpMarketSnapshot
connectedserver → client{ userId }
errorserver → client{ message }

Connect, subscribe, and handle ticks

The example below connects to /perps, subscribes to BTC and SOL once the connection is confirmed, logs each incoming tick, and then unsubscribes from SOL after 30 seconds.
import { io } from "socket.io-client";

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

// Re-subscribe inside "connected" so it runs on reconnects too
socket.on("connected", ({ userId }) => {
  console.log("connected as", userId);
  socket.emit("subscribe_market", { symbol: "BTC" });
  socket.emit("subscribe_market", { symbol: "SOL" });
});

socket.on("market_tick", (snap) => {
  console.log(
    snap.symbol,
    "mark:", snap.markPriceUsd,
    "funding:", snap.fundingRatePercentage
  );
});

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

// Unsubscribe when no longer needed
setTimeout(() => {
  socket.emit("unsubscribe_market", { symbol: "SOL" });
}, 30_000);

market_tick payload

Every market_tick event delivers a PerpMarketSnapshot object. Here is an example payload:
{
  "symbol": "BTC",
  "markPriceUsd": 68250.5,
  "midPriceUsd": 68249.0,
  "oraclePriceUsd": 68251.2,
  "fundingRatePercentage": 0.0042,
  "openInterestBaseLots": 1820345,
  "volume24hUsd": 91234567.8,
  "prevDayPriceUsd": 67010.0,
  "receivedAt": "2026-06-02T19:00:00.000Z"
}
FieldTypeDescription
symbolstringMarket symbol, e.g. "BTC".
markPriceUsdnumberCurrent mark price in USD.
midPriceUsdnumber | nullMid-book price in USD. null if the order book is empty.
oraclePriceUsdnumberOracle reference price in USD.
fundingRatePercentagenumberFunding rate for the current funding interval.
openInterestBaseLotsnumberTotal open interest expressed in base lots.
volume24hUsdnumberRolling 24-hour notional volume in USD.
prevDayPriceUsdnumberPrice 24 hours ago, used to compute percentage change.
receivedAtstring (ISO 8601)Timestamp when the snapshot was captured by the gateway.
All price, funding, and volume fields in market_tick are JavaScript numbers, not decimal strings. This differs from the REST API, which returns money values as decimal strings to preserve full precision. If you are calculating exact entry sizes or doing accounting, fetch prices from GET /api/v1/perps/markets to get the full-precision decimal-string contract.
Subscribe only to the symbols your bot is actively tracking. Subscriptions are per symbol, and the server already throttles delivery to ~4 ticks per second per symbol — so a focused subscription list keeps your processing overhead low.