NAV Navbar
shell javascript

REST API

Redot Exchange provides a REST API using standard HTTP requests.

Connection

REST API endpoint starts with https://api.redot.com/v1/public for public methods and https://api.redot.com/v1/private for private methods.

Rate Limiting

Redot Exchange uses rate limiting to ensure API availability and processing capacity. Any single IP can send up to 3 requests per second.

Request/Response Structure

Request

Request

curl -X GET 'https://api.redot.com/v1/public/method?parameter1=value1&parameter2=value2'

According to the HTTP specification GET requests must be URL in the following format:

Name Type Description
method string Requested method (e.g. get-stats)
parameterX string Query string parameter. Can be omitted if the requested method requires no parameters (e.g. instrumentId)

Success response

Response

{
  "result": {
    ...
  }
}

If successful, the API returns a response with the following structure:

Name Type Description
result object or array Object or array with the request processing result

Error response

Response (HTTP 200)

{
  "error": {
    "code": 20001,
    "message": "Instrument id is invalid."
  }
}

Response (HTTP 500)

{
  "error": {
    "code": 10000,
    "message": "General server error."
  }
}

In case of an error the API returns a response with the following structure:

Name Type Description
error object Request processing error
-> code integer Error code
-> message string Error message
-> data object Additional error data specific to the given error code

HTTP Statuses

HTTP Status Description
500 For error code 10000
200 For other error codes

Data Types

Timestamps

All timestamps are represented as UNIX epoch timestamps in microseconds, if not specified otherwise.

Market Data

Market data methods are public and require no authentication.

Get Info

Request

curl -X GET 'https://api.redot.com/v1/public/get-info'

Response

{
  "result": {
    "name": "Redot",
    "description": "REDOT is an EU regulated digital asset exchange. Run by a team of industry veterans, REDOT sets the industry standard by providing institutional, professional and retail investors with a powerful platform to trade digital assets instantly and securely with the lowest commissions. Focused on meeting the needs of institutions, we built a platform offering world-leading transaction throughput (300K TPS), FIX (Financial Information Exchange) 4.4/5.0 API connectivity, customizable UI widgets and advanced order types. With monthly audits, deep cold storage, withdrawal protection, 2FA and U2F, you can rest assured that your assets remain protected all the times. REDOT is fully regulated with exchange & custody licenses from EU member country - Estonia (FIU LICENSES FRK000787 & FVR000894). Our trading infrastructure is designed to withstand global 24/7 high-frequency trading through failover protection, robust microservice based architecture and redundant infrastructure. Our skilled multilingual support team is ready to assist you 24/7 - if you have a question we’ll address it promptly.",
    "location": "Estonia",
    "logo": "https://cdn.redot.com/static/icons/500px_transparent_background/Icon_0-3.png",
    "website": "https://app.redot.com",
    "twitter": "redotcom"
  }
}

Retrieves information about the exchange.

Method get-info

Parameters

No parameters.

Response

Name Type Description
result object
-> name string Exchange name
-> description string Exchange description
-> location string Exchange location
-> logo string Exchange logo URL
-> website string Exchange website URL
-> twitter string Twitter username

Get Assets

Request

curl -X GET 'https://api.redot.com/v1/public/get-assets'

Response

{
  "result": [
    {
      "id": "BTC",
      "displayName": "Bitcoin"
    },
    {
      "id": "ETH",
      "displayName": "Ethereum"
    }
  ]
}

Retrieves all assets supported by the API.

Method get-assets

Parameters

No parameters.

Response

Name Type Description
result array of objects
-> id string Id
-> displayName string Descriptive name

Get Instruments

Request

curl -X GET 'https://api.redot.com/v1/public/get-instruments?type=spot&asset=ETH'

Response

{
  "result": [
    {
      "id": "ETH-BTC",
      "displayName": "ETH/BTC",
      "type": "spot",
      "base": "ETH",
      "quote": "BTC",
      "minQty": 0.0001,
      "maxQty": 10000000.0,
      "tickSize": 0.000001,
      "takerFee": 0.001,
      "makerFee": 0.0,
      "feeCurrency": "acquired"
    },
    {
      "id": "ETH-USDT",
      "displayName": "ETH/USDT",
      "type": "spot",
      "base": "ETH",
      "quote": "USDT",
      "minQty": 0.001,
      "maxQty": 10000000.0,
      "tickSize": 0.01,
      "takerFee": 0.001,
      "makerFee": 0.0,
      "feeCurrency": "acquired"
    }
  ]
}

Retrieves all instruments supported by the API.

Method get-instruments

Parameters

Name Type Required Description
asset string No Asset ID
type string No Type. Supported values: spot

Response

Name Type Description
result array of objects
-> id string Instrument ID
-> displayName string Descriptive name
-> type string Type. Supported values: spot
-> base string Base asset
-> quote string Quote asset
-> minQty decimal Min order quantity
-> maxQty decimal Max order quantity
-> tickSize decimal Tick size
-> takerFee decimal User fee as a taker
-> makerFee decimal User fee as a maker
-> feeCurrency string Fee currency. Supported values: base, quote, acquired

Get Instrument

Request

curl -X GET 'https://api.redot.com/v1/public/get-instrument?instrumentId=ETH-BTC'

Response

{
  "result": {
    "id": "ETH-BTC",
    "displayName": "ETH/BTC",
    "type": "spot",
    "base": "ETH",
    "quote": "BTC",
    "minQty": 0.0001,
    "maxQty": 10000000.0,
    "tickSize": 0.000001,
    "takerFee": 0.001,
    "makerFee": 0.0,
    "feeCurrency": "acquired"
  }
}

Retrieves a single instrument info.

Method get-instrument

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID

Response

Name Type Description
result object
-> id string Instrument ID
-> displayName string Descriptive name
-> type string Type. Supported values: spot
-> base string Base asset
-> quote string Quote asset
-> minQty decimal Min order quantity
-> maxQty decimal Max order quantity
-> tickSize decimal Tick size
-> takerFee decimal User fee as a taker
-> makerFee decimal User fee as a maker
-> feeCurrency string Fee currency. Supported values: base, quote, acquired

Get Order Book

Request

curl -X GET 'https://api.redot.com/v1/public/get-order-book?instrumentId=ETH-BTC&depth=2'

Response

{
  "result": {
    "bids": [
      [ 0.025935, 0.1063 ],
      [ 0.025927, 0.2573 ]
    ],
    "asks": [
      [ 0.02597, 0.1933 ],
      [ 0.025978, 0.1658 ]
    ],
    "time": 1594801120260274
  }
}

Retrieves a list of open orders by instrument.

Method get-order-book

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID
depth integer No Depth. All levels if omitted

Response

Name Type Description
result object
-> bids array of 2-element arrays Sorted bids. First element is price. Second element is quantity
-> asks array of 2-element arrays Sorted asks. First element is price. Second element is quantity
-> time timestamp Server time

Get Ticker

Request

curl -X GET 'https://api.redot.com/v1/public/get-ticker?instrumentId=ETH-BTC'

Response

{
  "result": {
    "lastTradeId": 2340622,
    "price": 0.025958,
    "qty": 0.167,
    "bidPrice": 0.025941,
    "askPrice": 0.025976,
    "bidQty": 0.1469,
    "askQty": 0.1767,
    "volumeUsd": 20815.51,
    "volume": 53.2365,
    "time": 1594801336189644
  }
}

Retrieves a last trade price, best bid/ask and 24h volume by instrument.

Method get-ticker

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID

Response

