Public Exchange Data

Some data is provided by the exchange without requiring authorization, including:

  1. Async API Heartbeat

  2. Matcher State

  3. Instruments List

  4. Funding Rate Updates

  5. Order Book Depth

  6. Order Book Best

  7. Last Trades

[TOC]

Available environments

All channel names have an {env} prefix showing the current environment.

  • futures-perp-dev — for the Development environment

  • futures-perp-demo — for the Demo environment

  • futures-perp-beta — for the Beta environment

  • futures-perp — for the Production environment

Heartbeat

To check the availability of the exchange's Async API, the {env}:heartbeat channel is used, which periodically sends events with the current timestamp.

Async API Heartbeat Event Format
interface HeartbeatEvent {
  t: number;
}

Important: If no events are received on this channel for more than 30 seconds, the connection to the Async API should be considered lost.

Matcher State

In some cases, trading may be globally paused for all instruments. To detect such states, use the GET /api/market method, which returns the current exchange state (state field).

The exchange signals state changes via Async API using the {env}:info channel, which transmits snapshots of the current state.

Async API Matcher State Event Format
enum MatcherState {
  Active = "active",
  RequestStatusFail = "request-status-fail",
  MeDead = "me-dead",
  DbAdminDead = "db-admin-dead",
}

interface MatcherUpdateEvent {
  state: MatcherState;
  updatedAt: string;
}

Important: Any state other than active should be treated as a global trading halt.

Instruments List

To get a list of instruments available for trading, use the GET /api/market/instrument method. This returns an array of all instruments registered on the exchange (including those not available for trading).

Important: If the trading field is none or restricted, the instrument should be considered unavailable for any orders. onlyClose means it is only available for position closing and order cancellation. Otherwise, the instrument is available for trading.

Instrument state updates are signaled via Async API on the {env}:instruments channel with snapshots of current instrument state.

Async API Instrument Event Format
enum Trading {
  All = 'all',
  Restricted = 'restricted',
  None = 'none',
  OnlyClose = 'onlyClose',
}

enum Visibility {
  All = 'all',
  Restricted = 'restricted',
  None = 'none',
}

interface InstrumentUpdateEvent {
  id: string;
  name: string;
  displayName: string;
  lastPrice: number;
  high: number;
  low: number;
  volume: number;
  volumeBase: number;
  closePrice: number;
  markPrice: number;
  openInterest: number;
  minPrice: number;
  maxPrice: number;
  fatFingerPriceProtection: number;
  slippageLimit: number;
  trading: Trading;
  visibility: Visibility;
  updatedAt: Date;
}

Important: To ensure state consistency on the client, compare snapshots by the updatedAt field.

Funding Rate

To get the current funding rate for an instrument, use the GET /api/market/instrument method with fields=metrics. This returns all instruments with additional metrics.

Important: This method is relatively heavy and should not be used frequently or during initial client load.

Funding rate updates are sent via Async API using the {env}:funding-rate channel.

Async API Funding Rate Event Format
interface FundingRateEvent {
    instrument: string;
    fundingRate: string;
    createdAt: number;
}

Important: To ensure funding rate state consistency on the client, compare snapshots by the createdAt field.

Order Book Depth

To get the current state of the order book, use the GET api/market/{instrument}/deep method, which returns grouped volume data by price levels (up to 4 decimal places).

Order book updates are sent via Async API on the {env}:orderBook-{instrument}-0.1 channel.

Async API Order Book Depth Event Format
interface MarketDepthLevel {
  price: number;
  quantity: number;
}

interface MarketDepth {
  t: number;
  asks: Array<MarketDepthLevel>;
  bids: Array<MarketDepthLevel>;
}

interface OrderBookDepthUpdateEvent {
  instrument: string
  orderBook: MarketDepth
}

Important: To ensure consistency of the order book state on the client, compare snapshots by the orderBook.t timestamp field.

Order Book Best

To get the best bid and ask prices, use the same REST API method as for order book depth but with the marketLevel=1 parameter.

Best price updates are sent via Async API using the {env}:orderBook-{instrument}-best channel. The event format matches the previous section.

Last Trades

To get a list of recent trades on the exchange, use the GET /api/market/{instrument}/recent-trades method. This returns anonymized trades for a specific instrument.

Trade updates are sent via Async API using the {env}:trade-{instrument} channel.

Async API Last Trades Event Format
interface Trade {
  instrument: string;
  side: cryptoUtils.Side;
  fillQuantity: number;
  fillPrice: number;
  createdAt: string;
}

Last updated