๐Ÿ“ก Market Updates

Learn how to receive real-time Socket.IO updates for market orderbooks, trades, open orders, and volume with this WebSocket API guide.

To receive real-time updates volume, market trades and open orders.

import { io } from "socket.io-client";

const url = "{{BASE_URL}}";
const opts = {
  transports: ["websocket"],
  reconnection: true,
  auth: { token: "YOUR_TOKEN_HERE" }, // Set your login token here (optional)
};

const socket = io(url, opts);

socket.on("connect", () => {
  console.log("connected", socket.id);
});

socket.on("disconnect", (reason) => {
  console.log("disconnected", reason);
});

socket.on("connect_error", (err) => {
  console.error("Connection error:", err.message);
});

// Listen for documented events
socket.on("orderbook_102_0", (data) => {
  console.log("Received orderbook_102_0:", data);
});

socket.on("open_order_102_87", (data) => {
  console.log("Received open_order_102_87:", data);
});

socket.on("status_event", (data) => {
  console.log("Received status_event:", data);
});

socket.on("market_trade", (data) => {
  console.log("Received market_trade:", data);
});

socket.on("update_price_chart_102", (data) => {
  console.log("Received update_price_chart_102:", data);
});

socket.on("market_price_for_place_order", (data) => {
  console.log("Received market_price_for_place_order:", data);
});

socket.on("update_volume", (data) => {
  console.log("Received update_volume:", data);
});

๐Ÿงพ Get Orderbook Updates

Emitted to update the current order book for a specific market and outcome, showing the latest asks and bids.

Event: orderbook_{marketId}_{outcomeId}

FieldTypeDescription
asksArray of Order ObjectsList of ask orders (sell orders)
bidsArray of Order ObjectsList of bid orders (buy orders)

Order Object:

FieldTypeDescription
pricestringPrice of the order
sizestringSize/amount of the order

๐Ÿ“… Get Event Status Changes

Emitted whenever a market event undergoes a status change, providing the updated status and relevant event details.

FieldTypeDescription
eventIdstringEvent ID
statusstringStatus of the event (e.g., RESOLVED)
eventTitlestringTitle of the event

๐Ÿ“Š Get Trades in particular Market

Emitted when a trade occurs in the market.

Event for all trades: market_trade

Event for particular market: market_trade_{marketId}

FieldTypeDescription
idstringTrade ID
amountnumberAmount traded
pricenumberPrice per unit
totalnumberTotal value of the trade
typestringTrade type (buy/sell)
createdAtstringISO timestamp of trade
txHashstringTransaction hash
marketIdstringMarket ID
marketTitlestringMarket title
marketQuestionstringMarket question
marketImagestringURL to market image
eventIdnumberEvent ID
outcomeIdstringOutcome ID
outcomeTitlestringOutcome title
outcomeTypenumberOutcome type
abbreviationnull/stringAbbreviation (if any)
slugstringSlug identifier
rewardTokennull/stringReward token (if any)

โฐ Get Price Updates with Timestamp

Delivers continuous price tick updates for selected markets, with each event containing the current price and precise timestamp of execution. This feed can be used for real-time analytics, charting, algorithmic trading strategies, and monitoring intraday price movements.

Event: update_price_chart_{marketId}

FieldTypeDescription
pricenumberLatest price
minutenumberMinute timestamp (epoch)

๐Ÿงพ Get the Best Prices to Place orders

Emitted to provide the latest prices for placing orders in a market.

Event: market_price_for_place_order

FieldTypeDescription
outcomeIdnumberOutcome ID
sidenumberSide (0 = buy, 1 = sell)
pricenumberPrice for the side/outcome

๐Ÿ“Š Get the Latest Volume Changes

Emitted to update the trading volume for a market.

Event: update_volume

FieldTypeDescription
marketIdnumberMarket ID
volumenumberTotal trading volume