Name Type Description
result object
-> lastTradeId long Last trade ID
-> price decimal Last trade price
-> qty decimal Last trade quantity
-> bidPrice decimal Best bid price
-> askPrice decimal Best ask price
-> bidQty decimal Best bid quantity
-> askQty decimal Best ask quantity
-> volumeUsd decimal 24h volume in USD
-> volume decimal 24h volume in base currency
-> time timestamp Server time

Get Last Trades

Request

curl -X GET 'https://api.redot.com/v1/public/get-last-trades?instrumentId=ETH-BTC&start=1594800000000000&end=1594800600000000&offset=5&limit=2'

Response

{
  "result": {
    "data": [
      {
        "id": 2340564,
        "time": 1594800486782215,
        "price": 0.02595400,
        "qty": 0.05280000,
        "side": "buy"
      },
      {
        "id": 2340563,
        "time": 1594800474577835,
        "price": 0.02595400,
        "qty": 0.03910000,
        "side": "sell"
      }
    ],
    "next": true
  }
}

Retrieves a list of last trades by instrument.

Method get-last-trades

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID
offset integer No Pagination offset, 0 if omitted
limit integer No Pagination limit, 20 if omitted. Value cannot be greater than 200
start timestamp No Return trades from specified date/time
end timestamp No Return trades until specified date/time

Response

Name Type Description
result object
-> next boolean Next page of results can be retrieved
-> data array of objects Array of trades
--> id long Trade ID
--> time timestamp Date and time
--> price decimal Price
--> qty decimal Quantity
--> side string Side. Supported values: buy, sell

Get Candles

Request

curl -X GET 'https://api.redot.com/v1/public/get-candles?instrumentId=ETH-BTC&size=60&start=1594800000000000&end=1594800600000000&offset=5&limit=2'

Response

{
  "result": {
    "data": [
      {
        "time": 1594800288981015,
        "low": 0.025954,
        "high": 0.025954,
        "open": 0.025954,
        "close": 0.025954,
        "volume": 0.1
      },
      {
        "time": 1594800348981015,
        "low": 0.025954,
        "high": 0.025954,
        "open": 0.025954,
        "close": 0.025954,
        "volume": 0.003
      }
    ],
    "next": true
  }
}

Retrieves a list of candles by instrument.

Method get-candles

Parameters

Pagination is supported.

Name Type Required Description
instrumentId string Yes Instrument ID
offset integer No Pagination offset, 0 if omitted
limit integer No Pagination limit, 20 if omitted. Value cannot be greater than 200
start timestamp No Return candles from specified date/time
end timestamp No Return candles until specified date/time
size integer Yes Candle size in seconds. Supported values: 60 (1m), 300 (5m), 900 (15m), 3600 (1h), 43200 (12h)

Response

Name Type Description
result object
-> next boolean Next page of results can be retrieved
-> data array of objects Array of candles
--> time timestamp Time of candle start
--> low decimal Low price
--> high decimal High price
--> open decimal Open price
--> close decimal Close price
--> volume decimal Volume in base currency

Get 24h Stats

Request

curl -X GET 'https://api.redot.com/v1/public/get-stats?instrumentId=ETH-BTC'

Response

{
  "result": {
    "first": 0.02595500,
    "last": 0.025969,
    "low": 0.025916,
    "high": 0.02610700,
    "volumeUsd": 21147.71,
    "volume": 54.0862
  }
}

Retrieves last 24 hr stats for the instrument.

Method get-stats

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID

Response

Name Type Description
result array of objects
-> first decimal First price
-> last decimal Last price
-> low decimal Lowest price
-> high decimal Highest price
-> volumeUsd decimal Volume in USD
-> volume decimal Volume in base currency

Error Codes

Code Message Description
10000 General server error. An error occurred on the server while serving the request.
10001 Request timeout. Timeout occurred on the server while serving the request.
20000 Several request parameters are invalid. Two or more request parameters are invalid.
20001 Instrument id is invalid. Instrument ID has invalid format.
20002 Instrument not found. Instrument does not exist.
20003 Asset id is invalid. Asset ID has invalid format.
20004 Instrument type is invalid. Instrument type has invalid format or is not supported by the server.
20005 Depth is invalid. Order book depth value is invalid.
20006 Period is invalid. Date period is invalid.
20007 Candle size is invalid. Candle size is invalid.
20008 Offset is invalid. Paging offset is invalid.
20009 Limit is invalid. Paging limit is invalid.
20010 Request parameters have incorrect format. An error occurred on the server while parsing the request parameters.
30001 Too many requests. Request rate exceeded the API limits.

JSON-RPC API

Redot Exchange provides a JSON-RPC API using JSON-RPC 2.0.

JSON-RPC does not specify what transport protocol must be used. Redot JSON-RPC API currently supports HTTPS and WebSockets.

Connection

JSON-RPC API endpoint is https://api.redot.com/v1/public or wss://api.redot.com/v1/public for public methods and https://api.redot.com/v1/private or wss://api.redot.com/v1/private for private methods.

Rate Limiting

Redot Exchange uses rate limiting to ensure API availability and processing capacity. Any single IP can send up to 3 requests per second.

Request/Response Structure

Request

Request

{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-stats",
  "params": {
    "instrumentId": "ETH-BTC"
  }
}

According to the JSON-RPC specification requests must be JSON objects with the following structure:

Name Type Description
jsonrpc string JSON-RPC version. Must be 2.0
id string Request ID to match requests and responses. Can be omitted
method string Requested method
params object Requested method parameters. Can be omitted if the requested method requires no parameters

Success response

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "first": 0.02595500,
    "last": 0.025969,
    "low": 0.025916,
    "high": 0.02610700,
    "volumeUsd": 21147.71,
    "volume": 54.0862
  }
}

If successful, the API returns a response with the following structure:

Name Type Description
jsonrpc string JSON-RPC version. Will be 2.0
id string Response ID that equals the corresponding request ID. Will be null if the request had no ID
result object or array Object or array with the request processing result

Error response

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "error": {
    "code": 20001,
    "message": "Instrument id is invalid."
  }
}

In case of an error the API returns a response with the following structure:

Name Type Description
jsonrpc string JSON-RPC version. Will be 2.0
id string Response ID that equals the corresponding request ID. Will be null if the request had no ID
error object Request processing error
-> code integer Error code
-> message string Error message
-> data object Additional error data specific to the given error code

Data Types

Timestamps

All timestamps are represented as UNIX epoch timestamps in microseconds, if not specified otherwise.

Market Data

Market data methods are public and require no authentication.

Get Info

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-info"
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-info"
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "name": "Redot",
    "description": "REDOT is an EU regulated digital asset exchange. Run by a team of industry veterans, REDOT sets the industry standard by providing institutional, professional and retail investors with a powerful platform to trade digital assets instantly and securely with the lowest commissions. Focused on meeting the needs of institutions, we built a platform offering world-leading transaction throughput (300K TPS), FIX (Financial Information Exchange) 4.4/5.0 API connectivity, customizable UI widgets and advanced order types. With monthly audits, deep cold storage, withdrawal protection, 2FA and U2F, you can rest assured that your assets remain protected all the times. REDOT is fully regulated with exchange & custody licenses from EU member country - Estonia (FIU LICENSES FRK000787 & FVR000894). Our trading infrastructure is designed to withstand global 24/7 high-frequency trading through failover protection, robust microservice based architecture and redundant infrastructure. Our skilled multilingual support team is ready to assist you 24/7 - if you have a question we’ll address it promptly.",
    "location": "Estonia",
    "logo": "https://cdn.redot.com/static/icons/500px_transparent_background/Icon_0-3.png",
    "website": "https://app.redot.com",
    "twitter": "redotcom"
  }
}

Retrieves information about the exchange.

Method get-info

