Market Data Documentation
  • Introduction
  • Technical Guidelines
  • Market Data APIs
    • Market Data API
      • Partial Order Book
      • Light Tickers
      • Live Trades
      • Auction Indicative Equilibrium Price
      • Candles
      • Get Settlement Prices
      • Instrument List
      • Calendar List
      • Tick Size List
  • Release Notes
    • API Changes
Powered by GitBook
On this page
  • Request Parameters
  • Success Response
  • Failure Response
  • Stream Closure
  • Heartbeats (Pings)
  • Request Parameters
  • Samples

Technical Guidelines

API protocol is WebSocket (unless mentioned otherwise) Any request body should be a valid JSON, non valid JSON objects will be ignored.

Within the valid JSON please be aware that:

  • System ignores any additional parameter that was sent on request body but was not specified in this document.

  • In case of multiple parameters sent with different values, system will always use the last value provided.

Request Parameters

Parameter
Type
Description

q

String

qualifier, contains the method for the specific API call.

token

String

sid

Int

stream identifier, for each WebSocket connection this is a unique identifier for the API call. Please note that as long as the sid was not ended (other by exchange or by consumer) this can’t be used again on the same WebSocket connection

d

Json

data object, contain the request body

{ 
 "q":"exchange.market/placeOrder", 
 "token": "eyJleGNoYW5nZUlkIjozMCwicHJvamVjdElkIjoyMDB9",
 "sid":1, 
 "d": 
   { 
     Object
   } 
}

Success Response

The response will always include the q and sid parameters from request and a d parameter with the response body.

{ 
   "q":"exchange.market/placeOrder", 
   "sid":1, 
   "d": 
     { 
       Object
     } 
}

In case of short living stream (i.e. trading action), additional response will be sent upon stream closure with success, this message will include the q and sid parameters from request and sig:1.

{
  "sig": 1,
  "q": "exchange.market/createSession",
  "sid": 1
}

Failure Response

The response will always include the below parameters:

Parameter
Description

sig

signal will be equal to "2"

q

from request

errorType

internal error type that should be ignored

sid

from request

d

data that contain errorCode and errorMessage. Those are the error code and message to consider.

{
  "sig": 2,
  "q": "exchange.market/createSession",
  "errorType": "401",
  "sid": 1,
  "d": {
    "errorCode": 6002,
    "errorMessage": "Missing fields: 'apiKey'"
  }
}

Stream Closure

In order to close active stream need to send a message with sig:3 in addition to q and sid from request.

{
  "sig": 3,
  "q": "exchange.market/orderBookDepth",
  "sid": 100
}

sig parameter summary table:

sig
Description

1

Stream closed with success

2

Stream closed with failure

3

Stream was closed due to consumer request

Heartbeats (Pings)

The WebSocket connection supports ping messages for the client to identify connection drops. Ping requests can be made on-demand, and the server responds to each request.

qualifier: v1/heartbeat/ping

Request Parameters

Parameter
Type
Description

d

Int

This value will be returned in the response.

Samples

{
  "q": "v1/heartbeat/ping",
  "sid": 1,
  "d": 42
}
{
  "q": "v1/heartbeat/ping",
  "sid": 1,
  "d": 42
}
{
  "sig": 2,
  "q": "v1/heartbeat/ping",
  "errorType": "500",
  "sid": 1,
  "d": {
    "errorCode": 500,
    "errorMessage": "Failed to decode service message data"
  }
}

PreviousIntroductionNextMarket Data API

Last updated 11 months ago

Token is configurable value per environment, it allows accurate and efficient instrument discovery. Token generation described on the section.

It is recommended that this API should only be used for heartbeats from the browser. Use WebSocket for other use cases.

native ping/pong
Introduction