Skip to main content

Multi-Order Book

This allows simultaneous subscriptions to multiple L1 and L2 order books of different markets.

The order books of different markets to be subscribed are controlled by the parameters in the subscription message listed below.

/trading-api/v1/market-data/orderbook

Operations

SEND/trading-api/v1/market-data/orderbook

Subscribe

Multiple subscriptions could be opened within the same websocket.

The order book of different markets to be subscribed are controlled by the parameters in the subscription message listed below.

See connect to multi-order book WebSocket for a sample Python script.

Operation IDsubscribe

Accepts the following message:

Subscription

Let you subscribe to a given topic

  • application/json
Message IDsubscribe
object

Examples

RECEIVE/trading-api/v1/market-data/orderbook

After subscribing, the server sends :

  • an acknowledgement

Then (L1 / L2 depending on your topic):

  • an initial snapshot
  • followed by incremental updates
Operation IDsubscribe-ack

Sends one of the following messages:

  • #1Acknowledgment

    Confirm the topic being subscribed

    • application/json
    Message IDsubscribe-ack
    object

    Examples

  • #2Snapshot/Update for L1

    Latest update for L1

    • application/json
    Message IDsubscribe-msg-0
    object

    Examples

  • #3Snapshot/Update for L2

    Latest update for L2

    • application/json
    Message IDsubscribe-msg-1
    object

    Examples

RECEIVE/trading-api/v1/market-data/orderbook

In case of invalid subscription message, an error rejection would be sent.

Operation IDsubscribe-nack

Sends the following message:

Rejection

Explain why the topic could not be subscribed

  • application/json
Message IDsubscribe-nack
object

Examples

SEND/trading-api/v1/market-data/orderbook

Keepalive

In case nothing is subscribed to, keep the websocket connection alive.

Operation IDkeepalive-ping

Accepts the following message:

Keepalive Ping
  • application/json
Message IDkeepalive-ping
object

Examples

RECEIVE/trading-api/v1/market-data/orderbook

Acknowledgement returned by the server in response to a keepalive-ping.

Operation IDkeepalive-pong

Sends the following message:

Keepalive Pong
  • application/json
Message IDkeepalive-pong
object

Examples

SEND/trading-api/v1/market-data/orderbook

Unsubscribe

Let you unsubscribe a specific topic while keeping your websocket opened.

Operation IDunsubscribe

Accepts the following message:

Unsubscription

Let you unsubscribe to a given index

  • application/json
Message IDunsubscribe
object

Examples

RECEIVE/trading-api/v1/market-data/orderbook

After unsubscribing, the server sends an acknowledgement.

Operation IDunsubscribe-ack

Sends the following message:

Acknowledgment

Confirm the topic being unsubscribed

  • application/json
Message IDunsubscribe-ack
object

Examples

RECEIVE/trading-api/v1/market-data/orderbook

In case of invalid unsubscription message, an error rejection would be sent.

Operation IDunsubscribe-nack

Sends the following message:

Rejection

Explain why the topic could not be unsubscribed

  • application/json
Message IDunsubscribe-nack
object

Examples