Parameters

No parameters.

Response

Name Type Description
result object
-> name string Exchange name
-> description string Exchange description
-> location string Exchange location
-> logo string Exchange logo URL
-> website string Exchange website URL
-> twitter string Twitter username

Get Assets

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-assets"
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-assets"
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": [
    {
      "id": "BTC",
      "displayName": "Bitcoin"
    },
    {
      "id": "ETH",
      "displayName": "Ethereum"
    }
  ]
}

Retrieves all assets supported by the API.

Method get-assets

Parameters

No parameters.

Response

Name Type Description
result array of objects
-> id string Id
-> displayName string Descriptive name

Get Instruments

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-instruments",
  "params": {
    "type": "spot",
    "asset": "ETH"
  }
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-instruments",
  "params": {
    "type": "spot",
    "asset": "ETH"
  }
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": [
    {
      "id": "ETH-BTC",
      "displayName": "ETH/BTC",
      "type": "spot",
      "base": "ETH",
      "quote": "BTC",
      "minQty": 0.0001,
      "maxQty": 10000000.0,
      "tickSize": 0.000001,
      "takerFee": 0.001,
      "makerFee": 0.0,
      "feeCurrency": "acquired"
    },
    {
      "id": "ETH-USDT",
      "displayName": "ETH/USDT",
      "type": "spot",
      "base": "ETH",
      "quote": "USDT",
      "minQty": 0.001,
      "maxQty": 10000000.0,
      "tickSize": 0.01,
      "takerFee": 0.001,
      "makerFee": 0.0,
      "feeCurrency": "acquired"
    }
  ]
}

Retrieves all instruments supported by the API.

Method get-instruments

Parameters

Name Type Required Description
asset string No Asset ID
type string No Type. Supported values: spot

Response

Name Type Description
result array of objects
-> id string Instrument ID
-> displayName string Descriptive name
-> type string Type. Supported values: spot
-> base string Base asset
-> quote string Quote asset
-> minQty decimal Min order quantity
-> maxQty decimal Max order quantity
-> tickSize decimal Tick size
-> takerFee decimal User fee as a taker
-> makerFee decimal User fee as a maker
-> feeCurrency string Fee currency. Supported values: base, quote, acquired

Get Instrument

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-instrument",
  "params": {
    "instrumentId": "ETH-BTC"
  }
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-instrument",
  "params": {
    "instrumentId": "ETH-BTC"
  }
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "id": "ETH-BTC",
    "displayName": "ETH/BTC",
    "type": "spot",
    "base": "ETH",
    "quote": "BTC",
    "minQty": 0.0001,
    "maxQty": 10000000.0,
    "tickSize": 0.000001,
    "takerFee": 0.001,
    "makerFee": 0.0,
    "feeCurrency": "acquired"
  }
}

Retrieves a single instrument info.

Method get-instrument

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID

Response

Name Type Description
result object
-> id string Instrument ID
-> displayName string Descriptive name
-> type string Type. Supported values: spot
-> base string Base asset
-> quote string Quote asset
-> minQty decimal Min order quantity
-> maxQty decimal Max order quantity
-> tickSize decimal Tick size
-> takerFee decimal User fee as a taker
-> makerFee decimal User fee as a maker
-> feeCurrency string Fee currency. Supported values: base, quote, acquired

Get Order Book

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-order-book",
  "params": {
    "instrumentId": "ETH-BTC",
    "depth": 2
  }
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-order-book",
  "params": {
    "instrumentId": "ETH-BTC",
    "depth": 2
  }
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "bids": [
      [ 0.025935, 0.1063 ],
      [ 0.025927, 0.2573 ]
    ],
    "asks": [
      [ 0.02597, 0.1933 ],
      [ 0.025978, 0.1658 ]
    ],
    "time": 1594801120260274
  }
}

Retrieves a list of open orders by instrument.

Method get-order-book

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID
depth integer No Depth. All levels if omitted

Response

Name Type Description
result object
-> bids array of 2-element arrays Sorted bids. First element is price. Second element is quantity
-> asks array of 2-element arrays Sorted asks. First element is price. Second element is quantity
-> time timestamp Server time

Get Ticker

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-ticker",
  "params": {
    "instrumentId": "ETH-BTC"
  }
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-ticker",
  "params": {
    "instrumentId": "ETH-BTC"
  }
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "lastTradeId": 2340622,
    "price": 0.025958,
    "qty": 0.167,
    "bidPrice": 0.025941,
    "askPrice": 0.025976,
    "bidQty": 0.1469,
    "askQty": 0.1767,
    "volumeUsd": 20815.51,
    "volume": 53.2365,
    "time": 1594801336189644
  }
}

Retrieves a last trade price, best bid/ask and 24h volume by instrument.

Method get-ticker

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID

Response

Name Type Description
result object
-> lastTradeId long Last trade ID
-> price decimal Last trade price
-> qty decimal Last trade quantity
-> bidPrice decimal Best bid price
-> askPrice decimal Best ask price
-> bidQty decimal Best bid quantity
-> askQty decimal Best ask quantity
-> volumeUsd decimal 24h volume in USD
-> volume decimal 24h volume in base currency
-> time timestamp Server time

Get Last Trades

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-last-trades",
  "params": {
    "instrumentId": "ETH-BTC",
    "start": 1594800000000000,
    "end": 1594800600000000,
    "offset": 5,
    "limit": 2
  }
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-last-trades",
  "params": {
    "instrumentId": "ETH-BTC",
    "start": 1594800000000000,
    "end": 1594800600000000,
    "offset": 5,
    "limit": 2
  }
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "data": [
      {
        "id": 2340564,
        "time": 1594800486782215,
        "price": 0.02595400,
        "qty": 0.05280000,
        "side": "buy"
      },
      {
        "id": 2340563,
        "time": 1594800474577835,
        "price": 0.02595400,
        "qty": 0.03910000,
        "side": "sell"
      }
    ],
    "next": true
  }
}

Retrieves a list of last trades by instrument.

Method get-last-trades

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID
offset integer No Pagination offset, 0 if omitted
limit integer No Pagination limit, 20 if omitted. Value cannot be greater than 200
start timestamp No Return trades from specified date/time
end timestamp No Return trades until specified date/time

Response

Name Type Description
result object
-> next boolean Next page of results can be retrieved
-> data array of objects Array of trades
--> id long Trade ID
--> time timestamp Date and time
--> price decimal Price
--> qty decimal Quantity
--> side string Side. Supported values: buy, sell

Get Candles

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-candles",
  "params": {
    "instrumentId": "ETH-BTC",
    "size": 60,
    "start": 1594800000000000,
    "end": 1594800600000000,
    "offset": 5,
    "limit": 2
  }
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-candles",
  "params": {
    "instrumentId": "ETH-BTC",
    "size": 60,
    "start": 1594800000000000,
    "end": 1594800600000000,
    "offset": 5,
    "limit": 2
  }
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "data": [
      {
        "time": 1594800288981015,
        "low": 0.025954,
        "high": 0.025954,
        "open": 0.025954,
        "close": 0.025954,
        "volume": 0.1
      },
      {
        "time": 1594800348981015,
        "low": 0.025954,
        "high": 0.025954,
        "open": 0.025954,
        "close": 0.025954,
        "volume": 0.003
      }
    ],
    "next": true
  }
}

Retrieves a list of candles by instrument.

Method get-candles

Parameters

Pagination is supported.

Name Type Required Description
instrumentId string Yes Instrument ID
offset integer No Pagination offset, 0 if omitted
limit integer No Pagination limit, 20 if omitted. Value cannot be greater than 200
start timestamp No Return candles from specified date/time
end timestamp No Return candles until specified date/time
size integer Yes Candle size in seconds. Supported values: 60 (1m), 300 (5m), 900 (15m), 3600 (1h), 43200 (12h)

Response

Name Type Description
result object
-> next boolean Next page of results can be retrieved
-> data array of objects Array of candles
--> time timestamp Time of candle start
--> low decimal Low price
--> high decimal High price
--> open decimal Open price
--> close decimal Close price
--> volume decimal Volume in base currency

Get 24h Stats

Request

curl -X POST 'https://api.redot.com/v1/public' \
-H 'Content-Type: application/json' \
-d '{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-stats",
  "params": {
    "instrumentId": "ETH-BTC"
  }
}'
var request = 
{
  "id": "52",
  "jsonrpc": "2.0",
  "method": "get-stats",
  "params": {
    "instrumentId": "ETH-BTC"
  }
};
var ws = new WebSocket('wss://api.redot.com/v1/public');
ws.onmessage = function (e) {
    console.log('Data received from server : ', e.data);
};
ws.onopen = function () {
    ws.send(JSON.stringify(request));
};

Response

{
  "jsonrpc": "2.0",
  "id": "52",
  "result": {
    "first": 0.02595500,
    "last": 0.025969,
    "low": 0.025916,
    "high": 0.02610700,
    "volumeUsd": 21147.71,
    "volume": 54.0862
  }
}

Retrieves last 24 hr stats for the instrument.

Method get-stats

Parameters

Name Type Required Description
instrumentId string Yes Instrument ID

Response

Name Type Description
result array of objects
-> first decimal First price
-> last decimal Last price
-> low decimal Lowest price
-> high decimal Highest price
-> volumeUsd decimal Volume in USD
-> volume decimal Volume in base currency

Error Codes

Code Message Description
-32700 Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.
-32601 Method not found. The method does not exist or is not available.
-32600 The JSON sent is not a valid Request object. The JSON sent has invalid structure.
-30000 JSON RPC version is invalid. The JSON RPC version does not equal 2.0
10000 General server error. An error occurred on the server while serving the request.
10001 Request timeout. Timeout occurred on the server while serving the request.
20000 Several request parameters are invalid. Two or more request parameters are invalid.
20001 Instrument id is invalid. Instrument ID has invalid format.
20002 Instrument not found. Instrument does not exist.
20003 Asset id is invalid. Asset ID has invalid format.
20004 Instrument type is invalid. Instrument type has invalid format or is not supported by the server.
20005 Depth is invalid. Order book depth value is invalid.
20006 Period is invalid. Date period is invalid.
20007 Candle size is invalid. Candle size is invalid.
20008 Offset is invalid. Paging offset is invalid.
20009 Limit is invalid. Paging limit is invalid.
30001 Too many requests. Request rate exceeded the API limits.

FIX API

Redot Exchange provides a FIX API using FIX 4.4 and 5.0.

FIX (Financial Information eXchange) is a standard protocol which can be used to enter orders, submit cancel requests, and receive fills. Users of the FIX API will typically have existing software using FIX for order management.

Credentials management

In order to connect to the Redot Exchange FIX server, API credential set is needed. The set consists of ApiKey and ApiPassphrase. ApiKey is used as the SenderCompId tag value of every FIX message originating from the client. You can see the Message structure section for details. ApiPassphrase is used to calculate a Password tag value of a Logon message in order to successfully authenticate. You can see a Sessions and Authentication section for details. Make sure to keep both values secret.

API credential sets can be managed via Redot Exchange UI in a "FIX API" section in Settings. The list with available API credential sets will be displayed. Only ApiKeys displayed as ApiPassphrase are considered strictly secret and must be kept separately and securely. Anyone gaining access to both your ApiKey and ApiPassphrase will be able to trade on your behalf. It's possible to create up to 10 credential sets per user.

Once you click the button "Add New Credentials", the dialog window will appear. Please select the FIX API version and submit. Subsequently a newly created ApiKey and an ApiPassphrase will be displayed. Remember to copy and secretly store the ApiPassphrase, as it will not be accessible afterwards. If ApiPassphrase gets lost, the credential set has to be deleted and a new one created.

In order to delete a credential set, click an "Options" icon in the given set's row and select "Delete". The API credential set will get deleted and an active FIX session will be immediately terminated, if present.

Connection

The Redot Exchange FIX server uses TCP transport protocol. IP address is fix.redot.com. Port is 777. TLS 1.3 is used.

Message structure

Every FIX message consists of three parts: header, body and trailer. Body is specific for every message type. Header and trailer must have the same tags for all the messages. The structure as follows:

Tag Name Type Required Description
8 BeginString string Yes Protocol version. It contains FIX.4.4 for FIX version 4.4 and FIXT.1.1 for FIX version 5.0
9 BodyLength int Yes Message length in bytes, not including BeginString, BodyLength and CheckSum
35 MsgType string Yes Message type
34 MsgSeqNum int Yes Message sequence number. It starts with 1 for every session and increases by 1 for every subsequent message within a session.
49 SenderCompId string Yes Identifier of message sender. It equals ApiKey from FIX API credentials, if the client is a sender. It is REDOTFIXSERVER, if the server is a sender
52 SendingTime datetime Yes Date and time when the message is sent. Example 20190702-05:11:35.123
56 TargetCompID string Yes Identifier of a message receiver. It will be ApiKey from FIX API credential set, if client is receiver. It must equal REDOTFIXSERVER, if server is receiver
10 CheckSum string Yes Message checksum consists of 3 symbols. See FIX specification for checksum calculation details.

All tags from the table except CheckSum represent a message header. The CheckSum tag represents a message trailer. The message starts with BeginString, BodyLength and MsgType in this exact order. The message ends with CheckSum.

The description of specific messages below does not include header and trailer tags.

Sessions and Authentication

FIX is a session-based protocol. In order to establish a session the client must authenticate himself by sending a Logon message. In order to terminate a session either the FIX server or the client must send a Logout message. Heartbeat and TestRequest messages are used to keep a session active, if no other activity is performed. See detailed description of every message below.

Logon

MsgType = A

Tag Name Type Required Description
96 RawData string Yes See below
554 Password string Yes See below
98 EncryptMethod int Yes Message encryption method. Currently, only 0 (None) is supported.
108 HeartBtInt int Yes Heartbeats interval

The structure of RawData is timestamp.nonce - timestamp value and nonce value separated by an ASCII period. timestamp must be of a 64-bit integer type. Its value increases in every subsequent Logon message. We recommend using a current timestamp in milliseconds. nonce must be a random byte array encoded in Base64. It is important for nonce bytes to be generated by a cryptographically secure random number generator. The size is from 32 to 512 bytes.

Password is used for authentication. You can calculate it by following the steps below:

In short, Password = Base64(SHA256(RawData+ApiPassphrase)). The FIX server performs the same steps and compares the resulting value with Password provided. If the values match, the user is authenticated and a session established.

Success response

In case of a successful authentication the FIX server responds with a Logon message containing EncryptMethod and HeartBtInt tags.

Error responses

In case of a failed authentication the FIX server responds with a Logout message containing a Text tag that specifies a failure reason. The list of reasons currently includes:

Text Description
Rejected Logon Attempt: ApiKey not found The server has no ApiKey corresponding to the value sent in SenderCompId tag. Check the value or generate new FIX API credentials
Rejected Logon Attempt: Wrong format of RawData RawData value has an incorrect format. Make sure it has structure of timestamp.nonce
Rejected Logon Attempt: Timestamp in RawData must be numeric timestamp is not numeric
Rejected Logon Attempt: Timestamp is less or equal to the last one used timestamp has not increased since the last Logon message. Make sure it is an always-increasing value
Rejected Logon Attempt: Nonce is in invalid format nonce is not a Base64-encoded string. Check the algorithm used to generate nonce
Rejected Logon Attempt: Nonce is less than 32 bytes nonce is less than 32 bytes. Check the algorithm used to generate nonce
Rejected Logon Attempt: Nonce is greater than 512 bytes nonce is greater than 512 bytes. Check the algorithm used to generate nonce
Rejected Logon Attempt: Wrong password Password calculated by the server based on RawData and ApiPassphrase does not match Password value in the Logon message. Check if the correct ApiPassphrase is used

Logout

MsgType = 5

If either the client or the server decides to terminate a session, it sends a Logout message with no body. The other party acknowledges the session termination by sending a Logout message with no body.

Heartbeat

MsgType = 0

If any FIX party has not received or sent any data for the interval specified in HeartBtInt tag of Logon message it must send a Heartbeat message with no body.

Success response

When other party receives a Heartbeat message it sends back another Heartbeat message as a confirmation.

TestRequest

MsgType = 1

If any FIX party has not received any data for the interval specified in the HeartBtInt tag of the Logon message it must send a TestRequest message.

Tag Name Type Required Description
112 TestReqId string Yes Test request identifier

Success response

When other party receives the TestRequest message it sends the Heartbeat message with a TestReqId tag mirroring the received value.

Accounts

UserRequest

It is used to request the user account balance information.

MsgType = BE

Tag Name Type Required Description
923 UserRequestID string Yes Request identifier
924 UserRequestType int Yes RequestType. Currently only 4 (RequestIndividualUserStatus) is supported
15 Currency string Yes Currency to get balance of, e.g. BTC

Success response

The server responds with a UserResponse message containing user account balances.

MsgType = BF

Tag Name Type Required Description
923 UserRequestID string Yes UserRequestID from UserRequest message
926 UserStatus int Yes User status. 1 (LoggedIn) is returned
15 Currency string Yes Balance currency
100002 UserBalance decimal Yes User account balance

Error response

If the user request was rejected the server responds with a UserResponse message.

MsgType = BF

Tag Name Type Required Description
923 UserRequestID string Yes UserRequestID from UserRequest message
926 UserStatus int Yes Reject reason
927 UserStatusText string Yes Reject reason description

Possible errors:

UserStatus UserStatus Name UserStatusText Description
3 USER_NOT_RECOGNISED ACCOUNT_NOT_FOUND User account not found
6 OTHER UNSUPPORTED_USER_REQUEST_TYPE Unsupported UserRequestType
6 OTHER CURRENCY_NOT_FOUND Currency not found
6 OTHER UNKNOWN_ERROR Unknown error encountered. Contact the support

Instruments

SecurityListRequest

Requests a list of instruments.

MsgType = x

Tag Name Type Required Description
320 SecurityReqID string Yes Unique request identifier assigned by the client
559 SecurityListRequestType int Yes Request type. Currently only 4 (AllSecurities) is supported

Success response

The server responds with a SecurityList message containing the list of instruments.

MsgType = y

Tag Name Type Required Description
320 SecurityReqID string Yes SecurityReqID value from SecurityListRequest message
322 SecurityResponseID string Yes Unique identifier of response
560 SecurityRequestResult int Yes Request result. 0 (ValidRequest) is returned
146 NoRelatedSym int No Number of instruments following
-> 55 Symbol string Yes Instrument symbol

Orders

NewOrderSingle

Used to submit a single order to the exchange.

MsgType = D

Tag Name Type Required Description
11 ClOrdID string Yes Unique client order identifier assigned by the client
55 Symbol string Yes Instrument symbol, e.g. BTC_USD
40 OrdType char Yes Order type. Supported values: 1 (Market), 2 (Limit)
54 Side char Yes Order side. Supported values: 1 (Buy), 2 (Sell)
44 Price decimal Yes Order price, ignored for market orders
38 OrderQty decimal Conditional Order quantity in base currency
152 CashOrderQty decimal Conditional Order quantity in quote currency

OrderQty specifies the amount of base currency to buy/sell. CashOrderQty specifies the amount of quote currency to spend/receive to buy/sell base currency. For a limit order OrderQty must be set and CashOrderQty must not be set. For a market order one of these values must be set. If none or both values are set, an error is reported.

Success response

The server responds with an ExecutionReport message containing information about the submitted order.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from NewOrderSingle message
17 ExecID string Yes Unique identifier of the execution report
150 ExecType char Yes Order execution type. 0 (New) is returned
37 OrderID string Yes Server-generated permanent order identifier
39 OrdStatus char Yes Order status. 0 (New) is returned
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity
14 CumQty decimal Yes Executed quantity
151 LeavesQty decimal Yes Quantity open for further execution
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 if no quantity executed yet
60 TransactTime datetime Yes Date and time of the transaction

Error response

If the order was rejected due to business related reasons, the server responds with an ExecutionReport message.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from NewOrderSingle message
17 ExecID string Yes Unique identifier of the execution report
150 ExecType char Yes Order execution type. 8 (Rejected) is returned
103 OrdRejReason int Yes Reject reason
58 Text string Conditional Reject text
37 OrderID string Yes Server-generated permanent order identifier. 0 is returned
39 OrdStatus char Yes Order status. 8 (Rejected) is returned
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity. 0 is returned
14 CumQty decimal Yes Executed quantity. 0 is returned
151 LeavesQty decimal Yes Quantity open for further execution. 0 is returned
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 is returned
60 TransactTime datetime Yes Date and time of the transaction

Possible errors:

OrdRejReason OrdRejReason Name Text Description
11 UNSUPPORTED_ORDER_CHARACTERISTIC UNSUPPORTED_ORDER_TYPE Unsupported OrdType
11 UNSUPPORTED_ORDER_CHARACTERISTIC UNSUPPORTED_SIDE Unsupported Side
15 UNKNOWN_ACCOUNT - User account not found
1 UNKNOWN_SYMBOL - Unknown Symbol
2 EXCHANGE_CLOSED - Order book for the instrument is closed
13 INCORRECT_QUANTITY BOTH_QUANTITY_AND_CASH_QUANTITY_SPECIFIED Both OrderQty and CashOrderQty are specified, which is invalid
13 INCORRECT_QUANTITY NO_QUANTITY_SPECIFIED Neither OrderQty not CashOrderQty is specified
13 INCORRECT_QUANTITY CASH_QUANTITY_SPECIFIED_FOR_LIMIT_ORDER CashOrderQty is specified for the limit order
13 INCORRECT_QUANTITY QUANTITY_NOT_SPECIFIED_FOR_LIMIT_ORDER OrderQty is not specified for the limit order
13 INCORRECT_QUANTITY NEGATIVE_OR_ZERO_QUANTITY Negative or zero OrderQty
13 INCORRECT_QUANTITY TOO_LARGE_QUANTITY Too large OrderQty or CashOrderQty
13 INCORRECT_QUANTITY TOO_SMALL_QUANTITY Too small OrderQty or CashOrderQty
6 DUPLICATE_ORDER - Order with the same ClOrdID already submitted
99 OTHER ACCOUNT_SUSPENDED User account is suspended
99 OTHER INVALID_PRICE Invalid Price
99 OTHER INSUFFICIENT_FUNDS User account has insufficient funds
99 OTHER UNKNOWN_ERROR Unknown error encountered. Contact support

OrderCancelRequest

Cancels an active order.

MsgType = F

Tag Name Type Required Description
11 ClOrdID string Yes Unique request identifier assigned by the client
41 OrigClOrdID string Conditional Client order identifier, see below
37 OrderID string Conditional Server order identifier, see below

The order to cancel can be specified in two ways: by OrderID and by OrigClOrdID. OrderID is a server-generated identifier and can be used across sessions. OrigClOrdID is a client-generated identifier and cannot be used across sessions. Use it only in the same session in which NewOrderSingle (or the OrderCancelReplaceRequest) submitting the order was sent. The OrigClOrdID value must be equal to the ClOrdId value sent in an NewOrderSingle message or in an OrderCancelReplaceRequest message if the order was created as a result of another order change.

If both OrderID and OrigClOrdID are specified, OrderID is used. If neither value is specified, an error is reported.

Success response

The server responds with an ExecutionReport message containing information about the cancelled order.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderCancelRequest message
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. 4 (Canceled) is returned
41 OrigClOrdID string No OrigClOrdID value from OrderCancelRequest message
37 OrderID string Yes Server-generated permanent order identifier
39 OrdStatus char Yes Order status. 4 (Canceled) is returned
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity
14 CumQty decimal Yes Executed quantity
151 LeavesQty decimal Yes Quantity open for further execution
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 if no quantity was executed yet
60 TransactTime datetime Yes Date and time of the transaction

Error response

If an order cancellation was rejected due to business related reasons, the server responds with an OrderCancelReject message.

MsgType = 9

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderCancelRequest message
434 CxlRejResponseTo char Yes Target of response. 1 (OrderCancelRequest) is returned
102 CxlRejReason int Yes Reject reason
58 Text string Conditional Reject text
39 OrdStatus char Yes Order status. 0 (New) is currently returned
41 OrigClOrdID string Yes OrigClOrdID value from OrderCancelRequest message. NONE is returned if not provided
37 OrderID string Yes Server-generated permanent order identifier. NONE is returned if not provided

Possible errors:

CxlRejReason CxlRejReason Name Text Description
1 UNKNOWN_ORDER NO_ORDER_IDS_SPECIFIED Neither OrderID nor OrigClOrdID is specified
1 UNKNOWN_ORDER ORDER_NOT_FOUND Order with given identifiers not found
99 OTHER INVALID_ORDER_ID Invalid OrderID
99 OTHER INVALID_CLIENT_ORDER_ID Invalid OrigClOrdID
99 OTHER ACCOUNT_NOT_FOUND User account not found
99 OTHER ACCOUNT_SUSPENDED User account suspended
99 OTHER UNKNOWN_ERROR Unknown error encountered. Contact support

OrderMassCancelRequest

Used to cancel multiple active orders that match a given set of criteria.

MsgType = q

Tag Name Type Required Description
11 ClOrdID string Yes Unique request identifier assigned by client
530 MassCancelRequestType char Yes Request types, see below
55 Symbol string Conditional Instrument symbol, see below
54 Side char No Order side. Supported values: 1 (Buy), 2 (Sell). See below

Currently two values of MassCancelRequestType are supported: 1 (CancelOrdersForASecurity) and 7 (CancelAllOrders). If MassCancelRequestType equals 1, Symbol must be specified to cancel all orders for a given instrument. If MassCancelRequestType equals 7, Symbol is not required and is ignored if specified. This request type cancels all orders.

Side can be optionally specified for both request types to cancel only buy or sell orders.

Success response

The server responds with an OrderMassCancelReport message to indicate a successful execution of the request.

MsgType = r

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderMassCancelRequest message
530 MassCancelRequestType char Yes MassCancelRequestType value from OrderMassCancelRequest message
531 MassCancelResponse char Yes Response type. Mirrors MassCancelRequestType value from OrderMassCancelRequest message
60 TransactTime datetime Yes Date and time of transaction

Subsequently for every cancelled order the server responds with a ExecutionReport message containing information about the order.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderMassCancelRequest message
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. 4 (Canceled) is returned
37 OrderID string Yes Server-generated permanent order identifier
39 OrdStatus char Yes Order status. 4 (Canceled) is returned
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity
14 CumQty decimal Yes Executed quantity
151 LeavesQty decimal Yes Quantity open for further execution
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 if no quantity executed yet
60 TransactTime datetime Yes Date and time of transaction

Error response

If the order mass cancellation was rejected due to business related reasons, the server responds with a OrderMassCancelReport message.

MsgType = r

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderMassCancelRequest message
530 MassCancelRequestType char Yes MassCancelRequestType value from OrderMassCancelRequest message
531 MassCancelResponse char Yes Response type. 0 (CancelRequestRejected) is returned
532 MassCancelRejectReason int Yes Reject reason
58 Text string Conditional Reject text
60 TransactTime datetime Yes Date and time of the transaction

Possible errors:

MassCancelRejectReason MassCancelRejectReason Name Text Description
1 INVALID_OR_UNKNOWN_SECURITY INVALID_SYMBOL Invalid Symbol
1 INVALID_OR_UNKNOWN_SECURITY ORDER_BOOK_NOT_FOUND Order book for instrument not found
99 OTHER UNSUPPORTED_MASS_CANCEL_REQUEST_TYPE Unsupported MassCancelRequestType
99 OTHER CURRENCY_NOT_FOUND Base or quote currency not found
99 OTHER ACCOUNT_NOT_FOUND User account not found
99 OTHER ACCOUNT_SUSPENDED User account is suspended
99 OTHER UNKNOWN_ERROR Unknown error encountered. Contact support

OrderCancelReplaceRequest

Changes the parameters of an active order.

MsgType = G

Tag Name Type Required Description
11 ClOrdID string Yes Unique request identifier assigned by client
41 OrigClOrdID string Conditional Client order identifier, see below
37 OrderID string Conditional Server order identifier, see below
40 OrdType char Yes Order type to set
44 Price decimal No Price to set
38 OrderQty decimal Yes Total quantity to set
9619 CancelOrigOnReject char No Set Y to indicate whether original order should be cancelled if request is rejected

The order to change can be specified in two ways: by OrderID and by OrigClOrdID. OrderID is a server-generated identifier and can be used across sessions. OrigClOrdID is a client-generated identifier and cannot be used across sessions. Use it only in the same session in which NewOrderSingle (or OrderCancelReplaceRequest) submitting the order was sent. The OrigClOrdID value must be equal to the ClOrdId value sent in a the NewOrderSingle message or in the OrderCancelReplaceRequest message if the order was created as a result of another order change.

If both OrderID and OrigClOrdID are specified, OrderID is used. If neither value is specified, an error is reported.

Success response

The server responds with an ExecutionReport message for every order affected by the change.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderCancelReplaceRequest message
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. 5 (Replaced) is returned
41 OrigClOrdID string No OrigClOrdID value from OrderCancelReplaceRequest message
37 OrderID string Yes Server-generated permanent order identifier
39 OrdStatus char Yes Order current status
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity
14 CumQty decimal Yes Executed quantity
151 LeavesQty decimal Yes Quantity open for further execution
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 if no quantity executed yet
60 TransactTime datetime Yes Date and time of the transaction

Possible request outcomes include:

  1. The original order was changed and no new order was created

The ExecutionReport for the changed original order is sent.

  1. The original order was cancelled and a new order created

Only ExecutionReport for the new order is sent. OrigClOrdID is omitted.

  1. The original order was cancelled and no new order created

ExecutionReport for the cancelled original order is sent.

Error response

If the order change was rejected due to business related reasons, the server responds with an OrderCancelReject message. If CancelOrigOnReject was specified in the request, ExecutionReport for the cancelled order will also be sent as described above.

MsgType = 9

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderCancelRequest message
434 CxlRejResponseTo char Yes Target of the response. 2 (OrderCancelReplaceRequest) is returned
102 CxlRejReason int Yes Reject reason
58 Text string Conditional Reject text
39 OrdStatus char Yes Order status. 0 (New) is currently returned
41 OrigClOrdID string Yes OrigClOrdID value from OrderCancelRequest message. NONE is returned if not provided
37 OrderID string Yes Server-generated permanent order identifier. NONE is returned if not provided

Possible errors:

CxlRejReason CxlRejReason Name Text Description
1 UNKNOWN_ORDER NO_ORDER_IDS_SPECIFIED Neither OrderID nor OrigClOrdID is specified
1 UNKNOWN_ORDER ORDER_NOT_FOUND Order with given identifiers not found
99 OTHER UNSUPPORTED_ORDER_TYPE Unsupported OrdType
99 OTHER INVALID_ORDER_ID Invalid OrderID
99 OTHER INVALID_CLIENT_ORDER_ID Invalid OrigClOrdID
99 OTHER ACCOUNT_NOT_FOUND User account not found
99 OTHER ACCOUNT_SUSPENDED User account suspended
99 OTHER INVALID_PRICE Invalid Price
99 OTHER INSUFFICIENT_FUNDS User account has insufficient funds
99 OTHER NEGATIVE_OR_ZERO_QUANTITY Negative or zero OrderQty
99 OTHER TOO_LARGE_QUANTITY Too large OrderQty
99 OTHER TOO_SMALL_QUANTITY Too small OrderQty
99 OTHER EXCHANGE_CLOSED Order book for the instrument is closed
99 OTHER UNKNOWN_ERROR Unknown error encountered. Contact support

OrderStatusRequest

Used to request an order status.

MsgType = H

Tag Name Type Required Description
11 ClOrdID string Yes Unique request identifier assigned by client
41 OrigClOrdID string Conditional Client order identifier, see below
37 OrderID string Conditional Server order identifier, see below

The order which status we intend to get can be specified in two ways: by OrderID or by OrigClOrdID. OrderID is a server-generated identifier and can be used across sessions. OrigClOrdID is a client-generated identifier and cannot be used across sessions. Use it only in the same session in which NewOrderSingle (or the OrderCancelReplaceRequest) submitting the order was sent. The OrigClOrdID value must be equal to the ClOrdId value sent in the NewOrderSingle message or in the OrderCancelReplaceRequest message if the order was created as a result of another order change.

If both OrderID and OrigClOrdID are specified, OrderID is used. If neither value is specified, an error is reported.

Success response

The server responds with an ExecutionReport message.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderStatusRequest message
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. I (OrderStatus) is returned
41 OrigClOrdID string No OrigClOrdID value from OrderCancelReplaceRequest message
37 OrderID string Yes Server-generated permanent order identifier
39 OrdStatus char Yes Order current status
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity
14 CumQty decimal Yes Executed quantity
151 LeavesQty decimal Yes Quantity open for further execution
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 if no quantity was executed yet
60 TransactTime datetime Yes Date and time of transaction

Error response

If the status request was rejected due to business related reasons, the server responds with an ExecutionReport message.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId value from OrderStatusRequest message
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. 8 (Rejected) is returned
103 OrdRejReason int Yes Reject reason
58 Text string Conditional Reject text
41 OrigClOrdID string No OrigClOrdID value from OrderCancelReplaceRequest message
37 OrderID string Yes Server-generated permanent order identifier. NONE if it is unknown
39 OrdStatus char Yes Order current status. 8 (Rejected) is returned
54 Side char Yes Order side. B (AsDefined) is returned
55 Symbol string Yes Instrument symbol. NONE is returned
38 OrdQty decimal Yes Total quantity. 0 is returned
14 CumQty decimal Yes Executed quantity. 0 is returned
151 LeavesQty decimal Yes Quantity open for further execution. 0 is returned
6 AvgPx decimal Yes Average execution price. 0 is returned
60 TransactTime datetime Yes Date and time of transaction

Possible errors:

OrdRejReason OrdRejReason Name Text Description
5 UNKNOWN_ORDER NO_ORDER_IDS_SPECIFIED Neither OrderID nor OrigClOrdID specified
5 UNKNOWN_ORDER ORDER_NOT_FOUND Order with given identifiers not found
99 OTHER INVALID_ORDER_ID Invalid OrderID
99 OTHER INVALID_CLIENT_ORDER_ID Invalid OrigClOrdID
99 OTHER ACCOUNT_NOT_FOUND User account not found
99 OTHER UNKNOWN_ERROR Unknown error encountered. Contact support

OrderMassStatusRequest

Used to request statuses of multiple orders that match a given set of criteria.

MsgType = AF

Tag Name Type Required Description
584 MassStatusReqID string Yes Unique request identifier assigned by client
585 MassStatusReqType int Yes Request type, see below
55 Symbol string Conditional Instrument symbol, see below
54 Side char No Order side. Supported values: 1 (Buy), 2 (Sell). See below

Currently the two values of MassStatusReqType are supported: 1 (StatusForOrdersForASecurity) and 7 (StatusForAllOrders). If MassStatusReqType equals 1, Symbol must be specified to get the statuses of all the orders for a given instrument. If MassStatusReqType equals 7, Symbol must not be specified. This request type gets the statuses of all the orders.

Side can be optionally specified for both request types to get statuses of only buy or sell orders.

Success response

The server responds with an ExecutionReport message for every order.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes None is returned
584 MassStatusReqID string Yes MassStatusReqID value from OrderMassStatusRequest
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. I (OrderStatus) is returned
37 OrderID string Yes Server-generated permanent order identifier
39 OrdStatus char Yes Order current status
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity
14 CumQty decimal Yes Executed quantity
151 LeavesQty decimal Yes Quantity open for further execution
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 if no quantity was executed yet
60 TransactTime datetime Yes Date and time of transaction

Error response

If the mass status request was rejected due to business related reasons, the server responds with an ExecutionReport message.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes MassStatusReqID value from OrderMassStatusRequest
584 MassStatusReqID string Yes MassStatusReqID value from OrderMassStatusRequest
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. 8 (Rejected) is returned
103 OrdRejReason int Yes Reject reason
58 Text string Conditional Reject text
37 OrderID string Yes Server-generated permanent order identifier. NONE is returned
39 OrdStatus char Yes Order current status. 8 (Rejected) is returned
54 Side char Yes Side from OrderMassStatusRequest or B (AsDefined) if not specified
55 Symbol string Yes Symbol from OrderMassStatusRequest or NONE if not specified
38 OrdQty decimal Yes Total quantity. 0 is returned
14 CumQty decimal Yes Executed quantity. 0 is returned
151 LeavesQty decimal Yes Quantity open for further execution. 0 is returned
6 AvgPx decimal Yes Average execution price. 0 is returned
60 TransactTime datetime Yes Date and time of the transaction

Possible errors:

OrdRejReason OrdRejReason Name Text Description
11 UNSUPPORTED_ORDER_CHARACTERISTIC UNSUPPORTED_SIDE Unsupported side
15 UNKNOWN_ACCOUNT - User account not found
1 UNKNOWN_SYMBOL - Unknown Symbol
99 OTHER SYMBOL_SPECIFIED Symbol specified for MassStatusReqType == 7 (StatusForAllOrders)
99 OTHER NO_SYMBOL_SPECIFIED Symbol not specified for MassStatusReqType == 1 (StatusForOrdersForASecurity)
99 OTHER INVALID_SYMBOL Invalid Symbol
99 OTHER UNSUPPORTED_MASS_STATUS_REQUEST_TYPE Unsupported MassStatusReqID
99 OTHER UNKNOWN_ERROR Unknown error encountered. Contact support

Fills reporting

The server sends ExecutionReport for every order fill on the exchange.

MsgType = 8

Tag Name Type Required Description
11 ClOrdID string Yes ClOrdId of request that created the order. If request happened in past session NONE is returned
17 ExecID string Yes Unique identifier of execution report
150 ExecType char Yes Order execution type. F (Trade) is returned
37 OrderID string Yes Server-generated permanent order identifier
39 OrdStatus char Yes Order current status
40 OrdType char Yes Order type
54 Side char Yes Order side
55 Symbol string Yes Instrument symbol
38 OrdQty decimal Yes Total quantity
14 CumQty decimal Yes Executed quantity
151 LeavesQty decimal Yes Quantity open for further execution
44 Price decimal Yes Price
6 AvgPx decimal Yes Average execution price. 0 if no quantity executed yet
31 LastPx decimal Yes Last trade price
60 TransactTime datetime Yes Date and time of fill

Market Data

MarketDataRequest

Used to request market data. Market data represents the order book and the trades state and updates.

MsgType = V

Tag Name Type Required Description
262 MDReqID string Yes Unique request identifier assigned by the client
263 SubscriptionRequestType char Yes Request type, see below
264 MarketDepth int No Market depth, see below. 0 is used if not specified
265 MDUpdateType int Conditional Market data update type, see below
266 AggregatedBook boolean No Specifies if order book entries should be aggregated, see below. Supported values: Y, N. Y used if not specified
267 NoMDEntryTypes int Yes Number of subsequent MDEntryType tags
-> 269 MDEntryType char Yes Market data entry type, see below
146 NoRelatedSym int Yes Number of subsequent Symbol tags
-> 55 Symbol string Yes Symbol of instrument to request market data for, see below
100007 TradeCount int No Trade count, see below. 20 used if not specified
100008 TradesSinceTimestamp datetime No Timestamp to get trades since, see below

Request types

SubscriptionRequestType can have 3 values: 0 (Snapshot), 1 (SnapshotPlusUpdates) and 2 (DisablePreviousSnapshotPlusUpdateRequest).

The MDUpdateType is required for this type of request. Two values are supported: 0 (FullRefresh) and 1 (IncrementalRefresh). Specifying 0 will make each update contain full state of market data. Specifying 1 will make each update contain only state changes. 0 (FullRefresh) is not supported for trades.

Order book aggregation

The order book can be aggregated. It means that all the orders on the same price level will be represented by a single order book entry. If the order book is not aggregated, each order will have its own order book entry even if some of them share the same price level. An AggregatedBook tag controls whether the order book should be reported as aggregated. Only the aggregated order books are currently supported.

Market data entry types

MDEntryType specifies which kind of market data should be reported. Supported values: 0 (Bid) - buy side of order book; 1 (Offer) - sell side of order book; 2 (Trade) - trades. Any combination of types can be specified in a request, though duplicates and empty set are not allowed.

Market data instruments

A set of Symbol tags specifies instruments for which market data should be reported. Several instruments can be specified in the request, though duplicates and empty set are not allowed.

Market depth

A MarketDepth value specifies how many top price levels for both sides of the order book to return in a snapshot or full/incremental refresh update messages.

If SubscriptionRequestType equals 0 (Snapshot) MarketDepth can equal any value.

If SubscriptionRequestType equals 1 (SnapshotPlusUpdates) and MDUpdateType equals 0 (FullRefresh) MarketDepth must equal 1, 10 or 20.

If SubscriptionRequestType equals 1 (SnapshotPlusUpdates) and MDUpdateType equals 1 (IncrementalRefresh) MarketDepth must equal 0.

Trades limit

TradeCount or TradesSinceTimestamp can be used to limit the number of trades returned in a snapshot by count or timestamp, accordingly.

Success response

The server sends MarketDataSnapshotFullRefresh messages to a return market data snapshot or to a report market data full refresh update. One message per instrument is sent.

MsgType = W

Tag Name Type Required Description
262 MDReqID string Yes MDReqID value from MarketDataRequest that initiated this message
55 Symbol string Yes Instrument symbol
268 NoMDEntries int Yes Number of entries following
-> 269 MDEntryType char Yes Market data entry type
-> 270 MDEntryPx decimal Yes Market data entry price
-> 271 MDEntrySize decimal Yes Market data entry quantity
-> 272 MDEntryDate date Conditional Market data entry date. Returned for trades only
-> 273 MDEntryTime time Conditional Market data entry time. Returned for trades only

The server sends MarketDataIncrementalRefresh messages to report a market data incremental update.

MsgType = X

Tag Name Type Required Description
262 MDReqID string Yes MDReqID value from MarketDataRequest that initiated this message
268 NoMDEntries int Yes Number of entries following
-> 279 MDUpdateAction char Yes Market data update type. Possible values: 0 (New), 1 (Change), 2 (Delete). Always equals 0 (New) for trades
-> 269 MDEntryType char Yes Market data entry type
-> 58 Symbol string Conditional Instrument symbol, see below
-> 270 MDEntryPx decimal Yes Market data entry price
-> 271 MDEntrySize decimal Conditional Market data entry quantity. Not present if MDUpdateAction equals 2 (Delete)
-> 272 MDEntryDate date Conditional Market data entry date. Returned for trades only
-> 273 MDEntryTime time Conditional Market data entry time. Returned for trades only

The server does not send a Symbol value in each MDEntry group. It sends Symbol in the first group and then omits it for all the following groups. This means that all the groups have the Symbol value from the first group. If some of the subsequent groups need to have another Symbol value, the server sends it in the first group of given subset and then again omits it for all the following groups.

Error response

If a market data request was rejected due to business related reasons, the server responds with a MarketDataRequestReject message.

MsgType = Y

Tag Name Type Required Description
262 MDReqID string Yes MDReqID value from MarketDataRequest
281 MDReqRejReason char Conditional Reject reason
58 Text string Conditional Reject text

Possible errors:

MDReqRejReason MDReqRejReason Name Text Description
6 UNSUPPORTED_MDUPDATETYPE - Unsupported MDUpdateType
4 UNSUPPORTED_SUBSCRIPTIONREQUESTTYPE - Unsupported SubscriptionRequestType
4 UNSUPPORTED_SUBSCRIPTIONREQUESTTYPE UNSUPPORTED_PARAMETERS Unsupported SubscriptionRequestType for given parameters
5 UNSUPPORTED_MARKETDEPTH - Unsupported MarketDepth
7 UNSUPPORTED_AGGREGATEDBOOK - Unsupported AggregatedBook
8 UNSUPPORTED_MDENTRYTYPE - Unsupported MDEntryType
0 UNKNOWN_SYMBOL - Unknown Symbol
1 DUPLICATE_MDREQID - Duplicate MDReqID
- - DUPLICATE_SYMBOL Duplicate Symbol
- - DUPLICATE_ENTRY_TYPE Duplicate MDEntryType
- - UNSUPPORTED_TRADES_COUNT Unsupported TradeCount
- - UNSUPPORTED_TIMESTAMP_FILTER Unsupported TradesSinceTimestamp
- - UNKNOWN_MDREQID Unknown MDReqID

Errors

BusinessMessageReject

The server responds with BusinessMessageReject if an unexpected internal server error occurs during the processing of any type of message from the client.

MsgType = j

Tag Name Type Required Description
372 RefMsgType string Yes MsgType of message that caused the processing error
45 RefSeqNum int Yes MsgSeqNum of message that caused processing error
380 BusinessRejectReason int Yes Reject reason. 4 (ApplicationNotAvailable) is returned