NAV Navbar

Introduction

Welcome to CEX.IO Aggregator trader and developer documentation. This document outline exchange functionality, market details, and APIs.

General

Basic schema

Accounts

When Client deposits or withdraws funds, or places an order, the Main account is used by default. If Client wants to use multiple accounts, they can create sub-accounts.

Sub-accounts is the option the Client can use at their will. Client can specify the sub-account in their trade order, and that instructs Aggregator, which sub- account to use to transfer to/from the money during this order execution. Only one sub-account can be specified for single trade order.

Sub-accounts may be useful for Client if they wish to distinguish orders by certain criteria, for example by Client’s users, trade strategies, portfolios or projects, etc. If Client doesn’t need such option, they can then simply ignore it and use only their main account, without specifying sub-accounts.

When depositing funds to their Aggregator account, Client can omit sub-accounts, for funds to be transferred to his main account in Aggregator. Alternatively, Client can specify a sub-account, to which funds should be transferred. Sub-account ID is a string, the length of which should be more then 0 and less then 256.

Client can transfer funds between his sub-accounts in Aggregator using special web page, API, or making a request to support service. Client can view their sub-accounts and main account balances in Aggregator using special web page, API, or making a request to support service.

Accounts

Deposit and Withdrawal

To be able to trade through Aggregator, Client should prepare their CEX.IO account:

  1. Client registers a user on CEX.IO web site and completes required user verification.
  2. Client provides their CEX.IO user identifier to Aggregator.
  3. Client can fund their CEX.IO account using any available deposit methods (for example, bank transfer, payment card or Bitcoin transfer)
  4. Client can withdraw their funds from CEX.IO account using any available withdrawal method (for example, bank transfer, payment card or Bitcoin transfer).

To manually deposit funds to his Aggregator account, Client should:

  1. Initiate a withdrawal using withdrawal method called “Aggregator” on CEX.IO website. Client should specify the amount and currency to be transferred to his account in Aggregator. Within such withdrawal action, Client can optionally specify, which sub-account should the funds be transferred to. If sub-account is not specified, then funds will be transferred to Client’s main account.
  2. After successful withdrawal, Client’s CEX.IO account balance decreases, while Client’s Aggregator account balance increases by the amount and currency specified by Client. Thereby, Client may be charged a withdrawal commission based on his trading terms.

To manually withdraw funds from his Aggregator account, Client should:

  1. Initiate deposit using deposit method called “Aggregator”. Client should specify the amount and currency to be transferred from his account in Aggregator. Within such deposit action, Client can optionally specify, which sub-account should be used to transfer the funds from. If sub-account is not specified, then funds should be transferred from Client’s main account.
  2. After successful deposit, Client’s CEX.IO account balance increases, while Client’s Aggregator account balance decreases by the amount and currency specified by Client. Thereby, Client may be charged a deposit commission based on his trading terms.

Client can also request to transfer funds between his accounts (between sub-accounts or main account and sub-accounts) using WebSocket API (see “WebSocket” section for details). Aggregator do not charge Client any commission for transferring funds between his accounts.

Deposit and Withdrawal limitations

  1. There may be minimum and maximum amount limits set for each deposit and withdrawal operation. The default limit is 0.01 BTC, 5 USD, or equivalent in other currency.
  2. There may be maximum cumulative amount limit for deposit and withdrawal operations set for a certain period (for example, for a month). Currently, there is no such limit.
  3. Deposit commission is subtracted from deposit amount, which has been requested by Client. For example, if Client requests deposit of 100 USD with 2% deposit fee, then 100 USD should be subtracted from Client’s CEX.IO account and 98 USD should be added to Client’s Aggregator account.
  4. Withdrawal commission is subtracted from withdrawal amount, which has been requested by Client. For example, if Client requests withdrawal of 100 USD with 2% withdrawal fee, then 100 USD should be subtracted from Client’s Aggregator account and 98 USD should be added to Client’s CEX.IO account.
  5. Currently deposits and withdrawals are free.

Trading

This section contains information regarding trading principles, type of orders, order requirements and other details. Such descriptions usually include name of fields from FIX protocol, which are more thoroughly described in FIX API section below.

Order Types

Market — an order that the Client makes through Aggregator to buy or sell Symbol immediately at the best price currently available. The Price(44) field should be missing if the order type is Market. Only one of OrderQty(38) or CashOrderQty(152) fields should be filled.

Limit — an order placed by Client through Aggregator to buy or sell an OrderQty(38) amount of Symbol at a specified price or better. Both OrderQty(38) and Price(44) fields should be filled if the order type is Limit.
Because the limit order is not a market order, it may not be executed if the price set by the Client cannot be met during the period of time, in which the order is left open.
 After being placed, Limit orders can be:

  1. Fully executed immediately
  2. Not executed immediately, and left open to be fully of partially executed, or cancelled (depending on TimeInForce(59) field value)
  3. Partially executed immediately and have open outstanding amount waiting to be fully or partially executed, or cancelled (depending on TimeInForce(59) field value)

Stop — an order to buy or sell an OrderQty(38) amount of Symbol when its market price surpasses a StopPx(99) point, thus ensuring a greater probability of achieving a predetermined entry or exit price, limiting the Client's loss or locking in his profit. Once the price surpasses the predefined StopPx(99) entry/exit point, the stop order becomes a market order. The Price(44) field should be missing if the order type is Stop. 
Such orders are also referred to as a "stop" and/or "stop-loss order.”

Stop Limit — an order to buy or sell an OrderQty(38) amount of Symbol for defined Price(44) price when its market price surpasses a StopPx(99) point. Once the price surpasses the predefined StopPx(99) point, the Stop Limit order becomes a Limit order. The Price(44) field should be present if the order type is Stop Limit.

CashOrdersQty Inaccuracy

CashOrderQty is allowed only in Market orders. If Client sends a Market order and sets CashOrderQty(152) field (it means that Client defines amount in currency2, and amount in currency1 is not defined) some inaccuracy can appear in order amount. Aggregator examines market situation and tries to execute certain amount in currency1 to get as much closer as possible to the amount in currency2 defined by Client, however it is almost not possible to exactly achieve the defined amount in currency2. Aggregator tries to execute order in such a way that is likely to achieve that amount in currency2 to be a little bit less than defined amount in currency2, however it is not guaranteed.

For example, Client requests to “SELL some amount of BTC so that I receive 100 USD”. After execution, the amount in currency1 is 0.2855 BTC and amount in currency2 is 99.93 USD (average execution price is 350).

Leverage and debts

Currently, Aggregator does not provide leverage trading, loans, etc. However Client account balance might appear to be negative in some rare cases, which means Client owes money to Aggregator. If such situation happens, Aggregator can request Client to deposit a certain amount to his account, in order to eliminate negative balance. If the balance is still negative within reasonable amount of time, then Aggregator can undertake any or all of the following forced actions:

  1. Deny Client’s withdrawal requests if any of Client’s accounts balance is negative.
  2. Execute market order on Client’s behalf to eliminate negative balance.
  3. Reject certain Client’s orders that are not intended to eliminate the negative balance.

Order specification

Here are all possible cases when Client needs or doesn’t need to specify each of fields OrderQty(38), CashOrderQty(152), Price(44), StopPx(99) depending on OrdType(40) value.

OrdType(40) OrderQty(38) CashOrderQty(152) Price(44) StopPx(99)
Market(1) Present Missing Missing Missing
Market(1) Missing Present Missing Missing
Limit(2) Present Missing Present Missing
Stop(3) Present Missing Missing Present
Stop Limit(4) Present Missing Present Present

Order TimeInForce

If Client uses TimeInForce(59) field, he instructs Aggregator how long the order should be open after initial placement or execution. TimeInForce(59) is used only for Limit and Stop Limit orders.

  1. Good Till Cancel (GTC)(1) — the order remains open till either full execution or cancellation. GTC orders can be executed partially.
  2. Immediate or Cancel (IOC)(3) — the order may be immediately executed (fully or partially) or not immediately executed. An outstanding amount after immediate execution will be cancelled.
  3. Fill or Kill (FOK)(4) — the order is either immediately fully executed or immediately cancelled. So, FOK orders can not be partially executed: “all or nothing”.
  4. Good Till Date (GTD)(6) — the order remains open till it is either fully executed, or cancelled, or till the time reaches the moment specified in ExpireTime(126). GTD orders can be partially executed.

Order Limitations

There can be various limitations for orders, depending on Symbol, Order Type, Trading Amount etc. However, most of them can be a subject to individual trading terms for each Client. Client can get his order limitations by using get_my_trading_conditions WebSocket API method. The following order limitations are present in the Aggregator system:

  1. Minimum Order Amount in currency1. Applies to orders where amount is specified in currency1.
  2. Maximum Order Amount in currency1. There are two options: 1) pendingPayout that apply for Market and Limit FOK orders 2) other orders (regular (non-FOK) Limit orders)
  3. Order lot size in currency1. Such limitation allows only order amount that is a multiple of lot size. For example, if order lot size is 0.5, then order amounts 1.5, 4, 10.5, are allowed, while amounts 0.3, 1.2, 10.9 are not allowed
  4. Minimum Order Amount in currency2. Applies to orders where amount is specified in currency2. For example for Market order with currency2 specified.
  5. Maximum Order Amount in currency2. Applies to orders where amount is specified in currency2. For example for Market order with currency2 specified.
  6. Order lot size in currency2. Applies to orders where amount is specified in currency2. Such limitation allows only order amount that is a multiple of lot size. For example, if order lot size is 0.5, then order amounts 1.5, 4, 10.5, are allowed, while amounts 0.3, 1.2, 10.9 are not allowed
  7. Order amount precision. This limit describes maximum decimal places the order amount can have
  8. Order price precision. This limit describes maximum decimal places the order price can have. For example for most “cryptocurrency vs. other cryptocurrency” pairs the limit is 6 or 8 decimal places.
  9. Maximum number of open orders Client can have. Currently, there is no such limitation in Aggregator, however it may appear for some Symbols in future.

Order throttling

Aggregator limits the number of Client’s requests per time-unit (for example, per minute). If Client sends more requests per time-unit and exceeds the limit, then all further Client’s requests within this time-unit will be rejected. After exceeding the limit, Client can send new requests in the next time-unit (for example, next minute) and they should be then processed by Aggregator.

Aggregator encourages Client to follow the order throttling rules and to avoid exceeding this limit.

If Client sends less number of orders per time-unit and does not exceed the limit, then Aggregator should not reject the orders because of order throttling rules, however it can still reject orders because of some other reasons (for example, “Not enough liquidity” or “Insufficient funds on Client account”, etc). Not exceeding the limit means that Aggregator will start processing all such orders, but it does not guarantee that all such orders will be completed within this time-unit.

Default request rate limit is 300 requests per minute. This limit might be a subject to individual trading terms, and can be either increased or decreased for each Client. If Client wants to significantly increase this limit (which might require Aggregator to build new servers for it), Aggregator might charge additional costs for such improved service.

Order Commissions

There are two available commission strategies: Fixed commission rate and Floating commission rate. Each Symbol can have its own commission strategy. Commission is calculated in currency2 of the Symbol(55). For example, if Symbol(55) is “BTC/USD”, then currency2 is USD. Exact commission rate value can be different for each Client depending on trading terms, trading amount, etc. Aggregator charges commission only for executed order amount. For example, if the order is placed, not executed and cancelled, Aggregator holds amount X as order commission before placement and returns the whole amount X to Client’s account after the order is cancelled.

Aggregator holds commission amount in currency2 before order placement in case order is “BUY Symbol”, because Aggregator needs to be sure that Client has enough currency2 money to pay for both order and commission. Aggregator does not hold commission before placing the order is case the order is “SELL Symbol”, because Aggregator is sure that there will be enough currency2 to pay the commission after execution of such order.

Commission amount value charged for order is defined in Commission(12) field in Execution Report(8) message if order is in its final status.

Actual commission rate charged from Client might be slightly bigger than defined commission rate for Client because of rounding policy and other technical limitations. For example, Client has 0.3% commission rate specified in trading terms, and there is an executed order for the amount 12.56 USD. Thereby, Aggregator may round the commission amount and charge 0.04 USD commission (0.3% * 12.56 = 0.03768 USD), which is 0.318471% and slightly bigger than defined 0.3% commission rate because of rounding. For bigger order amounts, such deviation is less essential.

Fixed Commission

Client always pays fixed commission rate for executed order amount. This option is easier to understand and to plan the cost of order execution for Client. For example, if order amount is 500 USD and commission rate is 0.25%, then the commission amount is 1.25 USD and it is known before order placement.

Floating Commission

Based on agreement between Aggregator and Client, the Client has “maximum commission rate” value, meaning the maximum percentage from order amount in currency2 that Aggregator can charge for order execution. Aggregator holds maximum order commission amount from Client’s account before the order is placed. Aggregator returns unused commission amount to Client’s account after order finalisation (full execution or cancellation) if the actual commission is lower than the maximum commission held for this order. So the actual commission amount is not known until the order is on final stage, however it should be less or equal to the maximum commission amount.

The bigger “maximum commission rate” Client has, the more options there are to route Client’s order, and thus the more liquidity Client can see and use in his orders. So in average, he can place larger orders, get faster execution, and better prices. He thereby agrees to have possibly higher maximum commission. The less “maximum commission rate” Client has, the less liquidity Client can see and use in his orders, so in average he is able to place smaller orders, get slower execution and worser prices. However, he is guaranteed to have a lower maximum commission. “Maximum commission” means just the upper possible limit that Client agrees to pay for order execution. However, the usually paid commission is much lower than the upper limit.

Order processing

When Client requests to place an order, Aggregator ensures that the Client has enough amount on his account (which is specified in the order) to execute the order and pay order commission. When Client requests to place an order, then Aggregator holds the specified amount from Client’s account including maximum order commission. If the amount to hold cannot be strictly defined, then Aggregator estimates the required amount to execute order and order commission. If there is enough amount on Client’s account, then Aggregator holds this amount and starts order processing. If there is not enough amount on Client’s account, then Aggregator does not hold anything for this order and the order is rejected.

During order processing, once the order is partially or fully executed, then the resulted amount of such execution is added to Client’s account.

If the order is fully executed or cancelled, then Aggregator finalises the order. During order finalisation, Aggregator returns unused commission amount (e.g. when actual commission is lower than maximum commission amount) and outstanding order amount (e.g. when order is cancelled and not fully executed), or unused order amount (e.g. when amount to hold was overestimated) to Client’s account. In some cases of order finalisation, Aggregator can charge additional amount from Client’s account (e.g. when amount to hold was underestimated).

Amount estimation

Amount is estimated only for Market and Stop orders in such cases:

  1. Side = BUY, OrderQty(38) = X. (OrderQty(38) is specified and CashOrderQty(152) is not specified in New Order Single(D)). 
For example, for order “BUY 30 BTC at market price” Aggregator should estimate how many USD to hold from Client’s account to start processing this order. If current average estimated price for such BTC amount is roughly 290 USD per BTC, then Aggregator needs to ensure the Client has at least 8,700 USD (290*30=8,700) on his account to start processing this order. It also will add maximum order commission and risk coefficient (covering the risk of market move): let’s say, the sum is 9,135 USD (8700 + 4%marketRisk + 1%commission). So, Aggregator will try to hold 9,135 USD to start processing this order. If there is not enough USD on specified Client’s account, then Aggregator will reject such order without any hold.
  2. Side = SELL, CashOrderQty(152) = X. (OrderQty(38) is not specified and CashOrderQty(152) is specified in New Order Single(D)).
For example, for order “SELL some BTC so that I receive 30,000 USD” Aggregator should estimate how many BTC to hold from Client’s account to start processing this order. If current average estimated price for such USD amount is 290 USD per BTC, then Aggregator needs to ensure the Client has at least 104 BTC (~30,000/290=104) on his account to start processing this order. It will also add risk coefficient (covering the risk of market move): let’s say, the sum is 109 BTC (104 + 4%marketRisk + 1%commission) for order amount. So, Aggregator will try to hold 109 BTC to start processing the order. If there is not enough BTC money on specified Client’s account, then Aggregator will reject such order without any hold.

For all other order types (all Limit orders, all Stop Limit orders, some Market orders and some Stop orders), amount is not estimated, and Aggregator uses requested order amounts without any marketRisk coefficient etc.

API

Client interacts with Aggregator through API (Application Programming Interface). There are three available API channels which can be used by Client:

  1. FIX (Financial Information eXchange) — this API should be used for trading and receiving market data.
  2. WS (WebSocket) — this API should be used for trading and receiving information about Client’s accounts balances.
  3. REST — this API should be used for trading and receiving information about Client’s accounts balances.

Before initial connection, Client should provide certain information, after which Aggregator will reach out with information on how to set up Client’s connection. Client can also get access to DEV/UAT Aggregator environments before connecting to PROD, in order to smooth the integration process.

We published public client library to communicate with Aggregator via REST and WS. You can use it if you have NodeJS or just check realization and adopt to your programming language. Check it here https://github.com/aggregator-cexio/node-client

Client should provide the following information to Aggregator:

  1. Aggregator needs to know the IP address or network range, from which Client will be connecting for whitelisting in Aggregator’s firewall.
  2. If Client wishes to provide their SSL certificate, Aggregator will check Client’s certificate on each FIX and/or WS connection and accept only valid connections. This option adds additional authentication step, which dramatically decreases risk of unauthorised access. However, this option is disabled by default, because security level is high enough even without it.

Aggregator should provide the following information about connection settings to the Client:

  1. Aggregator CompId
  2. Client CompIds (there can be a few sessions per Client, and therefore a few Client’s CompId which can be used by Client)
  3. Client’s username and password that should be used in Username(553) and Password(554) fields in Logon(A) message in FIX API
  4. Client’s apiKey and apiSecret that should be used in WS API
  5. Aggregator host name or IP address, TCP port number and URL, where Client should connect to, for both FIX and WS API
  6. Aggregator SSL certificate. Client should add this certificate to their trust store or set “Trust all certificates” option in their software to be able to connect.
  7. If Client wishes to connect to Aggregator through VPN, Aggregator should provide VPN connection settings and instruction one how to setup VPN connection on Client’s side. This connection option is optional and is disabled by default.

Maintenance period

Aggregator regularly performs maintenance works. Usually it happens once a week or once a month and usually takes less then an hour. Aggregator should inform Client in advance about maintenance schedule. During this period:

  1. Aggregator cancels all active Client’s orders.
  2. Aggregator does not accept new Client’s orders.
  3. Aggregator can drop both FIX and WS connections. After maintenance period is over, Client should reconnect.
  4. Aggregator resets sequence numbers in all FIX sessions.

Working hours

Aggregator works 24/7 with no holidays. The only cases, when Aggregator might be not available, are:

  1. IT system failures. Aggregator team does its best to achieve 100% availability, however sometimes failures happen because of various reasons. Aggregator team will resolve such problems as soon as possible, but services might be unavailable for Clients during this period.
  2. Scheduled maintenance period.

REST

The REST API has endpoints for account and order management. All requests must be sent to specified URL with POST method. Request parameters must be sent as JSON stringified object in request body.

Response Codes

HTTP Code Description
200: OK Request is correct. The body of the response will include the requested data.
400: Bad Request There was an error with the request. The action you requested may not be exists.
401: Unauthorized Token is invalid. If your API key is wrong a 401 will also be served, so check the response body, it might be that the API_KEY is invalid. Also This code will be returned if signature is incorrect, so double check your signing algorythm.
422: Unprocessable Entity There was an error with the request. The body of the response will have more info. Some possible reasons: Missing params or The format of data is wrong.
429: Too Many Requests This status indicates that the user has sent too many requests in a given amount of time
500: Service Unavailable This status indicates that something wrong on server side, additional info will be provided in response. If this status returned too often please contact to your manager to clarify or fix the problem.

Authentication

const crypto = require('crypto')
const request = require('request')

const action = 'get_my_trading_conditions'
const params = { pairs: ['BTC-USD'] }

const apiKey = 'base64_string_key'
const apiSecret = 'base64_string_secret'

const timestamp = parseInt(Date.now() / 1000)
const payload = action + timestamp + JSON.stringify(params)
const signature = crypto.createHmac('sha256', apiSecret).update(payload).digest('base64')

const headers = {
  'X-AGGR-KEY': apiKey,
  'X-AGGR-TIMESTAMP': timestamp,
  'X-AGGR-SIGNATURE': signature,
  'Content-Type': 'application/json'
}

request({
  url: `https://rest-aggregator-url/${action}`,
  method: 'POST',
  headers: headers,
  json: true,
  body: params
}, (error, response, body) => {
  console.log('statusCode:', response && response.statusCode)
  console.log('body:', body)
})

Aggregator uses API keys to allow access to private APIs. You can obtain these by asking your manager.

All REST requests must contain the following headers:

Header name Desriprion
X-AGGR-KEY The api key as a string.
X-AGGR-TIMESTAMP A unix timestamp for your request.
X-AGGR-SIGNATURE The base64-encoded signature (see Signing a Request).
Content-Type All request bodies should have content type application/json and be valid JSON.

Signing a Request

The X-AGGR-SIGNATURE header is generated by creating a HMAC-SHA256 using the base64-decoded secret key on the payload. Payload consist from string action + timestamp + body (where + represents string concatenation) and base64-encode the output.

The action is same as api endpoint with underscores, e.g. get_my_orders.

The timestamp value is the same as the X-AGGR-TIMESTAMP header.

The body is the request body string (in all cases this is JSON stringified request params object).

Trading Conditions

Using this request, Client can find out his actual settings for each trading pair.

HTTP REQUEST

POST /get_my_trading_conditions

Request Parameters

Successful Get My Trading Conditions Request

Request (client sends a request to find out their trading settings for pairs “BTC-USD”)

{
    "pairs": ["BTC-USD"]
}

Response (Aggregator successfully responds to the request)

{
  "ok": "ok",
  "data": {
    "BTC-USD":{
      "fee": {
        "type": "percent",
        "maxPercent": "0.5", // 0.5% fixed strategy commission with commission amount calculated in USD
        "currency": "USD"
      },
      "tickSize": 0.1, // tick size is 0.1 USD
      "minOrderAmountCcy1": "0.00200000", // Min Order Amount in currency1 is 0.002 BTC
      "minOrderAmountCcy2": "2.50000000", // Min Order Amount in currency2 is 2.5 USD
      "lotSizeCcy1": "0.00000001", // lot size in currency1 is 1 satoshi
      "lotSizeCcy2": "0.01000000", // lot size in currency2 is 1 cent
      "maxOrderAmountCcy1": {
        "default": "100.00000000", // Max Order Amount in currency1 for orders other than Market and FOK is 100 BTC
        "pendingPayout": "10.00000000" // Max Order Amount in currency1 for Market and FOK orders is 10 BTC
      },
      "maxOrderAmountCcy2": {
        "default": "50000.00000000", // Max Order Amount in currency2 for orders other than Market and FOK is 50000 USD
        "pendingPayout": "5000.00000000" // Max Order Amount in currency2 for Market and FOK orders is 5000 USD
      }
    }
  }
}

Successful Get My Trading Conditions Request With Empty List of pairs

Request (client sends valid request but provides empty list of currency pairs)

{
    "pairs": []
}

Response (Aggregator responds with trading conditions for all pairs that Client supports. In current case Client supports only BTC-USD and BTC-EUR pairs. Reply contains trading conditions for both "BTC-USD" and "BTC-EUR" pairs)

{
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "fee": {
        "type": "percent",
        "maxPercent": "0.5",
        "currency": "USD"
      },
      "tickSize": 0.1,
      "minOrderAmountCcy1": "0.00200000",
      "minOrderAmountCcy2": "2.50000000",
      "lotSizeCcy1": "0.00000001",
      "lotSizeCcy2": "0.01000000",
      "maxOrderAmountCcy1": {
        "default": "100.00000000",
        "pendingPayout": "10.00000000"
      },
      "maxOrderAmountCcy2": {
        "default": "50000.00000000",
        "pendingPayout": "5000.00000000"
      }
    },
    "BTC-EUR": {
      "fee": {
        "type": "percent",
        "maxPercent": "0.5",
        "currency": "USD"
      },
      "tickSize": 0.1,
      "minOrderAmountCcy1": "0.00200000",
      "minOrderAmountCcy2": "2.50000000",
      "lotSizeCcy1": "0.00000001",
      "lotSizeCcy2": "0.01000000",
      "maxOrderAmountCcy1": {
        "default": "100.00000000",
        "pendingPayout": "10.00000000"
      },
      "maxOrderAmountCcy2": {
        "default": "50000.00000000",
        "pendingPayout": "5000.00000000"
      }
    }
  }
}

Unsuccessful Get My Trading Conditions Request

Request (client sends request to find out their trading settings, however the mandatory field “pairs” is missing)

{}

Response (Aggregator responds that such request is not valid)

{
    "error": "Bad Request"
}
Field Name Mandatory Format Description
pairs Yes Array List of pairs, for which Client wants to find out their trade fee settings. Each pair should contain two currencies in upper case divided by “-“ symbol. Each pair should be listed in traditional direction. For example “BTC-USD”, but not “USD-BTC”. If pairs array is empty - should return Trading Conditions for all supported pairs

Response Content

Field Name Mandatory Format Description
data Yes Object This field holds an Object which consists of keys for each requested pair. Values of each key showsClient’s trade fee settings for each trade pair
fee.type Yes String Describes the type of the commission strategy. “percent” means that commission is calculated as a percentage of executed trade amount. Only "percent" value is supported now
fee.maxPercent Yes Float Describes percentage that should be applied to the executed trade amount to calculate the maximum commission amount.For example, if executed trade amount is 6,500 and maxPercent is 0.5, then maximum commission amount is 32.5
fee.currency Yes String Shows, in which currency the trade commission is calculated
fee. fixedClientCommission No Boolean If this field is present and if its value is true, it means that Client has Fixed Commission strategy for this trade pair. If this field is missing or it its value is false, it means that Client has Floating Commission strategy for this trade pair (see “Order Commissions” section for details)
tickSize Yes Float “tickSize” describes the smallest change in price. For example, if tickSize is 0.01 then it means price has 2 decimal places
minOrderAmountCcy1 Yes Float Minimum Order Amount in currency1
minOrderAmountCcy2 Yes Float Minimum Order Amount in currency2
lotSizeCcy1 Yes Float Order lot size in currency1. Such limitation allows only order amount that is a multiple of lot size. For example, if order lot size is 0.5, then order amounts 1.5, 4, 10.5, are allowed, while amounts 0.3, 1.2, 10.9 are not allowed
lotSizeCcy2 Yes Float Order lot size in currency2. Such limitation allows only order amount that is a multiple of lot size. For example, if order lot size is 0.5, then order amounts 1.5, 4, 10.5, are allowed, while amounts 0.3, 1.2, 10.9 are not allowed
maxOrderAmountCcy1. default Yes Float Maximum Order Amount in currency1. default option apply to all orders other than Market and Limit FOK
maxOrderAmountCcy1. pendingPayout Yes Float Maximum Order Amount in currency1. pendingPayout option apply to Market and Limit FOK orders
maxOrderAmountCcy2. default Yes Float Maximum Order Amount in currency2. default option apply to all orders other than Market and Limit FOK
maxOrderAmountCcy2. pendingPayout Yes Float Maximum Order Amount in currency2. pendingPayout option apply to Market and Limit FOK orders
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful

Account Status

Using this request, Client can find out available balances on their accounts. Also Client might have amounts which are locked for open orders, which is not displayed in balance field, it is displayed in balanceOnHold field. Available trading balance is also displayed in the response. It is calculated as available balance plus overdraft limit which is allowed for the client.

HTTP REQUEST

POST /get_my_account_status

Request Parameters

Get My Account Status for All Accounts for All Currencies

Request (client sends request to find out his accounts’ statuses for all his accounts for all currencies)

{
      "accountIds": []
}

Response (Aggregator responds that Client has main account with currencies "USD", "EUR" and "BTC" and sub-account "hallo" with currencies "USD" and "BTC". Also, it contains balance for each account and timestamp of when account was modified last time)

{
  "ok": "ok",
  "data": {
    "": {
      "USD": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "201.86549600",
        "updatedAt": 1456839391786,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1201.86549600"
      },
      "EUR": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "EUR",
        "balanceOnHold": "0.00000000",
        "balance": "1400.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "2400.00000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "BTC",
        "balanceOnHold": "5.00000000",
        "balance": "720.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1720.00000000"
      }
    },
    "hallo": {
      "USD": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "USD",
        "balanceOnHold": "500.00000000",
        "balance": "1.80000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1001.80000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "20.00000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1020.00000000"
      }
    }
  }
}

Get My Account Status for Selected Sub-accounts for All Currencies

Request (client sends a request to find out his accounts’ statuses for specified accounts for all currencies)

{
    "accountIds": ["hallo", "superhat"]
}

Response (Aggregator responds that Client has sub-account "hallo" with currencies "USD" and "BTC". Sub-account "superhat" status was requested but it is not included into response, because Client doesn’t have "superhat" sub-account. The main account is not included, because it was not requested)

{
  "ok": "ok",
  "data": {
    "hallo": {
      "USD": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "1.80000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1001.80000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "20.00000000",
        "updatedAt":1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1020.00000000"
      }
    }
  }
}

Get My Account Status for All Accounts for Selected Currencies

Request (client sends request to find out their accounts’ statuses for all accounts for selected currencies)

{
    "currencies":["USD","BTC"]
}

Response (Aggregator responds that Client has main account and sub-account "hallo", each with currencies "USD" and "BTC". Note that other currencies (like "EUR", "ETH") are not included into response, because it was not requested)

{
  "ok": "ok",
  "data": {
    "": {
      "USD": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "201.86549600",
        "updatedAt": 1456839391786,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1201.86549600"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "720.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1720.00000000"
      }
    },
    "hallo": {
      "USD": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "1.80000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1001.80000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "20.00000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1020.00000000"
      }
    }
  }
}

Get My Account Status for All Accounts for One Selected Currency

Request (client sends request to find out their accounts’ statuses for all accounts for EUR currency)

{
    "currencies": ["EUR"]
}

Response (Aggregator responds that only the main account is with currency "EUR". Note that other currencies (like "BTC", "USD") and other sub-accounts (like "superhat") are not included into response, because it was not requested)

{
  "ok": "ok",
  "data": {
    "": {
      "EUR": {
          "clientId": "BitFok",
          "type": "Main",
          "accountId": "",
          "currency": "EUR",
          "balanceOnHold": "10.00000000",
          "balance": "1400.00000000",
          "updatedAt": 1465300456900,
          "overdraftLimit": "1000.00000000",
          "availableTradingBalance": "2400.00000000"
      }
    }
  }
}

Get My Account Status - No Account Matching Criteria

Request (client sends request to find out his accounts’ statuses for specified sub-accounts only for EUR currency)

{
    "currencies": ["EUR"],
    "accountIds": ["hallo", "superhat"]
}

Response (Aggregator responds that Client has no accounts which satisfy request criteria)

{
  "ok": "ok",
  "data": {}
}

Get My Account Status for Single Account for Single Currency

Request (client sends request to find out the main account status for BTC currency)

{
    "currencies": ["BTC"],
    "accountIds": [""]
}

Response (Aggregator responds that Client has main account and includes its BTC balance. No other accounts are included, and no other currencies are included, because is was not requested)

{
  "ok": "ok",
  "data": {
    "": {
      "BTC": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "720.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1720.00000000"
      }
    }
  }
}

Get My Account Status - Incorrect Request

Request (client sends request, however there is missing "currencies" or "accountIds" field)

{}

Response (Aggregator responds to Client that error happened when processing his request)

{
    "error": "Bad Request"
}
Field Name Mandatory Format Description
currencies No Array List of currencies for which Client wants to find out their accounts balances. Currencies should be in upper case. Each currency should be present only once in this array. For example, ["USD", "BTC", "EUR", "BTC"] is not allowed. If this field is missing or contains empty array ([]), then it means Client wants to find out their balances for all currencies they have
accountIds No Array List of account identifiers for which Client wants to find out their accounts balances. Empty string ("") value in this array represents Client’s main account. Each account identifier should be present only once in this array. For example, ["hallo", "", "superhat", "hallo"] is not allowed. If this field is missing or if it contains empty array ([]), then it means Client wants to find out their balances for all accounts. At least one parameter "currencies" or "accountIds" must be specified in the request.

Response Content

Field Name Mandatory Format Description
data Yes Object This object contains response details. It might be empty object("{}"), but this field should be present anyway and it should contain an object. If this Object is empty, then it means Client has no accounts which satisfy Client’s request criteria
data.X No Object Represents an object which describes X account statuses for each currency. If X is ""(empty string), that means X is main account. Otherwise, it represents X sub-account
data.X.YYY No Object Represents an object which describes X account statuses for YYY currency
data.X.YYY.clientId Yes String Client Comp ID
data.X.YYY.type Yes String Describes the type of this account, either main or sub-account. Only Main or SubAccount values are allowed
data.X.YYY.accountId Yes String Describes Client’s account identifier. If value is "" (empty string), then it represents the main account. Otherwise, that represents sub-account identifier
data.X.YYY.currency Yes String Currency of this account
data.X.YYY.balance Yes String (which can be parsed as Float) Current account available balance. It does not include balance which is reserved for active orders (please find this information in "balanceOnHold" field)
data.X.YYY. balanceOnHold Yes String (which can be parsed as Float) Current balance which is reserved for active orders
data.X.YYY.updatedAt Yes Number UTC timestamp in milliseconds. Represents a moment in time when this account balance was modified last time
data.X.YYY. overdraftLimit Yes String (which can be parsed as Float) Overdraft limit which is allowed for the client
data.X.YYY. availableTradingBalance Yes String (which can be parsed as Float) Current balance which is available for trading. It is calculated as current account balance plus overdraft limit
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only ok value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful

Orders

This request allows Client to find out info about their orders.

HTTP REQUEST

POST /get_my_orders

Request Parameters

Get My Orders - All Open Orders

Request (client sends request to find all their open orders for all pairs and all accounts; setting no criteria for orders means that Client wants to get statuses for all their open orders)

{}

Response (Aggregator responds that Client has 3 open orders)

{
  "ok": "ok",
  "data": [
    {
      "orderId": "26", // Market BUY 0.01 BTC/USD with main account
      "clientOrderId": "1465300456557-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "USD",
      "side": "BUY",
      "orderType": "Market",
      "timeInForce": null,
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.01000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "USD",
      "price": null,
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": null,
      "initialOnHoldAmountCcy2": "21.00000000",
      "expireTime": null,
      "effectiveTime": null
    },
    {
      "orderId": "20", // Limit BUY 0.1 BTC/USD at price 400 with "hallo" sub-account
      "clientOrderId": "1465299989578-0",
      "clientId": "BitFok",
      "accountId": "hallo",
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "USD",
      "side": "BUY",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.10000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "USD",
      "price": "400.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": null,
      "initialOnHoldAmountCcy2": "21.00000000",
      "expireTime": null,
      "effectiveTime": null
    },
    {
      "orderId": "18", // Limit SELL 0.02 BTC/EUR at price 600 with main account
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - All Open Orders with Paging

Request (client sends request to find all their open orders and wants to see the second page expecting the result set is chunked to pages size 2 (not more than 2 orders per page)

{
    "pageSize": 2,
    "pageNumber": 1
}

Response (supposed that Client has 3 open orders (like in previous example), Aggregator responds with second page, which includes only the last single order)

{
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - All Open Orders for Selected Pair

Request (client sends request to find all their open orders for "BTC-EUR" pair)

{
    "pair": "BTC-EUR"
}

Response (Aggregator responds that Client has 1 open order for BTC-EUR pair)

{
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - All Open Orders for Account and Pair

Request (client sends request to find all their open orders for currency pair "BTC-USD" and for sub-accounts "hallo" or "superhat")

{
    "accountIds": ["hallo", "superhat"],
    "pair": "BTC-USD"
}

Response (Aggregator responds that Client has only one open order that satisfies request criteria, this order is on "hallo" sub-account)

{
  "ok": "ok",
  "data": [
    {
      "orderId": "20",
      "clientOrderId": "1465299989578-0",
      "clientId": "BitFok",
      "accountId": "hallo",
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "USD",
      "side": "BUY",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.10000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "USD",
      "price": "400.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - Accounts, Paging, Period, Empty Result

Request (client wants to see not more than 50 open orders from main account which were created between 2016-06-06T16:11:29 and 2016-06-07T08:53:09)

{
    "accountIds": [""],
    "pageSize": 50,
    "clientCreateTimestampFrom": 1465229489578,
    "clientCreateTimestampTo": 1465289589579
}

Response (Aggregator responds that Client has no open orders, which satisfy request criteria)

{
  "ok": "ok",
  "data": []
}

Get My Orders - All Archived Orders for Selected Side

Request (client sends request to find all their archived orders)

{
    "archived": true,
    "side": "SELL"
}

Response (supposed that Client has 3 archived orders (like in previous example), Aggregator responds to Client that they have 1 archived order which satisfies request criteria)

{
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "REJECTED",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": 403,
      "rejectReason": "Insufficient funds",
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": true,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Order - Incorrect Request

Request (client made a request, but did not specify data object)

{}

Response (Aggregator responds that error occurred. Note: "data" field hold and object value here, not the array)

{
    "error": "Bad Request"
}

Get My Order - Page Size is Too Big

Request (client made a request to get all archived orders and wishes to get first 5,000 orders list as a response to this request)

{
    "archived": true,
    "pageSize": 5000
}

Response (Aggregator responds that such request is not allowed. Requested page size is too big, maximum allowed value is 100)

{
    "error": "Page size is limited to 100 items"
}

Get My Order - Incorrect Archived Type

Request (client made a request to get his open orders, however "archived" field value is number)

{
    "archived": 0
}

Response (Aggregator responds that such request is not allowed. Field "archived" should be either true, or false, or it should be missing)

{
    "error": "Archived parameter should be boolean"
}

Get My Orders - Single Order by OrderId

Request (client sends request to find their single order by orderId)

{
    "orderId": 18
}

Response (Aggregator responds with status of this order)

{
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "REJECTED",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": 403,
      "rejectReason": "Insufficient funds",
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": true,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - Single Order by clientOrderId

Request (client sends request to find their single order by clientOrderId)

{
    "clientOrderId": "1465299852968-0"
}

Response (Aggregator responds with status of this order)

{
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "REJECTED",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": 403,
      "rejectReason": "Insufficient funds",
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": true,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}
Field Name Mandatory Format Description
clientOrderId No String Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API). If this field is present, then it means Client wants to see the status of the exact order. In this case, Aggregator ignores all other parameters in "data" field.
orderId No Number Order identifier assigned by Aggregator (OrderID(37) field in Execution Report(8) message in FIX API). If both fields "orderId" and "clientOrderId" are present, then Aggregator ignores "orderId" field. If this field is present (and "clientOrderId" is not present), then it means Client wants to see the status of the exact order. In this case, Aggregator ignores all other parameters in "data" field.
archived No Boolean If value is true, then it means Client wants to get his completed (archived) orders. "Completed" means that order is in one of its final statuses. If value is false or if this field is missing, it means Client wants to get his open orders. Value should be in boolean type. So values like null, 0, 1, "true", "hallo" and similar are not allowed.
pair No String Currency pair, for which Client wants to find their orders. Pair should contain two currencies in upper case divided by "-" symbol. Pair should be listed in traditional direction. For example, "BTC-USD", but not "USD-BTC". If this field is missing, or if it contains empty string (""), or null, then it means Client wants to find their orders for all pairs.
side No String Side of the orders (corresponds to field Side(54) in Execution Report(8) and in New Order Single (D) messages in FIX API), for which Client wants to find their orders.
accountIds No Array List of account identifiers, for which Client wants to find their orders. Empty string ("") or null value in this array represents Client’s main account. Each account identifier should be present only once in this array. For example, ["hallo", "", "superhat", "hallo"] is not allowed. If this field is missing or if it contains an empty array ([]), then it means Client wants to find their orders for all accounts.
clientCreate TimestampFrom No Number UTC timestamp in milliseconds. Represents the earliest moment in time when orders are created. In the result set orders’ clientCreateTimestamp should be greater then or equal to (>=) clientCreateTimestampFrom. Order creation time in this context is a timestamp provided by Client during creation of the order (field TransactTime(60) in New Order Single(D) message from Client in FIX API)
clientCreate TimestampTo No Number UTC timestamp in milliseconds. Represents the latest moment in time when orders are created. In the result set orders’ clientCreateTimestamp should be less then (<) clientCreateTimestampTo. Order creation time in this context is a timestamp provided by Client during creation of the order (field TransactTime(60) in New Order Single(D) message from Client in FIX API)
sortBy No String String that represents the field to sort the resulting array by. Supported values are - "lastUpdateTimestamp", "clientCreateTimestamp", "serverCreateTimestamp". If "sortBy" parameter is not specified then resulting array will be sorted by lastUpdateTimestamp.
sortOrder No String Sort order of the result set. The result array is sorted by field that is specified in "sortBy" parameter. "ASC" - ascending order, "DESC" - descending order. If "sortBy" parameter is not specified by client resulting array will be sorted by lastUpdateTimestamp. If this field is missing then the default sort order is "DESC", so recently created orders come first and the oldest order comes last.
pageSize No Number Because the result might contain too many orders, Client should specify which portion of the result list they want to get as a response to this request. This parameter limits the maximum number of orders in the result for this request. If this field is missing, then the default value of 100 is used. This value cannot be greater than 100.
pageNumber No Number Because the result might contain too many orders, Client should specify which portion of the result list they want to get as a response to this request. Result list is chunked into pages for not more than data.pageSize orders per each page. This parameter specifies, which page number of the result set Client wants to see as the response to this request. First page number is 0. If this field is missing, then the default value of 0 is used. This value cannot be lower then 0.

Response Content

Field Name Mandatory Format Description
data Yes Array or Object This object contains list of orders which satisfy request criteria. It might be empty array([]). If this array is empty, then it means Client has no orders, which satisfy Client’s request criteria. The result array is sorted by "clientOrderCreationTimestamp" field with specified order. In case of error, the value of this filed should be not Array, but Object.
orderId Yes String Order identifier assigned by Aggregator (OrderID(37) field in Execution Report(8) message in FIX API)
clientOrderId Yes String Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API)
clientId Yes String Client Comp id
accountId Yes String Represents Client’s account id, which was used for order processing (field Account(1) in Execution Report(8) and in New Order Single (D) messages in FIX API). If this value is null, then it means Client’s main account. Otherwise, it means identifier of Client’s sub-account.
status Yes String Represents current execution status of this order (corresponds to field OrdStatus(39) field in Execution Report(8) message in FIX API).
statusIsFinal Yes Boolean Represents whether this order is in the final state or not
currency1 Yes String Represents first currency in currency pair of this order
currency2 Yes String Represents second currency in currency pair of this order
side Yes String Represents side of this order (corresponds to field Side(54) in Execution Report(8) and in New Order Single (D) messages in FIX API)
orderType Yes String Represents order type of this order (corresponds to field OrdType(40) in Execution Report(8) and in New Order Single (D) messages in FIX API).
timeInForce Yes String Represents time in force of this order (corresponds to field TimeInForce(59) in Execution Report(8) and in New Order Single (D) messages in FIX API). For details see "Order TimeInForce" section. This value can be null for orders where time in force is not applied, for example, for Market order.
comment Yes String Text, which was provided by Client during order creation (in field Text(58) in New Order Single(D) in FIX API). If value is null, then it means Client did not provide such text during order creation.
rejectCode Yes Number Error code if the order is rejected. If value is null, that means there is no error code.
rejectReason Yes String Human readable error description if the order is rejected. If value is null, that means there is no error description.
executedAmountCcy1 Yes String (which can be parsed as Float) Represents executed amount in currency1. If this value is null, then it means there is no executed amount (order has no executions).
executedAmountCcy2 Yes String (which can be parsed as Float) Represents executed amount in currency2. If this value is null, then it means there is no executed amount (order has no executions).
requestedAmountCcy1 Yes String (which can be parsed as Float) Represents order amount in currency1, which was requested by Client (corresponds to OrderQty(38) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested amount in currency1 (order should have then requested amount in currency1)
requestedAmountCcy2 Yes String (which can be parsed as Float) Represents order amount in currency2, which was requested by Client (corresponds to CashOrderQty(152) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested amount in currency2 (order should have then requested amount in currency2).
initialOnHoldAmountCcy1 Yes String (which can be parsed as Float) Represents amount in currency1 which was hold from Client balance by aggregator before order execution. If this value is null, then it means that amount in currency1 was not hold from Clients account for this order
initialOnHoldAmountCcy2 Yes String (which can be parsed as Float) Represents amount in currency2 which was hold from Client balance by aggregator before order execution. If this value is null, then it means that amount in currency2 was not hold from Clients account for this order
feeAmount Yes String (which can be parsed as Float) Represents order commission, which was charged for this order (corresponds to Commission(12) field in Execution Report(8) message in FIX API). If this value is null, then it means there is no commission amount charged for this order.
feeCurrency Yes String Represents order commission currency (corresponds to CommCurrency(479) field in Execution Report(8) message in FIX API)
price Yes String (which can be parsed as Float) Represents order price, which was provided by Client during order creation (corresponds to Price(44) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested price for this order. It happens for order where price cannot be requested, for example, Market orders or Stop orders.
averagePrice Yes String (which can be parsed as Float) Represents average order execution price (corresponds to AvgPx(6) field in Execution Report(8) message in FIX API). If this value is null, then it means there is no executed amount (order has no executions).
clientCreateTimestamp Yes Number UTC timestamp in milliseconds. Represents a timestamp provided by Client during creation of the order (field TransactTime(60) in New Order Single(D) message in FIX API)
serverCreateTimestamp Yes Number UTC timestamp in milliseconds. Represents server timestamp when order is received.
lastUpdateTimestamp Yes Number UTC timestamp in milliseconds. Represents server timestamp when order changed its state last time.
expireTime Yes Number UTC timestamp in milliseconds. Represents an expired timestamp provided by Client during creation of the order (field ExpireTime(126) in New Order Single(D) message in FIX API). If this value is null, then it means Client did not provide expire time during order creation.
effectiveTime Yes Number UTC timestamp in milliseconds. Represents an effective timestamp provided by Client during creation of the order (field EffectiveTime(168) in New Order Single(D) message in FIX API). If this value is null, then it means that Client did not provide effective time during order creation.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

New Order

Client can place orders via WebSocket API.

HTTP REQUEST

POST /do_my_new_order

Request Parameters

Do My New Order - place limit sell order

Request (client requests to place a limit order to sell 0.01 BTC for USD at price 7500)

{
    "clientOrderId": "1521711134775",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "timestamp": 1521711134775,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "amountCcy1": "0.01",
    "price": 7500,
    "comment": "v_overdraft_test"
}

Response (Aggregator sends acknowledgement message confirming that the order is placed)

{
  "ok": "ok",
  "data": {}
}

Do My New Order - place limit buy order

Request (client requests to place a limit order to sell 0.01 BTC for USD at price 18500)

{
    "clientOrderId": "1521713494191",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "BUY",
    "timestamp": 1521713494191,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "amountCcy1": "0.01",
    "price": 18500,
    "destination": "cex-dev_CEX",
    "comment": "v_overdraft_test"
}

Response (Aggregator sends acknowledgement message confirming that the order is placed)

{
  "ok": "ok",
  "data": {}
}

Do My New Order - Invalid request

Request (client requests to place a limit order with missing price field)

{
    "clientOrderId": "1521736196695",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "BUY",
    "timestamp": 1521736196695,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "amountCcy1": "0.001",
    "destination": "cex-dev_CEX",
    "comment": "v_overdraft_test"
}

Response (Aggregator sends response that has no field "ok" and has "error" field containing error description)

{
    "error": "Mandatory parameter price is missing"
}
Field Name Mandatory Format Description
clientOrderId No String Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API). If this field is absent, it will be set automatically to current timestamp in milliseconds.
accountId No String Client’s sub-account ID. If the value is empty string, then the order is created by Client’s main account.
currency1 Yes String Represents first currency in currency pair of this order
currency2 Yes String Represents second currency in currency pair of this order
side Yes String Represents side of this order (corresponds to field Side(54) in Execution Report(8) and in New Order Single (D) messages in FIX API)
orderType Yes String Represents order type of this order (corresponds to field OrdType(40) in Execution Report(8) and in New Order Single (D) messages in FIX API).
timestamp Yes String UTC timestamp in milliseconds, represents client-side order creation time(field TransactTime(60) in New Order Single(D) message in FIX API). Timestamp should be within 30000 ms timeframe with server time, otherwise, order will be rejected. This value could also be referred as clientCreateTimestamp in other messages, e.g. in response to Orders request ("get_my_orders" message response).
timeInForce No String Represents time in force of this order (corresponds to field TimeInForce(59) in Execution Report(8) and in New Order Single (D) messages in FIX API. For details see "Order TimeInForce" section. This value can be null for orders where time in force is not applied, for example, for Market order.
comment No String Comment for order (field Text(58) in New Order Single(D) in FIX API). Maximum length of comment string is 255 characters. If value is null, then it means Client did not provide such text during order creation.
amountCcy1 No String (parseable as Float) Represents order amount in currency1 (corresponds to OrderQty(38) field in New Order Single(D) message in FIX API). This value can be null if order requests amount in currency2
amountCcy2 No String (parseable as Float) Represents order amount in currency1 (corresponds to OrderQty(152) field in New Order Single(D) message in FIX API). This value can be null if order requests amount in currency1
price Yes String (parseable as Float) Represents order price (corresponds to Price(44) field in New Order Single(D) message in FIX API). This value can be null for order where price cannot be requested, for example, Market orders or Stop orders.
expireTime Yes Number UTC timestamp in milliseconds (field ExpireTime(126) in New Order Single(D) message in FIX API). If Expire Time is in the past, order will be rejected.
stopPrice No String (parseable as Float) Stop Price for Market and Stop and StopLimit orders types (StopPx in FIX)

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Cancel Order

Client can cancel orders.

HTTP REQUEST

POST /do_cancel_my_order

Request Parameters

Do Cancel My Order - successful cancellation of limit sell BTC order

Request (client requests to cancel order that was created with clientOrderId equal to "1521719532817")

{
    "clientOrderId": "1521719532817",
    "cancelRequestId": "cancel_1521719532817",
    "timestamp": 1521719535310
}

Response (Aggregator sends acknowledgement message confirming that the cancellation request is accepted)

{
  "ok": "ok",
  "data": {}
}
Field Name Mandatory Format Description
clientOrderId Yes String Order identifier assigned by Client when the order was created.
cancelRequestId No String Cancel request identifier assigned by Client.
timestamp Yes String Current client time - UTC timestamp in milliseconds.

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Cancel All Orders

Client can cancel all open orders via REST API.

HTTP REQUEST

POST /do_cancel_all_orders

Do Cancel All Orders

Request (client requests to cancel all opened orders)

{}

Response (Aggregator sends acknowledgement message confirming the list of client’s opened orders which system is trying to cancel. There are 2 opened orders in this case)

{
  "ok": "ok",
  "data": {
    "clientOrderIds": ["1575459943138","1575459942041"]
  }
}

Do Cancel All Orders - There are no client’s opened orders

Request (client requests to cancel all opened orders)

{}

Response (Aggregator sends acknowledgement message confirming there are no client’s opened orders)

{
  "ok": "ok",
  "data": {
    "clientOrderIds": []
  }
}

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
clientOrderIds Yes Array This object contains list of client’s open orders and system is trying to cancel those orders. It might be empty array([]). If this array is empty, then it means there are no client’s open orders

Get Exchange Rate

Estimates exchange rate for given order parameters.

This is a short explanation of what this query means: If client creates an order with specified side (SELL or BUY) to convert given amount of currency to counterCurrency, what exchange rate (price) will be and what amount of counterCurrency will be used for this conversion. This estimation is based on order parameters provided in request and on current market data for given currency pair.

HTTP REQUEST

POST /get_exchange_rate

Request Parameters

Get Exchange Rate request for sell order for BTC-EUR currency pair

Request (client queries order parameters)

{
    "amount": "100",
    "currency": "EUR", // as a result of order execution 100 EUR should be earned
    "counterCurrency": "BTC", // currency pair BTC-EUR
    "side": "SELL" // sell order
}

Response (Aggregator responds with expected order parameters)

{
  "ok": "ok",
  "data": {
    "side": "SELL",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "EUR",
    "amount": "100.00000000",
    "counterAmount": "0.01251", // 0.01251 BTC will be sold at price 7993.60 to get 100 EUR
    "counterCurrency": "BTC",
    "price": "7993.60"
  }
}

Get Exchange Rate successful request for sell order for BTC-EUR currency pair

Request (client queries order parameters)

{
    "amount": "0.1", // 0.1 BTC should be sold
    "currency": "BTC",
    "counterCurrency": "EUR", // currency pair BTC-EUR
    "side": "SELL" // sell order
}

Response (Aggregator responds with expected order parameters)

{
  "ok": "ok",
  "data": {
    "side": "SELL",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "BTC",
    "amount": "0.10000000",
    "counterAmount": "799.00000000", // 0.1 BTC will be sold at price 7990.00, 799 EUR will be earned
    "counterCurrency": "EUR",
    "price": "7990.00"
  }
}

Get Exchange Rate request for buy order for BTC-EUR currency pair

Request (client queries order parameters)

{
    "amount": "100", // as a result of order execution 100 EUR should be spent
    "currency": "EUR",
    "counterCurrency": "BTC", // currency pair BTC-EUR
    "side": "BUY" // buy order
}

Response (Aggregator responds with expected order parameters)

{
  "ok": "ok",
  "data": {
    "side": "BUY",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "EUR",
    "amount": "100.00000000",
    "counterAmount": "0.01250", // 0.01250 BTC will be bought at price 8000.0 for 100 EUR
    "counterCurrency": "BTC",
    "price": "8000.00"
  }
}

Get Exchange Rate successful request for buy order for BTC-EUR currency pair

Request (client queries order parameters)

{
    "amount": "0.1", // 0.1 BTC should be bought
    "currency": "BTC",
    "counterCurrency": "EUR", // currency pair BTC-EUR
    "side": "BUY" // buy order
}

Response (Aggregator responds with expected order parameters)

{
  "ok": "ok",
  "data": {
    "side": "BUY",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "BTC",
    "amount": "0.10000000",
    "counterAmount": "800.00000000", // 0.1 BTC will be bought at price 8000.0, 800 EUR will be spent
    "counterCurrency": "EUR",
    "price": "8000.00"
  }
}
Field Name Mandatory Format Description
side Yes String Side of the order the rate would be estimated for. Allowed values - "BUY", "SELL"
currency Yes String Currency to be converted from.
counterCurrency Yes String Currency to be converted to.
amount Yes String parseable as float Amount of "currency" to be converted.

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
side Yes String Side of the order as was specified in request. Allowed values - "BUY", "SELL"
currency Yes String Currency to be converted from as specified in request.
counterCurrency Yes String Currency to be converted to as specified in request.
amount Yes String parseable as float Amount of "currency" to be converted as specified in request.
pair Yes String Currency pair being used in conversion.
price Yes String parseable as float Estimated price for requested order parameters and current market data.
counterAmount Yes String parseable as float Amount of "counterCurrency" the conversion would expectedly result in.
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Get Current Rates

This request allows Client to find out current best bid and best ask for configured pairs. Using this request, Client can see current rates for all configured pairs or specific pairs.

HTTP REQUEST

POST /get_current_rates

Request Parameters

Get Current Rates Request for all configured pairs

Request (Client queries current rates for all configured pairs)

{}

Response (Aggregator responds with current rates for all configured pairs)

{
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "bestBid": "8660.0",
      "bestAsk": "8670.0"
    },
    "ETH-BTC": {
      "bestBid": "162.0",
      "bestAsk": "163.0"
    },
    "LTC-BTC": {
      "bestBid": "0.00667",
      "bestAsk": "0.00669"
    }
  }
}

Get Current Rates Request for specific pairs

Request (Client queries current rates for the following pairs: BTC-USD, ETH-BTC)

{
    "pairs": [
      "BTC-USD",
      "ETH-BTC"
    ]
}

Response (Aggregator responds with current rates for BTC-USD, ETH-BTC. There is no any ask in order book for ETH-BTC.)

{
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "bestBid": "8660.0",
      "bestAsk": "8670.0"
    },
    "ETH-BTC": {
      "bestBid": "162.0",
      "bestAsk": null
    }
  }
}

Get Current Rates Request for specific pairs where one pair is unsupported

Request (Client queries current rates for the following pairs: BTC-USD, ETH-BTC, DASH-BTC)

{
    "pairs": [
      "BTC-USD",
      "ETH-BTC",
      "DASH-BTC"
    ]
}

Response (Aggregator responds with current rates for BTC-USD, ETH-BTC. Pair DASH-BTC is unsupported for Client, so there are no rates in the response.)

{
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "bestBid": "8660.0",
      "bestAsk": "8670.0"
    },
    "ETH-BTC": {
      "bestBid": "162.0",
      "bestAsk": "163.0"
    },
    "DASH-BTC": {
      "error": "unsupported pair"
    }
  }
}

Get Current Rates Request - Incorrect Request

Request (Client sends request without valid JSON object)

{}

Response (Aggregator responds to Client that error happened when processing his request.)

{
    "error": "Bad Request"
}
Field Name Mandatory Format Description
pairs No Array The list of specific pairs which rates are required. It might be empty object("{}"), which means that Client wants to receive current rates for all configured pairs.

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data Yes Object This object contains current rates, which satisfies request criteria.
bestBid No String Best bid price for specific pair. It could be "null" in case there is no any bid in order book
bestAsk No String Best ask price for specific pair. It could be "null" in case there is no any ask in order book
error No String This field is present in case requested pair is unsupported for Client or there is any error with pair configuration.

Transaction History

This request allows Client to find out their historical financial transactions (deposits, withdrawals, internal transfers or trades).

Get My Transaction History Request

Get My Transaction History - For Main Account with specified period

Request (Client sends request to find their transactions for the main account with specified period)

{
    "accountId": "",
    "operationType": "",
    "pageSize": 10,
    "pageNumber": 1,
    "dateTo": 1592238247933,
    "dateFrom": 1592238207039,
    "sortOrder": "ASC"
}

Response

{
  "ok": "ok",
  "data": [
    { 
      "timestamp": "2020-06-15 16:23:28.614",
      "accountId": "",
      "type": "trade",
      "amount": "200000",
      "details": "Finalization Trade orderId='22752' for DEMO_USER",
      "currency": "BTC" 
    },
    {   
      "timestamp": "2020-06-15 16:23:28.614",
      "accountId": "",
      "type": "trade",
      "amount": "-1873840000",
      "details": "Finalization Trade orderId='22752' for DEMO_USER",
      "currency": "USD" 
    },
    { 
      "timestamp": "2020-06-15 16:23:28.622",
      "accountId": "",
      "type": "commission",
      "amount": "-4684600",
      "details": "Commission for orderId='22752' for DEMO_USER",
      "currency": "USD" 
    }     
  ]
}

Get My Transaction History - For Main Account with Paging

Request (Client sends request to find their transactions for the main account and wants to see second page expecting the result set is chunked to pages size 2 (not more than 2 transactions per page))

{
    "accountId": "",
    "operationType": "",
    "pageSize": 2,
    "pageNumber": 1,
    "sortOrder": "DESC"
}

Response

{
  "ok": "ok",
  "data": [
    {
      "timestamp": "2020-07-02 16:29:43.546",
      "accountId": "",
      "type": "commission",
      "amount": "-203966075",
      "details": "Commission for orderId='24206' for DEMO_USER",
      "currency": "USD" 
    },
    {
      "timestamp": "2020-07-02 16:29:43.538",
      "accountId": "",
      "type": "trade",
      "amount": "-10000000",
      "details": "Finalization Trade orderId='24206' for DEMO_USER",
      "currency": "BTC"
    }
  ]
}

Get My Transaction History - Deposit Transactions for Main Account

Request (Client sends request to find all their deposit transactions for main account)

{
    "accountId": "",
    "operationType": "deposit",
    "sortOrder": "DESC"
}

Response

{
  "ok": "ok",
  "data": [
    {
      "timestamp": "2020-06-22 14:56:21.875",
      "accountId": "",
      "type": "deposit",
      "amount": "3000000",
      "details": "Deposit depositId=135704316 for DEMO_USER",
      "currency": "BTC"
    }
  ]
}

Get My Transaction History - For non-existing sub-account

Request (Client sends request for non-existing sub-account)

{
    "accountId": "nonExistingAcc"
}

Response

{
  "ok": "ok",
  "data": []
}

Get My Transaction History - Incorrect "operationType" parameter

Request (Client sends request with incorrect "operationType" parameter)

{
    "accountId": "",
    "operationType": "limitOrder"
}

Response

{
    "error": "Operation type is not supported. Supported types: trade,commission,deposit,withdraw,internalTransfer"
}

Get My Transaction History - Page size is more than 100

Request

{
    "accountId": "",
    "operationType": "",
    "pageSize": 150,
    "pageNumber": 1
}

Response

{
    "error": "Page size is limited to 100 items"
}

Get My Transaction History - For Incorrect Request

Request (Client sends request to find their transactions without valid JSON object)

{}

Response

{
    "error": "Bad Request"
}
Field Name Mandatory Format Description
accountId No String Account identifier, for which Client wants to find their transactions. Empty string ("") or null value in this field represents Client’s main account. If this field is missing, then it means Client wants to find transactions for the main account and all sub-accounts.
operationType No String If this field is present, then it means Client wants to get only transactions related to specified operation type. Allowed values are "trade", "deposit", "withdraw", "internalTransfer, "commission". If this field is missing, then it means Client wants to get transactions for all operation types.
dateFrom No Number UTC timestamp in milliseconds. Represents the earliest moment in time when transactions were created. In the result set transactions’ timestamp field value should be greater then or equal to (>=) dateFrom.
dateTo No Number UTC timestamp in milliseconds. Represents the latest moment in time when transactions were created. In the result set transactions’ timestamp field value should be less then (<) dateTo.
sortOrder No String Sort order of the result set. The result array is sorted by "timestamp" field. Allowed values: "ASC" - ascending order, "DESC" - descending order. If this field is missing then the default sort order is "DESC", so recently created transactions come first and oldest transactions come last.
pageSize No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request. If this field is missing, then the default value of 100 is used. This value cannot be greater than 100.
pageNumber No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. Result list is chunked into pages for not more than data.pageSize transactions per each page. This parameter specifies, which page number of the result set Client wants to see as the response to this request. First page number is 0. If this field is missing, then the default value of 0 is used. This value cannot be lower then 0.

Get My Transaction History Response

Field Name Mandatory Format Description
data Yes Array or Object This object contains list of transactions, which satisfies request criteria. It might be empty array([]). If this array is empty, then it means there are no transactions, which satisfy Client’s request criteria. In case of error, the value of this filed should be not Array, but Object.
timestamp Yes Datetime Represents server timestamp when this transaction happened. Format: YYYY-MM-DD HH:MM:SS.sss
accountId Yes String Represents the Account ID.
type Yes String Represents the type of this operation. Allowed values are "trade", "deposit", "withdraw", "internalTransfer", "commission".
amount Yes String (which can be parsed as Float) Represents amount of the transaction.
details Yes String Represents transaction details.
currency Yes String Represents the currency of the transaction.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Funding History

This request allows Client to find out their historical deposit and withdrawal transactions. It includes deposit or withdrawal amount, commission amount. It does not include information about internal transfers (transfers between Client’s account).

HTTP REQUEST

POST /get_my_funding_history

Request Parameters

Get My Funding History - For Main Account and all sub-accounts

Request (Client sends request to find their deposit/withdrawal transactions for the main account and all sub-accounts.)

{}

Response (Aggregator responds that Client has 2 withdrawal transactions (1 withdrawal from sub-account and 1 withdrawal from main account) and 3 deposit transactions (2 deposits to sub-accounts and 1 deposit to main account))

{
  "ok": "ok",
  "data": [
    {
      "txId": 148126,
      "clientId": "TestClient",
      "accountId": "100107_test",
      "currency": "BTC",
      "direction": "withdraw",
      "amount": "81.04000000",
      "commissionAmount": "1.14000000",
      "status": "approved",
      "updatedAt": 1465300456887
    },
    {
      "txId": 148127,
      "clientId": "TestClient",
      "accountId": "",
      "currency": "BTC",
      "direction": "withdraw",
      "amount": "11.34000000",
      "commissionAmount": "0.14000000",
      "status": "approved",
      "updatedAt": 1465300456889
    },
    {
      "txId": 148128,
      "clientId": "TestClient",
      "accountId": "100108_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "15.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300456900
    },
    {
      "txId": 148129,
      "clientId": "TestClient",
      "accountId": "100109_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    },
    {
      "txId": 148130,
      "clientId": "TestClient",
      "accountId": "",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    }
  ]
}

Get My Funding History - For Main Account and all Sub-accounts with Paging

Request (Client sends request to find their deposit/withdrawal transactions for the main account and all sub-accounts and wants to see second page expecting the result set is chunked to pages size 2 (not more than 2 transactions per page))

{
    "pageSize": 2,
    "pageNumber": 1
}

Response (Supposed that Client has 5 transactions (like in previous example), Aggregator responds with second page, which includes 2 transactions.)

{
  "ok": "ok",
  "data": [
    {
      "txId": 148128,
      "clientId": "TestClient",
      "accountId": "100108_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "15.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300456900
    },
    {
      "txId": 148129,
      "clientId": "TestClient",
      "accountId": "100109_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    }
  ]
}

Get My Funding History - For Specified Sub-Account

Request (Client sends request to find their deposit/withdrawal transactions for specified sub-account.)

{
    "accountId": "100109_test"
}

Response (Aggregator responds with deposit/withdrawal transactions for specified sub-account)

{
  "ok": "ok",
  "data": [
    {
      "txId": 148129,
      "clientId": "TestClient",
      "accountId": "100109_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    }
  ]
}

Get My Funding History - Deposit Transactions for Main Account and all Sub-accounts with specified Period

Request (Client sends request to find all their deposit transactions for main account and all sub-accounts, which happened between specified period)

{
    "direction": "deposit",
    "dateFrom": 1464976020000,
    "dateTo": 1464978000000
}

Response (Aggregator responds that Client has only one transaction, which satisfies criteria)

{
  "ok": "ok",
  "data": [
    {
      "txId": 148128,
      "clientId": "TestClient",
      "accountId": "100108_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "15.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300456900
    }
  ]
}

Get My Funding History - For Incorrect Request

Request (Client sends request to find some deposit/withdrawal transactions without valid JSON object)

{}

Response (Aggregator responds to Client that such request is not allowed)

{
    "error": "Bad Request"
}
Field Name Mandatory Format Description
accountId No String Account identifier, for which Client wants to find their transactions. Empty string ("") or null value in this field represents Client’s main account. If this field is missing, then it means Client wants to find deposits and withdrawals for the main account and all sub-accounts.
txId No Number Transaction identifier. If this field is present, then it means Client wants to get information only for specified transaction.
direction No String If this field is present, then it means Client wants to get only transactions related to specified operation type. If this field is missing, then it means Client wants to get all deposits and withdrawals. Allowed values - "deposit", "withdraw"
currency No String If this field is present, then it means Client wants to get only transactions in the specified currency. If this field is missing, then it means Client wants to get deposits/withdrawals in all currencies.
dateFrom No Number UTC timestamp in milliseconds. Represents the earliest moment in time when transactions were created. In the result set transactions’ timestamp field value should be greater then or equal to (>=) dateFrom.
dateTo No Number UTC timestamp in milliseconds. Represents the latest moment in time when transactions were created. In the result set transactions’ timestamp field value should be less then (<) dateTo.
pageSize No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request. If this field is missing, then the default value of 100 is used. This value cannot be greater than 100.
pageNumber No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. Result list is chunked into pages for not more than data.pageSize transactions per each page. This parameter specifies, which page number of the result set Client wants to see as the response to this request. First page number is 0. If this field is missing, then the default value of 0 is used. This value cannot be lower then 0.

Response Content

Field Name Mandatory Format Description
data Yes Array or Object This object contains list of transactions, which satisfies request criteria. It might be empty array([]). If this array is empty, then it means there are no transactions, which satisfy Client’s request criteria. In case of error, the value of this filed should be not Array, but Object.
txId Yes Number Unique ID of the transaction.
clientId Yes String Represents the Client’s name.
accountId Yes String Represents the Account ID.
currency Yes String Represents the currency of the transaction.
direction Yes String Represents the type of this operation. Allowed values - "deposit", "withdraw"
amount Yes String (which can be parsed as Float) Represents amount of the transaction.
commissionAmount Yes String (which can be parsed as Float) Represents commission amount of the transaction.
status Yes String Represents the status of the transaction.
updatedAt Yes Number UTC timestamp in milliseconds. Represents server timestamp when this transaction happened.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Internal Transfer

Client can request to transfer money between their sub-accounts or between their main account and sub-account. Aggregator does not charge Client any commission for transferring funds between their accounts.

HTTP REQUEST

POST /do_my_internal_transfer

Request Parameters

Do My Internal Transfer - Create a New Sub-account

Request (Client requests to transfer 20 USD from the main account to sub-account "superhat". This sub-account does not exist yet, so such successful transfer action will create this sub-account.)

{
    "fromAccountId": "",
    "toAccountId": "superhat",
    "amount": 20,
    "currency": "USD"
}

Response (Aggregator responds to Client that internal transfer operation was successful and shows transactionId of this transfer.)

{
  "ok": "ok",
  "data": {
    "transactionId": 667
  }
}

Do My Internal Transfer - Transfer Between Sub-accounts

Request (Client requests to transfer 2 USD from sub-account "superhat" to sub-account "hallo". Note that "amount" field is String in this request and is allowed as well Float.)

{
    "fromAccountId": "superhat",
    "toAccountId": "hallo",
    "amount": "2",
    "currency": "USD"
}

Response (Aggregator responds to Client that internal transfer operation was successful and shows transactionId of this transfer.)

{
  "ok": "ok",
  "data": {
    "transactionId": 672
  }
}

Do My Internal Transfer - Insufficient Funds

Request (Client requests to transfer 180 USD from sub-account "superhat" to sub-account "hallo", but there are only 18 USD on "superhat" sub-account.)

{
    "fromAccountId": "superhat",
    "toAccountId": "hallo",
    "amount": 180,
    "currency": "USD"
}

Response (Aggregator responds that Client has insufficient funds on their "superhat" sub-account. So the internal transfer was rejected, balances did not change.)

{
    "error": "Insufficient funds"
}

Do My Internal Transfer - Incorrect Amount

Request (Client requests to transfer -10 USD from sub-account "superhat" to sub-account "hallo", but amount is <0, which is not allowed.)

{
    "fromAccountId": "superhat",
    "toAccountId": "hallo",
    "amount": "-10",
    "currency": "USD"
}

Response (Aggregator responds to Client that such request is not allowed.)

{
    "error": "Amount should be greater than zero"
}

Do My Internal Transfer - Incorrect AccountId

Request (Client requests to transfer 10 USD to sub-account "hallo", but did not specify, from which account.)

{
    "toAccountId": "hallo",
    "amount": 10,
    "currency": "USD"
}

Response (Aggregator responds to Client that such request is not allowed.)

{
    "error": "Mandatory parameter fromAccountId is missing"
}

Do My Internal Transfer - Same fromAccountId and toAccountId

Request (Client requests to transfer 10 USD from sub-account "superhat" to sub-account "superhat" (same account))

{
    "fromAccountId": "superhat",
    "toAccountId": "superhat",
    "amount": 10,
    "currency": "USD"
}

Response (Aggregator responds to Client that such request is not allowed.)

{
    "error": "fromAccountId and toAccountId should be different"
}

Do My Internal Transfer - Do My Internal Transfer - Wrong Currency

Request (Client requests to transfer 10 ABC from sub-account "superhat" to main account. However, ABC is not a valid currency.)

{
    "fromAccountId": "superhat",
    "toAccountId": "",
    "amount": 20,
    "currency": "ABC"
}

Response (Aggregator responds to Client that such request is not allowed.)

{
    "error": "Unsupported currency ABC"
}
Field Name Mandatory Format Description
fromAccountId Yes String Account identifier, from which Client wants to transfer funds. Empty string ("") value in this field represents Client’s main account.
toAccountId Yes String Account identifier, to which Client wants to transfer funds. Empty string ("") value in this field represents Client’s main account.
currency Yes String Currency of internal transfer.
amount Yes Float (or String which can be parsed as Float) Amount of the transaction. It should be greater then 0

Response Content

Field Name Mandatory Format Description
transactionId No Number Unique identifier of successful internal transfer transaction.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Get Deposit Address

Request for receiving a crypto address for deposit.

HTTP REQUEST

POST /get_deposit_address

Request Parameters

Get Deposit Address Request for main account (BTC)

Request (Client queries deposit address)

{
    "accountId": "", // main account
    "currency": "BTC" // currency "BTC"
}

Response (Aggregator responds with information about crypto address for deposit)

{
  "ok": "ok",
  "data": {
    "accountId": "",
    "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
    "currency": "BTC"
  }
}

Get Deposit Address Request for client’s sub account (BTC)

Request (Client queries deposit address)

{
    "accountId": "superhat", // subaccount "superhat"
    "currency": "BTC" // currency "BTC"
}

Response (Aggregator responds with information about crypto address for deposit)

{
  "ok": "ok",
  "data": {
    "accountId": "superhat",
    "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
    "currency": "BTC"
  }
}

Get Deposit Address Request for client’s sub account (XRP)

Request (Client queries deposit address)

{
    "accountId": "superhat", // subaccount "superhat"
    "currency": "XRP" // currency "XRP"
}

Response (Aggregator responds with information for XRP deposit)

{
  "ok": "ok",
  "data": {
    "accountId": "superhat",
    "destination": "rE1sdh25BJQ3qFwngiTBwaq3zPGGYcrjp1",
    "memo": "65629",
    "currency": "XRP"
  }
}

Get Deposit Address - Invalid currency

Request (Client queries deposit address)

{
    "accountId": "",
    "currency": "ETC"
}

Response (Aggregator responds that error occurred because unsupported currency is specified in the request.)

{
    "error": "Provided currency is not supported for manual deposits"
}
Field Name Mandatory Format Description
accountId Yes String Account identifier, to which Client wants to make a deposit. Empty string ("") in this field represents Client’s main account.
currency Yes String Cryptocurrency name.

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
accountId Yes String Account identifier, to which Client wants to make a deposit.
address No String Crypto address for deposit. Please be informed that destination and memo fields are used for ledger cryptocurrencies (XRP, XLM, ATOM).
destination No String Destination address for deposit used for ledger cryptocurrencies (XRP, XLM, ATOM).
memo No String A special identifier used for ledger cryptocurrencies (XRP, XLM, ATOM).
currency Yes String Cryptocurrency name.
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Funds Withdrawal

Client can withdraw funds from Aggregator account to external crypto address.

HTTP REQUEST

POST /do_withdrawal_funds

Request Parameters

Funds Withdrawal Request from main account (BTC)

Request (Client queries withdrawal to the crypto address via blockchain)

{
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
}

Response (Aggregator responds with information about withdrawal transaction)

{
  "ok": "ok",
  "data": {
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "status": "pending",
    "instrument": "crypto"
  }
}

Funds Withdrawal Request from client’s sub account (XRP)

Request (Client queries withdrawal with destination and memo parameters (memo parameter for XRP must be of type integer))

{
    "accountId": "superhat",
    "clientTxId": "1223372036854775807",
    "currency": "XRP",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "destination": "rLHzPsX6oXkzU2qL12kHCH8G8cnZv1rBJh",
      "memo": 1318266718
    }
}

Response (Aggregator responds with information about withdrawal transaction)

{
  "ok": "ok",
  "data": {
    "clientTxId": "1223372036854775807",
    "currency": "XRP",
    "status": "pending",
    "instrument": "crypto"
  }
}

Funds Withdrawal Request - Duplicated Transaction

Request (Client queries withdrawal to the crypto address via blockchain)

{
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
}

Response (Aggregator responds with information about withdrawal transaction)

{
  "ok": "ok",
  "data": {
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "status": "pending",
    "instrument": "crypto"
  }
}

Request (Client queries withdrawal transaction with the same clientTxId)

{
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
}

Response (Aggregator responds with processing error because withdrawal transaction with the same clientTxId has been already created.)

{
    "error": "processing error"
}

Funds Withdrawal Request - Insufficient funds

Request (Client queries withdrawal to the crypto address via blockchain)

{
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
}

Response (Aggregator responds that withdrawal transaction is not created because of insufficient funds.)

{
    "error": "Insufficient funds"
}
Field Name Mandatory Format Description
clientTxId Yes String Transaction identifier assigned by Client.
accountId No String Account identifier, from which Client wants to withdraw funds. Empty string ("") or null value in this field represents Client’s main account. If this field is missing, then it means Client wants to withdraw funds from the main account.
currency Yes String Cryptocurrency name.
amount Yes Float (or String which can be parsed as Float) Amount of the transaction.
instrument Yes String Describes instrument for withdrawal transaction. Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain. Allowed value - "crypto"
amount Yes Float (or String which can be parsed as Float) Amount of the transaction.
parameters. address No String Crypto address for withdrawal. Please be informed that destination and memo fields are used for ledger cryptocurrencies (XRP, XLM, ATOM).
parameters. destination No String Destination address for withdrawal used for ledger cryptocurrencies (XRP, XLM, ATOM).
parameters. memo No String (or Integer for XRP cryptocurrency) A special identifier for withdrawal used for ledger cryptocurrencies (XRP, XLM, ATOM).

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
clientTxId Yes String Transaction identifier assigned by Client.
currency Yes String Cryptocurrency name.
status Yes String Withdrawal transaction status. Please check transaction status via get_withdrawal_status method in case status "pending" is received in the response. Allowed values - "rejected", "pending", "approved"
instrument Yes String Describes instrument for withdrawal transaction. Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain. Allowed value - "crypto"
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

Withdrawal Status

This request allows Client to find out information about cryptocurrency withdrawal.

HTTP REQUEST

POST /get_withdrawal_status

Request Parameters

Withdrawal Status Request - Pending Withdrawal Transaction

Request (Client queries status of the withdrawal transaction)

{
    "clientTxId": "1476272036854775807",
    "instrument": "crypto",
    "currency": "XRP"
}

Response (Aggregator responds with status of the withdrawal transaction. Overall transaction status is "pending". Transaction is waiting to be broadcasted to the cryptocurrency network in this case.)

{
  "ok": "ok",
  "data": {
    "currency": "XRP",
    "instrument": "crypto",
    "clientTxId": "1476272036854775807",
    "requestedAmount": "0.00200033",
    "commissionAmount": "0.0005",
    "status": "pending",
    "cexWalletTx": {
      "status": "approved",
      "amount": "0.00200033",
      "commissionAmount": "0.00000000"
    },
    "externalTx": {
      "status": "pending",
      "amount": "0.00200033",
      "commissionAmount": "0.00050000",
      "blockchainTxId": "awaiting"
    }
  }
}

Withdrawal Status Request - Withdrawal Transaction that is sent to the cryptocurrency network (BTC)

Request (Client queries status of the withdrawal transaction)

{
    "clientTxId": "1476272036854775807",
    "instrument": "crypto",
    "currency": "BTC"
}

Response (Aggregator responds with status of the withdrawal transaction. Overall transaction status is "approved". Transaction was already broadcasted to the cryptocurrency network in this case. Unique identifier of this transaction in cryptocurrency network is available in the response.)

{
  "ok": "ok",
  "data": {
    "currency": "BTC",
    "instrument": "crypto",
    "clientTxId": "1476272036854775807",
    "requestedAmount": "0.00269696",
    "commissionAmount": "0.0005",
    "status": "approved",
    "cexWalletTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00000000"
    },
    "externalTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00050000",
      "address": "3GSWtRkv7Qx5De6ZjyPmUHPig5VKHnc1iz",
      "blockchainTxId": "ab900691c7f2e3a68473403d68b92a5fb9a0b1ef8bdce8e850a7f29e1848302b"
    }
  }
}

Withdrawal Status Request - Withdrawal Transaction that is sent to the cryptocurrency network (XRP)

Request (Client queries status of the withdrawal transaction)

{
    "clientTxId": "1476272036854775807",
    "instrument": "crypto",
    "currency": "XRP"
}

Response (Aggregator responds with status of the withdrawal transaction. Overall transaction status is "approved". Transaction was already broadcasted to the cryptocurrency network in this case. Destination, memo and unique identifier of this transaction in cryptocurrency network are available in the response.)

{
  "ok": "ok",
  "data": {
    "currency": "XRP",
    "instrument": "crypto",
    "clientTxId": "1476272036854775807",
    "requestedAmount": "0.00269696",
    "commissionAmount": "0.0005",
    "status": "approved",
    "cexWalletTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00000000"
    },
    "externalTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00050000",
      "destination": "rLHzPsX6oXkzU2qL12kHCH8G8cnZv1rBJh",
      "memo": "1318266718",
      "blockchainTxId": "D641A1482072B6FCEE5F93AD26A7E8E67254F3FE3CCC65C767F0843E3BE636C1"
    }
  }
}

Withdrawal Status Request - Incorrect ClientTxId

Request (Client queries status of the withdrawal transaction)

{
    "clientTxId": "1476272036854775800",
    "instrument": "crypto",
    "currency": "ATOM"
}

Response (Aggregator responds that withdrawal transaction has not been found with such clientTxId.)

{
  "ok": "ok",
  "data": {
    "currency": "ATOM",
    "instrument": "crypto",
    "clientTxId": "1476272036854775800",
    "status": "not_found"
  }
}
Field Name Mandatory Format Description
clientTxId Yes String Transaction identifier assigned by Client.
instrument Yes String Describes instrument for withdrawal transaction. Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain. Allowed value - "crypto"
currency Yes String Cryptocurrency name.

Response Content

Field Name Mandatory Format Description
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
currency Yes String Cryptocurrency name.
instrument Yes String Describes instrument for withdrawal transaction. Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain. Allowed value - "crypto"
clientTxId Yes String Transaction identifier assigned by Client.
requestedAmount No Float (or String which can be parsed as Float) Requested amount of funds for withdrawal transaction.
commissionAmount No Float (or String which can be parsed as Float) Total commission amount for withdrawal transaction.
status Yes String Withdrawal transaction overall status. Technically, withdrawal transaction consists of 2 sub-transactions: 1) funds withdrawal from client’s account in CEX.IO Aggregator to client’s CEX.IO account; 2) funds withdrawal from client’s CEX.IO account to the external crypto address. This status is based on the statuses of those 2 sub-transactions. The status is "not_found" in case of incorrect clientTxId. Allowed values - "rejected", "pending", "approved", "not_found"
cexWalletTx.status No String Transaction status of funds withdrawal from client’s account in CEX.IO Aggregator to client’s CEX.IO account. Allowed values - "rejected", "pending", "approved"
cexWalletTx.amount No Float (or String which can be parsed as Float) Amount of funds transferred from client’s account in CEX.IO Aggregator to client’s CEX.IO account.
cexWalletTx. commissionAmount No Float (or String which can be parsed as Float) Commission amount for transaction of funds withdrawal from client’s account in CEX.IO Aggregator to client’s CEX.IO .
externalTx.status No String Transaction status of funds withdrawal from client’s CEX.IO account to the external crypto address. Allowed values - "rejected", "pending", "approved"
externalTx.amount No Float (or String which can be parsed as Float) Amount of funds transferred from client’s CEX.IO account to the external crypto address.
externalTx. commissionAmount No Float (or String which can be parsed as Float) Commission amount for transaction of funds withdrawal from client’s CEX.IO account to the external crypto address.
externalTx.address No String Crypto address that will receive the funds. Please be informed that destination and memo fields are used for ledger cryptocurrencies (XRP, XLM, ATOM).
externalTx. destination No String Destination address, that will receive the funds, used for ledger cryptocurrencies (XRP, XLM, ATOM).
externalTx.memo No String A special identifier used for ledger cryptocurrencies (XRP, XLM, ATOM).
externalTx. blockchainTxId No String Unique identifier of the transaction in cryptocurrency network with status "approved". This is optional field if transaction was already broadcasted to the cryptocurrency network. BlockchainTxId is "awaiting" in case of externalTx.status is "pending".
error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.

WebSocket

WebSocket is a TCP-based full-duplex communication protocol. Full-duplex means that both parties can send each other messages asynchronously using the same communication channel. This section describes which messages should Aggregator and Client send each other. All messages should be valid JSON objects.

WebSocket API is mostly used to obtain information or do actions which are not available or not easy to do using FIX API. However, some requests or actions are possible to do in both FIX API and WebSocket API. Aggregator sends messages to Client as a response to request previously sent by Client, or as a notification about some event (without prior Client’s request).

Request should contain request identifier “e”. If it starts with “get”, then such request is used to obtain some information. If it starts with “do”, then such request is used to trigger some action in Aggregator.

Keep in mind that WebSocket API does not support message resending functionality like FIX API does, and WebSocket connection might be terminated at any time by any party. Connection might be terminated right after the “do” request, so there is a relatively small chance that Client can miss the response for this action. So, in such case Client does not know if this action was successful or not, and there is no guarantee that Client can get this response even if he reconnects in a moment right after disconnection. If such situation happens, then Client should take necessary actions to find out the result of such actions (for example, Client should request account status or request transactions history).

In most requests, messages from Client should include the field “oid”. It should contain a string, an identifier of the request. This identifier is included in Aggregator’s responses, so it is possible for Client to link each response with their correspondent request. Client can use current timestamp in milliseconds, or a random number, or any other identifier he likes as “oid” value. It should not be unique, however it is better to use unique identifier for “oid”.

Connection

Client should connect to a specified IP address or host name and TCP port number (with specified URL) provided by Aggregator earlier. Connection should be established using SSL.

Either Client or Aggregator can terminate WebSocket connection at any time.

Once connected, Aggregator sends “connected” message to Client

Query Parameters

From To Message Description
Aggregator Client {"e":"connected"} By successful connection, Aggregator notifies Client about it by sending him a message.

Keep Connection Alive

To keep connection alive, Client should periodically send any valid message to Aggregator. Maximum allowed period between two closest Client’s messages is 10 seconds (however, this parameter might be changed by Aggregator in future). If Client exceeds this limit (meaning, Client sends less than 1 message per 10 seconds), then Aggregator can terminate the connection.

If Client has no messages to send, then he should send “ping” message to keep the connection alive. Client can send ping messages any time he wishes, even if he has enough other messages to send. Once Client sends a “ping” message, Aggregator responds with a “pong” message.

Keeping Connection Alive Example

Sequence id From To Message Description
1 Client Aggregator {"e":"ping"} Client sends “ping”
2 Aggregator Client {"e":"pong"} Almost immediately, Aggregator responds with “pong”
3 Client Aggregator {"e":"ping"} Client sends next “ping” in 5 seconds
4 Aggregator Client {"e":"pong"} Almost immediately, Aggregator responds with “pong”
5 Client Aggregator {"e":"ping"} Client sends next “ping” in 8 seconds
6 Aggregator Client {"e":"pong"} Almost immediately, Aggregator responds with “pong”
7 Aggregator keeps connection open if Client sends any valid message at least once per 10 seconds.

Example of Keeping Connection Alive with Idle Client

Sequence id From To Message Description
1 Client Aggregator {"e":"ping"} Client sends “ping”
2 Aggregator Client {"e":"pong"} Almost immediately, Aggregator responds with “pong”
3 Client Aggregator {"e":"ping"} Client sends next “ping” in 5 seconds
4 Aggregator Client {"e":"pong"} Almost immediately, Aggregator responds with “pong”
5 Client does not send any messages for more than 10 seconds
6 Aggregator Client {"e":"disconnected"} Aggregator notifies Client that he is about to Close the connection in a moment because the Client is idle. This message, however, is optional.
7 Aggregator terminates the connection.

Authentication

Once connected, Client should send authentication message to Aggregator using apiKey and apiSecret provided by Aggregator earlier.

Aggregator will respond to Client with either ok or error result.

Successful Authentication Example

Response (by successful connection, Aggregator notifies Client about it by sending them a message)

{
  "e": "connected"
}

Request (client sends a valid authentication request)

{
  "e": "auth",
  "auth": {
    "key": "djnvod237HF934jcvxj3723",
    "signature": "9732fdd0db3bbbf09941365436840f36e3a2a5d076576f87d154a69c8eab194f",
    "timestamp": 1465229405
  }
}

Response (authentication is successful)

{
  "e": "auth",
  "ok": "ok",
  "data": {
    "ok": "ok"
  }
}

Authentication Request

Field Name Mandatory Format Description Value Range
e Yes String Describes the type of this message auth
timestamp Yes Unix time Represents current Client’s time. To be considered as valid, the moment described in this field should be within 20-second range of Aggregator’s current time Number of seconds that have elapsed since 00:00:00 UTC
key Yes String Client’s apiKey which was provided by Aggregator earlier
signature Yes String Signature is a HMAC-SHA256 encoded message containing: timestamp and API key. The HMAC-SHA256 code must be generated using a secretKey which was provided by Aggregator earlier. This code must be converted to its hexadecimal representation (64 lowercase characters) Only numbers and latin characters are allowed

Authentication Response

Signature Example in Python2

message = timestamp + api_key
signature = hmac.new(API_SECRET, msg=message, digestmod=hashlib.sha256).hexdigest()

Signature Example in Python3

message = repr(ts) + api_key
signature = hmac.new(bytearray(secret.encode('utf-8')), msg=bytearray(message.encode('utf-8')), digestmod=hashlib.sha256).hexdigest()

Signature Example in NodeJS

const crypto = require('crypto');
var hmac = crypto.createHmac('sha256', apiSecret);
hmac.update(timestamp + apiKey);
var signature = hmac.digest('hex');
Field Name Mandatory Format Description Value Range
e Yes String Describes the type of this message auth
data.ok This field should be present in case of successful authentication. Otherwise, it should be missing. String If this field is present, then authentication is successful. If this field is missing, then authentication is not successful. ok
ok This field should be present in case of successful authentication. Otherwise, it should be missing. String If this field is present, then authentication is successful. If this field is missing, then authentication is not successful. ok
data.error This field should be present in case of unsuccessful authentication. Otherwise, it should be missing. String If this field is present, then authentication is not successful. Represents human readable error reason of why authentication is not successful.

Error Codes

Error Code Description
Timestamp is not in 20sec range invalid timestamp
Invalid signature invalid signature
Invalid API key mandatory field “key” is missing or incorrect
API key is not activated inactivated API key

Unsupported method call

Unsupported method call example

Response (by successful connection, Aggregator notifies Client about it by sending them a message)

{
  "e": "connected"
}

Request (client sends a valid authentication request)

{
  "e": "auth",
  "auth": {
    "key": "djnvod237HF934jcvxj3723",
    "signature": "9732fdd0db3bbbf09941365436840f36e3a2a5d076576f87d154a69c8eab194f",
    "timestamp": 1465229405
  }
}

Response (Aggregator responds that authentication is successful)

{
  "e": "auth",
  "ok": "ok",
  "data": {
    "ok": "ok"
  }
}

Request (client calls some_unsupported_method WebSocket API method that does not exist)

{
  "e": "some_unsupported_method",
  "oid": "1523433664816_1_some_unsupported_method",
  "data": {
    "foobar": 1
  }
}

Response (Aggregator responds with error)

{
  "e": "some_unsupported_method",
  "oid": "1523439125503_1_some_unsupported_method",
  "data": {
    "error": "Unsupported message type some_unsupported_method"
  }
}

Response (Aggregator sends disconnected event and closes WebSocket connection afterwards)

{
  "e": "disconnected"
}

Client sends JSON messages to Aggregator using WebSocket. Each message should contain e filed which defines the message type. Client should use messages types which are described in documentation. Once Client sends message type which is not describes in documentation, then Aggregator replies with error, sends disconnected event to Client and closes WebSocket connection.

Rate limit

Client should not send more than 300 messages per minute to Aggregator. The number of messages that Aggregator sends to Client per minute is not limited. If request rate limit is reached then Aggregator replies with error, sends disconnected event to Client and closes WS connection afterwards. Aggregator will continue to serve Client starting from the next calendar minute. In the following example, request counter will be reset at 11:02:00.000.

Rate limit exceeded example

Seq id Time Type Message Comment
1.1 11:01:05.853 Request {"e":"get_my_funding_history", "data": {"accountId”:"test1"}, "oid": "1523433_1_get_my_funding_history"} Client sends request to get funding history for accountId “test1”
1.2 11:01:05.856 Response {"e":"get_my_funding_history", "oid": "1523433_1_get_my_funding_history", "data": [],"ok": "ok"} Aggregator responds with funding history
2.1 11:01:06.001 Request {"e":"get_my_funding_history", "data": {"accountId”:"test2"}, "oid": "1523433_2_get_my_funding_history"} Client sends request to get funding history for accountId “test2”
2.2 11:01:06.104 Response {"e":"get_my_funding_history", "oid": "1523433_2_get_my_funding_history", "data": [],"ok": "ok"} Aggregator responds with funding history
... ... ... ... ...
300.1 11:01:20.213 Request {"e":"get_my_funding_history", "data": {"accountId”:”test300"}, "oid": "1523433_300_get_my_funding_history"} Client sends request to get funding history for accountId “test300”
300.2 11:01:20.345 Response {"e":"get_my_funding_history", "oid": "1523433_300_get_my_funding_history", "data": [],"ok": "ok"} Aggregator responds with funding history
301.1 11:01:20.390 Request {"e":"get_my_funding_history", "data": {"accountId”:”test301"}, "oid": "1523433_301_get_my_funding_history"} Client sends request to get funding history for accountId “test301”
301.2 11:01:20.400 Response {"e":"get_my_funding_history", "oid": "1523433_301_get_my_funding_history", "data": {"error": "API rate limit reached"}} Aggregator responds with error: API rate limit reached
302.1 11:01:20.403 Response {"e”:”disconnected”} Aggregator notifies Client before disconnecting WS by sending him a disconnected event.

Account Events

Once connected and authenticated, Client continually receives notifications about balance changes of their main account and sub-accounts. Once any event affecting Client’s account balances happens (order placing, order execution, order cancellation, deposit, withdrawal, etc), then Aggregator sends a notification to Client through WebSocket with a new account balance snapshot.

Accounts events in WS API should not be used by Client for building own accounting. There are various of reasons not to use it for accounting, the most important is that current WS API does not support resending missed messages (which might happen upon disconnection). Such events are designed as push notifications to allow Client to do some actions in “real-time” manner. For example, it can be used to update balance information in Client’s UI system by each balance change.

Account event represents the snapshot of the Client’s account at some moment in time. So, in case of active trading, such information in the event message might be not up-to-date at the moment Client receives the message.

Account event represents only available balance of Client’s account (funds which Client can use for order placing, for withdrawal, etc). Account event does not show balances which are reserved for active orders. If Client needs to know balances which are reserved for active orders then he can additionally use get_my_account_status request to it find out (field balanceOnHold).

Client can ignore such event if they do not need it, or can additionally use get_my_account_status request to find out their actual account balance.

Account Event Notification

Account Event Notifications Examples

Aggregator notifies Client that withdrawal operation was requested from main account and Aggregator started to process it. New balance on main account after withdrawal is 0.68 USD. Note that it is not possible to find out details about this withdrawal (such as, withdrawal amount) from this notification.

{
  "e": "account_update",
  "ok": "ok",
  "data":{
    "clientId": "BitFok",
    "accountId": "",
    "currency": "USD",
    "balance": "0.68000000",
    "timestamp":1465299989915,
    "action": "withdraw",
    "id": "16552948"
  }
}

Aggregator notifies Client that some order event happened for order id 2639 for sub-account “hallo”. The updated balance on “hallo” sub-account after order event is 201.86 USD. Note that from this notification, it is not possible to find out what exactly happened (either order creation, or order cancellation, or order execution) with the order, as well as any other details on this order (which order type, etc). This event just notifies Client that USD balance on “hallo” sub-account was changed and this change happened during processing the order with ID 2639. To find out more details about this order, Client should request order details using FIX API.

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "BitFok",
    "accountId": "hallo",
    "currency": "USD",
    "balance": "201.86000000",
    "timestamp": 1465300456900,
    "action": "order",
    "id": "2639"
  }
}

Aggregator notifies Client that deposit operation was requested to main account and Aggregator processed it. The updated balance on the main account after deposit is 9.09 BTC.

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "BitFok",
    "accountId": "",
    "currency": "BTC",
    "balance": "9.09000000",
    "timestamp": 1465235652000,
    "action": "deposit",
    "id": "12sQff9U13"
  }
}

Aggregator notifies Client that withdrawal operation was not successful and funds are returned to Client’s main account. The updated balance on the main account after withdrawal rollback is 100 EUR. Note that from this notification, it is not possible to find out the reason of error. However, there is an operation ID “12F009” which should be used during problem investigation, if needed.

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "BitFok",
    "accountId": "",
    "currency": "EUR",
    "balance": "100.00000000",
    "timestamp": 1465299989915,
    "action": "withdrawRollback",
    "id": "12F009"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "account_update" value allowed
data.clientId Yes String Client CompId
data.accountId Yes String Client’s sub-account ID, on which the balance was changed. If the value is empty string, then it means that the balance on the main Client’s account was changed
data.currency Yes String Currency for which account balance was changed
data.action Yes String Action, which triggered account balance change
data.id Yes String Identifier of the action, which triggered account balance change. For example, if action is “order”, then this field holds identifier of the order (which was assigned by Aggregator, not Client) that triggered account balance change
data.balance Yes String (which can be parsed as Float) Represents a snapshot of the account balance after the action. Note that this snapshot might be inaccurate (means that it can represent a snapshot after two actions, but not necessarily after just this single action), for example if some other action happened right after this action. To get the new actual balance, Client can additionally make get_my_account_status request
data.timestamp Yes Number UTC timestamp in milliseconds. Represents a moment in time when the balance snapshot was taken
ok No String ok value represents that event notification is successfully generated

Action Types

Action Description
order order creation, order cancellation, order execution
deposit deposit operation is requested
withdraw withdrawal operation is requested
withdrawRollback withdrawal error happened, funds are returned back to Client
internalTransfer internal transfer between Client’s accounts

Trading Conditions

Using this request, Client can find out his actual settings for each trading pair.

Get My Trading Conditions Request

Successful Get My Trading Conditions Request

Request (client sends a request to find out their trading settings for pairs “BTC-USD”)

{
  "e": "get_my_trading_conditions",
  "oid": "1465241265586_1_get_my_trading_conditions",
  "data":{
    "pairs": ["BTC-USD"]
  }
}

Response (Aggregator successfully responds to the request)

{
  "e": "get_my_trading_conditions",
  "oid": "1523619250505_1_get_my_trading_conditions",
  "ok": "ok",
  "data": {
    "BTC-USD":{
      "fee": {
        "type": "percent",
        "maxPercent": "0.5", // 0.5% fixed strategy commission with commission amount calculated in USD
        "currency": "USD"
      },
      "tickSize": 0.1, // tick size is 0.1 USD
      "minOrderAmountCcy1": "0.00200000", // Min Order Amount in currency1 is 0.002 BTC
      "minOrderAmountCcy2": "2.50000000", // Min Order Amount in currency2 is 2.5 USD
      "lotSizeCcy1": "0.00000001", // lot size in currency1 is 1 satoshi
      "lotSizeCcy2": "0.01000000", // lot size in currency2 is 1 cent
      "maxOrderAmountCcy1": {
        "default": "100.00000000", // Max Order Amount in currency1 for orders other than Market and FOK is 100 BTC
        "pendingPayout": "10.00000000" // Max Order Amount in currency1 for Market and FOK orders is 10 BTC
      },
      "maxOrderAmountCcy2": {
        "default": "50000.00000000", // Max Order Amount in currency2 for orders other than Market and FOK is 50000 USD
        "pendingPayout": "5000.00000000" // Max Order Amount in currency2 for Market and FOK orders is 5000 USD
      }
    }
  }
}

Successful Get My Trading Conditions Request With Empty List of pairs

Request (client sends valid request but provides empty list of currency pairs)

{
  "e": "get_my_trading_conditions",
  "oid": "1465241265586_1_get_my_trading_conditions",
  "data": {
    "pairs": []
  }
}

Response (Aggregator responds with trading conditions for all pairs that Client supports. In current case Client supports only BTC-USD and BTC-EUR pairs. Reply contains trading conditions for both "BTC-USD" and "BTC-EUR" pairs)

{
  "e": "get_my_trading_conditions",
  "oid": "1523619250505_1_get_my_trading_conditions",
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "fee": {
        "type": "percent",
        "maxPercent": "0.5",
        "currency": "USD"
      },
      "tickSize": 0.1,
      "minOrderAmountCcy1": "0.00200000",
      "minOrderAmountCcy2": "2.50000000",
      "lotSizeCcy1": "0.00000001",
      "lotSizeCcy2": "0.01000000",
      "maxOrderAmountCcy1": {
        "default": "100.00000000",
        "pendingPayout": "10.00000000"
      },
      "maxOrderAmountCcy2": {
        "default": "50000.00000000",
        "pendingPayout": "5000.00000000"
      }
    },
    "BTC-EUR": {
      "fee": {
        "type": "percent",
        "maxPercent": "0.5",
        "currency": "USD"
      },
      "tickSize": 0.1,
      "minOrderAmountCcy1": "0.00200000",
      "minOrderAmountCcy2": "2.50000000",
      "lotSizeCcy1": "0.00000001",
      "lotSizeCcy2": "0.01000000",
      "maxOrderAmountCcy1": {
        "default": "100.00000000",
        "pendingPayout": "10.00000000"
      },
      "maxOrderAmountCcy2": {
        "default": "50000.00000000",
        "pendingPayout": "5000.00000000"
      }
    }
  }
}

Unsuccessful Get My Trading Conditions Request

Request (client sends request to find out their trading settings, however the mandatory field “pairs” is missing)

{
  "e": "get_my_trading_conditions",
  "oid": "1465241265586_1_get_my_trading_conditions",
  "data": {}
}

Response (Aggregator responds that such request is not valid)

{
  "e": "get_my_trading_conditions",
  "oid": "1465241265586_1_get_my_trading_conditions",
  "data": {
    "error": "Mandatory parameter pairs is missing"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_trading_conditions" value allowed
data.pairs Yes Array List of pairs, for which Client wants to find out their trade fee settings. Each pair should contain two currencies in upper case divided by “-“ symbol. Each pair should be listed in traditional direction. For example “BTC-USD”, but not “USD-BTC”. If pairs array is empty - should return Trading Conditions for all supported pairs
oid Yes String Unique ID of this request

Get My Trading Conditions Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_trading_conditions" value allowed
data Yes Object This field holds an Object which consists of keys for each requested pair. Values of each key showsClient’s trade fee settings for each trade pair
fee.type Yes String Describes the type of the commission strategy. “percent” means that commission is calculated as a percentage of executed trade amount. Only "percent" value is supported now
fee.maxPercent Yes Float Describes percentage that should be applied to the executed trade amount to calculate the maximum commission amount.For example, if executed trade amount is 6,500 and maxPercent is 0.5, then maximum commission amount is 32.5
fee.currency Yes String Shows, in which currency the trade commission is calculated
fee. fixedClientCommission No Boolean If this field is present and if its value is true, it means that Client has Fixed Commission strategy for this trade pair. If this field is missing or it its value is false, it means that Client has Floating Commission strategy for this trade pair (see “Order Commissions” section for details)
tickSize Yes Float “tickSize” describes the smallest change in price. For example, if tickSize is 0.01 then it means price has 2 decimal places
minOrderAmountCcy1 Yes Float Minimum Order Amount in currency1
minOrderAmountCcy2 Yes Float Minimum Order Amount in currency2
lotSizeCcy1 Yes Float Order lot size in currency1. Such limitation allows only order amount that is a multiple of lot size. For example, if order lot size is 0.5, then order amounts 1.5, 4, 10.5, are allowed, while amounts 0.3, 1.2, 10.9 are not allowed
lotSizeCcy2 Yes Float Order lot size in currency2. Such limitation allows only order amount that is a multiple of lot size. For example, if order lot size is 0.5, then order amounts 1.5, 4, 10.5, are allowed, while amounts 0.3, 1.2, 10.9 are not allowed
maxOrderAmountCcy1. default Yes Float Maximum Order Amount in currency1. default option apply to all orders other than Market and Limit FOK
maxOrderAmountCcy1. pendingPayout Yes Float Maximum Order Amount in currency1. pendingPayout option apply to Market and Limit FOK orders
maxOrderAmountCcy2. default Yes Float Maximum Order Amount in currency2. default option apply to all orders other than Market and Limit FOK
maxOrderAmountCcy2. pendingPayout Yes Float Maximum Order Amount in currency2. pendingPayout option apply to Market and Limit FOK orders
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Account Status

Using this request, Client can find out available balances on their accounts. Also Client might have amounts which are locked for open orders, which is not displayed in balance field, it is displayed in balanceOnHold field. Available trading balance is also displayed in the response. It is calculated as available balance plus overdraft limit which is allowed for the client.

Get My Account Status Request

Get My Account Status for All Accounts for All Currencies

Request (client sends request to find out his accounts’ statuses for all his accounts for all currencies)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "data": {}
}

Response (Aggregator responds that Client has main account with currencies "USD", "EUR" and "BTC" and sub-account "hallo" with currencies "USD" and "BTC". Also, it contains balance for each account and timestamp of when account was modified last time)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "ok": "ok",
  "data": {
    "": {
      "USD": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "201.86549600",
        "updatedAt": 1456839391786,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1201.86549600"
      },
      "EUR": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "EUR",
        "balanceOnHold": "0.00000000",
        "balance": "1400.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "2400.00000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "BTC",
        "balanceOnHold": "5.00000000",
        "balance": "720.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1720.00000000"
      }
    },
    "hallo": {
      "USD": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "USD",
        "balanceOnHold": "500.00000000",
        "balance": "1.80000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1001.80000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "20.00000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1020.00000000"
      }
    }
  }
}

Get My Account Status for Selected Sub-accounts for All Currencies

Request (client sends a request to find out his accounts’ statuses for specified accounts for all currencies)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "data": {
    "accountIds": ["hallo", "superhat"]
  }
}

Response (Aggregator responds that Client has sub-account "hallo" with currencies "USD" and "BTC". Sub-account "superhat" status was requested but it is not included into response, because Client doesn’t have "superhat" sub-account. The main account is not included, because it was not requested)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "ok": "ok",
  "data": {
    "hallo": {
      "USD": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "1.80000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1001.80000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "20.00000000",
        "updatedAt":1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1020.00000000"
      }
    }
  }
}

Get My Account Status for All Accounts for Selected Currencies

Request (client sends request to find out their accounts’ statuses for all accounts for selected currencies)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "data": {
    "currencies":["USD","BTC"]
  }
}

Response (Aggregator responds that Client has main account and sub-account "hallo", each with currencies "USD" and "BTC". Note that other currencies (like "EUR", "ETH") are not included into response, because it was not requested)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "ok": "ok",
  "data": {
    "": {
      "USD": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "201.86549600",
        "updatedAt": 1456839391786,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1201.86549600"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "720.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1720.00000000"
      }
    },
    "hallo": {
      "USD": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "USD",
        "balanceOnHold": "0.00000000",
        "balance": "1.80000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1001.80000000"
      },
      "BTC": {
        "clientId": "BitFok",
        "type": "SubAccount",
        "accountId": "hallo",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "20.00000000",
        "updatedAt": 1465235652000,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1020.00000000"
      }
    }
  }
}

Get My Account Status for All Accounts for One Selected Currency

Request (client sends request to find out their accounts’ statuses for all accounts for EUR currency)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "data": {
    "currencies": ["EUR"]
  }
}

Response (Aggregator responds that only the main account is with currency "EUR". Note that other currencies (like "BTC", "USD") and other sub-accounts (like "superhat") are not included into response, because it was not requested)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "ok": "ok",
  "data": {
    "": {
      "EUR": {
          "clientId": "BitFok",
          "type": "Main",
          "accountId": "",
          "currency": "EUR",
          "balanceOnHold": "10.00000000",
          "balance": "1400.00000000",
          "updatedAt": 1465300456900,
          "overdraftLimit": "1000.00000000",
          "availableTradingBalance": "2400.00000000"
      }
    }
  }
}

Get My Account Status - No Account Matching Criteria

Request (client sends request to find out his accounts’ statuses for specified sub-accounts only for EUR currency)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "data": {
    "currencies": ["EUR"],
    "accountIds": ["hallo", "superhat"]
  }
}

Response (Aggregator responds that Client has no accounts which satisfy request criteria)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "ok": "ok",
  "data": {}
}

Get My Account Status for Single Account for Single Currency

Request (client sends request to find out the main account status for BTC currency)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "data": {
    "currencies": ["BTC"],
    "accountIds": [""]
  }
}

Response (Aggregator responds that Client has main account and includes its BTC balance. No other accounts are included, and no other currencies are included, because is was not requested)

{
  "e": "get_my_account_status",
  "oid": "1465340168103_1_get_my_account_status",
  "ok": "ok",
  "data": {
    "": {
      "BTC": {
        "clientId": "BitFok",
        "type": "Main",
        "accountId": "",
        "currency": "BTC",
        "balanceOnHold": "0.00000000",
        "balance": "720.00000000",
        "updatedAt": 1465300456900,
        "overdraftLimit": "1000.00000000",
        "availableTradingBalance": "1720.00000000"
      }
    }
  }
}

Get My Account Status - Incorrect Request

Request (client sends request, however the value of the field "data" is not a valid JSON object)

{
  "e": "get_my_account_status",
  "data": null,
  "oid": "1465392818634_1_get_my_account_status"
}

Response (Aggregator responds to Client that error happened when processing his request)

{
  "e": "get_my_account_status",
  "oid": "1465392818634_1_get_my_account_status",
  "data": {
    "error": "Internal error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_account_status" value allowed
data Yes Object This object contains request details. It might be empty object("{}"), which means that Client sets no criteria for accounts. However, this field should be present anyway and it should contain an object. Setting no criteria for accounts means that Client wants to get statuses for all accounts and for all currencies. Aggregator encourages Client to always set criteria to get only the accounts which Client is interested in. It will make request processing faster and Client will get a faster response
data.currencies No Array List of currencies for which Client wants to find out their accounts balances. Currencies should be in upper case. Each currency should be present only once in this array. For example, ["USD", "BTC", "EUR", "BTC"] is not allowed. If this field is missing or contains empty array ([]), then it means Client wants to find out their balances for all currencies they have
data.accountIds No Array List of account identifiers for which Client wants to find out their accounts balances. Empty string ("") value in this array represents Client’s main account. Each account identifier should be present only once in this array. For example, ["hallo", "", "superhat", "hallo"] is not allowed. If this field is missing or if it contains empty array ([]), then it means Client wants to find out their balances for all accounts
oid Yes String Unique ID of this request

Get My Account Status Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_account_status" value allowed
data Yes Object This object contains response details. It might be empty object("{}"), but this field should be present anyway and it should contain an object. If this Object is empty, then it means Client has no accounts which satisfy Client’s request criteria
data.X No Object Represents an object which describes X account statuses for each currency. If X is ""(empty string), that means X is main account. Otherwise, it represents X sub-account
data.X.YYY No Object Represents an object which describes X account statuses for YYY currency
data.X.YYY.clientId Yes String Client Comp ID
data.X.YYY.type Yes String Describes the type of this account, either main or sub-account. Only Main or SubAccount values are allowed
data.X.YYY.accountId Yes String Describes Client’s account identifier. If value is "" (empty string), then it represents the main account. Otherwise, that represents sub-account identifier
data.X.YYY.currency Yes String Currency of this account
data.X.YYY.balance Yes String (which can be parsed as Float) Current account available balance. It does not include balance which is reserved for active orders (please find this information in "balanceOnHold" field)
data.X.YYY. balanceOnHold Yes String (which can be parsed as Float) Current balance which is reserved for active orders
data.X.YYY.updatedAt Yes Number UTC timestamp in milliseconds. Represents a moment in time when this account balance was modified last time
data.X.YYY. overdraftLimit Yes String (which can be parsed as Float) Overdraft limit which is allowed for the client
data.X.YYY. availableTradingBalance Yes String (which can be parsed as Float) Current balance which is available for trading. It is calculated as current account balance plus overdraft limit
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only ok value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Orders

This request allows Client to find out info about their orders.

Get My Orders Request

Get My Orders - All Open Orders

Request (client sends request to find all their open orders for all pairs and all accounts)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "data": {}
}

Response (Aggregator responds that Client has 3 open orders)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "ok": "ok",
  "data": [
    {
      "orderId": "26", // Market BUY 0.01 BTC/USD with main account
      "clientOrderId": "1465300456557-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "USD",
      "side": "BUY",
      "orderType": "Market",
      "timeInForce": null,
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.01000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "USD",
      "price": null,
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": null,
      "initialOnHoldAmountCcy2": "21.00000000",
      "expireTime": null,
      "effectiveTime": null
    },
    {
      "orderId": "20", // Limit BUY 0.1 BTC/USD at price 400 with "hallo" sub-account
      "clientOrderId": "1465299989578-0",
      "clientId": "BitFok",
      "accountId": "hallo",
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "USD",
      "side": "BUY",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.10000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "USD",
      "price": "400.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": null,
      "initialOnHoldAmountCcy2": "21.00000000",
      "expireTime": null,
      "effectiveTime": null
    },
    {
      "orderId": "18", // Limit SELL 0.02 BTC/EUR at price 600 with main account
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - All Open Orders with Paging

Request (client sends request to find all their open orders and wants to see the second page expecting the result set is chunked to pages size 2 (not more than 2 orders per page)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "data": {
    "pageSize": 2,
    "pageNumber": 1
  }
}

Response (supposed that Client has 3 open orders (like in previous example), Aggregator responds with second page, which includes only the last single order)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - All Open Orders for Selected Pair

Request (client sends request to find all their open orders for "BTC-EUR" pair)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "data": {
    "pair": "BTC-EUR"
  }
}

Response (Aggregator responds that Client has 1 open order for BTC-EUR pair)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - All Open Orders for Account and Pair

Request (client sends request to find all their open orders for currency pair "BTC-USD" and for sub-accounts "hallo" or "superhat")

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "data": {
    "accountIds": ["hallo", "superhat"],
    "pair": "BTC-USD"
  }
}

Response (Aggregator responds that Client has only one open order that satisfies request criteria, this order is on "hallo" sub-account)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "ok": "ok",
  "data": [
    {
      "orderId": "20",
      "clientOrderId": "1465299989578-0",
      "clientId": "BitFok",
      "accountId": "hallo",
      "status": "NEW",
      "currency1": "BTC",
      "currency2": "USD",
      "side": "BUY",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": null,
      "rejectReason": null,
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.10000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "USD",
      "price": "400.0000",
      "averagePrice": null,
      "statusIsFinal": false,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - Accounts, Paging, Period, Empty Result

Request (client wants to see not more than 50 open orders from main account which were created between 2016-06-06T16:11:29 and 2016-06-07T08:53:09)

{
  "e": "get_my_orders",
  "oid": "2_1_get_my_orders",
  "data": {
    "accountIds": [""],
    "pageSize": 50,
    "clientCreateTimestampFrom": 1465229489578,
    "clientCreateTimestampTo": 1465289589579
  }
}

Response (Aggregator responds that Client has no open orders, which satisfy request criteria)

{
  "e": "get_my_orders",
  "oid": "2_1_get_my_orders",
  "ok": "ok",
  "data": []
}

Get My Orders - All Archived Orders for Selected Side

Request (client sends request to find all their archived orders)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "data": {
    "archived": true,
    "side": "SELL"
  }
}

Response (supposed that Client has 3 archived orders (like in previous example), Aggregator responds to Client that they have 1 archived order which satisfies request criteria)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "REJECTED",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": 403,
      "rejectReason": "Insufficient funds",
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": true,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Order - Incorrect Request

Request (client made a request, but did not specify mandatory "data" field)

{
  "e": "get_my_orders",
  "oid": "1465409645363_1_get_my_orders"
}

Response (Aggregator responds that error occurred. Note: "data" field hold and object value here, not the array)

{
  "e": "get_my_orders",
  "oid": "1465409645363_1_get_my_orders",
  "data": {
    "error": "Internal error"
  }
}

Get My Order - Page Size is Too Big

Request (client made a request to get all archived orders and wishes to get first 5,000 orders list as a response to this request)

{
  "e": "get_my_orders",
  "oid": "1465477794024_1_get_my_orders",
  "data": {
    "archived": true,
    "pageSize": 5000
  }
}

Response (Aggregator responds that such request is not allowed. Requested page size is too big, maximum allowed value is 100)

{
  "e": "get_my_orders",
  "oid": "1465477794024_1_get_my_orders",
  "data": {
    "error": "Page size is limited to 100 items"
  }
}

Get My Order - Incorrect Archived Type

Request (client made a request to get his open orders, however "archived" field value is number)

{
  "e": "get_my_orders",
  "oid": "1465478161261_1_get_my_orders",
  "data": {
    "archived": 0
  }
}

Response (Aggregator responds that such request is not allowed. Field "archived" should be either true, or false, or it should be missing)

{
  "e": "get_my_orders",
  "oid": "1465478161261_1_get_my_orders",
  "data": {
    "error": "Archived parameter should be boolean"
  }
}

Get My Orders - Single Order by OrderId

Request (client sends request to find their single order by orderId)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "data": {
    "orderId": 18
  }
}

Response (Aggregator responds with status of this order)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "REJECTED",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": 403,
      "rejectReason": "Insufficient funds",
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": true,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}

Get My Orders - Single Order by clientOrderId

Request (client sends request to find their single order by clientOrderId)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "data": {
    "clientOrderId": "1465299852968-0"
  }
}

Response (Aggregator responds with status of this order)

{
  "e": "get_my_orders",
  "oid": "1465405014762_1_get_my_orders",
  "ok": "ok",
  "data": [
    {
      "orderId": "18",
      "clientOrderId": "1465299852968-0",
      "clientId": "BitFok",
      "accountId": null,
      "status": "REJECTED",
      "currency1": "BTC",
      "currency2": "EUR",
      "side": "SELL",
      "orderType": "Limit",
      "timeInForce": "GTC",
      "comment": null,
      "rejectCode": 403,
      "rejectReason": "Insufficient funds",
      "executedAmountCcy1": null,
      "executedAmountCcy2": null,
      "requestedAmountCcy1": "0.02000000",
      "requestedAmountCcy2": null,
      "feeAmount": null,
      "feeCurrency": "EUR",
      "price": "600.0000",
      "averagePrice": null,
      "statusIsFinal": true,
      "clientCreateTimestamp": 1516699748938,
      "serverCreateTimestamp": 1516699748964,
      "lastUpdateTimestamp": 1516699748983,
      "initialOnHoldAmountCcy1": "0.02000000",
      "initialOnHoldAmountCcy2": null,
      "expireTime": null,
      "effectiveTime": null
    }
  ]
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_orders" value allowed
data Yes Object This object contains request details. It might be empty object("{}"), which means that Client sets no criteria for orders, which Client wants to see. However this field should be present anyway and it should contain an object. Setting no criteria for orders means that Client wants to get statuses for all their open orders.
clientOrderId No String Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API). If this field is present, then it means Client wants to see the status of the exact order. In this case, Aggregator ignores all other parameters in "data" field.
orderId No Number Order identifier assigned by Aggregator (OrderID(37) field in Execution Report(8) message in FIX API). If both fields "orderId" and "clientOrderId" are present, then Aggregator ignores "orderId" field. If this field is present (and "clientOrderId" is not present), then it means Client wants to see the status of the exact order. In this case, Aggregator ignores all other parameters in "data" field.
archived No Boolean If value is true, then it means Client wants to get his completed (archived) orders. "Completed" means that order is in one of its final statuses. If value is false or if this field is missing, it means Client wants to get his open orders. Value should be in boolean type. So values like null, 0, 1, "true", "hallo" and similar are not allowed.
pair No String Currency pair, for which Client wants to find their orders. Pair should contain two currencies in upper case divided by "-" symbol. Pair should be listed in traditional direction. For example, "BTC-USD", but not "USD-BTC". If this field is missing, or if it contains empty string (""), or null, then it means Client wants to find their orders for all pairs.
side No String Side of the orders (corresponds to field Side(54) in Execution Report(8) and in New Order Single (D) messages in FIX API), for which Client wants to find their orders.
accountIds No Array List of account identifiers, for which Client wants to find their orders. Empty string ("") or null value in this array represents Client’s main account. Each account identifier should be present only once in this array. For example, ["hallo", "", "superhat", "hallo"] is not allowed. If this field is missing or if it contains an empty array ([]), then it means Client wants to find their orders for all accounts.
clientCreate TimestampFrom No Number UTC timestamp in milliseconds. Represents the earliest moment in time when orders are created. In the result set orders’ clientCreateTimestamp should be greater then or equal to (>=) clientCreateTimestampFrom. Order creation time in this context is a timestamp provided by Client during creation of the order (field TransactTime(60) in New Order Single(D) message from Client in FIX API)
clientCreate TimestampTo No Number UTC timestamp in milliseconds. Represents the latest moment in time when orders are created. In the result set orders’ clientCreateTimestamp should be less then (<) clientCreateTimestampTo. Order creation time in this context is a timestamp provided by Client during creation of the order (field TransactTime(60) in New Order Single(D) message from Client in FIX API)
sortBy No String String that represents the field to sort the resulting array by. Supported values are - "lastUpdateTimestamp", "clientCreateTimestamp", "serverCreateTimestamp". If "sortBy" parameter is not specified then resulting array will be sorted by lastUpdateTimestamp.
sortOrder No String Sort order of the result set. The result array is sorted by field that is specified in "sortBy" parameter. "ASC" - ascending order, "DESC" - descending order. If "sortBy" parameter is not specified by client resulting array will be sorted by lastUpdateTimestamp. If this field is missing then the default sort order is "DESC", so recently created orders come first and the oldest order comes last.
pageSize No Number Because the result might contain too many orders, Client should specify which portion of the result list they want to get as a response to this request. This parameter limits the maximum number of orders in the result for this request. If this field is missing, then the default value of 100 is used. This value cannot be greater than 100.
pageNumber No Number Because the result might contain too many orders, Client should specify which portion of the result list they want to get as a response to this request. Result list is chunked into pages for not more than data.pageSize orders per each page. This parameter specifies, which page number of the result set Client wants to see as the response to this request. First page number is 0. If this field is missing, then the default value of 0 is used. This value cannot be lower then 0.
oid Yes String Unique ID of this request

Get My Orders Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_orders" value allowed
data Yes Array or Object This object contains list of orders which satisfy request criteria. It might be empty array([]). If this array is empty, then it means Client has no orders, which satisfy Client’s request criteria. The result array is sorted by "clientOrderCreationTimestamp" field with specified order. In case of error, the value of this filed should be not Array, but Object.
orderId Yes String Order identifier assigned by Aggregator (OrderID(37) field in Execution Report(8) message in FIX API)
clientOrderId Yes String Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API)
clientId Yes String Client Comp id
accountId Yes String Represents Client’s account id, which was used for order processing (field Account(1) in Execution Report(8) and in New Order Single (D) messages in FIX API). If this value is null, then it means Client’s main account. Otherwise, it means identifier of Client’s sub-account.
status Yes String Represents current execution status of this order (corresponds to field OrdStatus(39) field in Execution Report(8) message in FIX API).
statusIsFinal Yes Boolean Represents whether this order is in the final state or not
currency1 Yes String Represents first currency in currency pair of this order
currency2 Yes String Represents second currency in currency pair of this order
side Yes String Represents side of this order (corresponds to field Side(54) in Execution Report(8) and in New Order Single (D) messages in FIX API)
orderType Yes String Represents order type of this order (corresponds to field OrdType(40) in Execution Report(8) and in New Order Single (D) messages in FIX API).
timeInForce Yes String Represents time in force of this order (corresponds to field TimeInForce(59) in Execution Report(8) and in New Order Single (D) messages in FIX API). For details see "Order TimeInForce" section. This value can be null for orders where time in force is not applied, for example, for Market order.
comment Yes String Text, which was provided by Client during order creation (in field Text(58) in New Order Single(D) in FIX API). If value is null, then it means Client did not provide such text during order creation.
rejectCode Yes Number Error code if the order is rejected. If value is null, that means there is no error code.
rejectReason Yes String Human readable error description if the order is rejected. If value is null, that means there is no error description.
executedAmountCcy1 Yes String (which can be parsed as Float) Represents executed amount in currency1. If this value is null, then it means there is no executed amount (order has no executions).
executedAmountCcy2 Yes String (which can be parsed as Float) Represents executed amount in currency2. If this value is null, then it means there is no executed amount (order has no executions).
requestedAmountCcy1 Yes String (which can be parsed as Float) Represents order amount in currency1, which was requested by Client (corresponds to OrderQty(38) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested amount in currency1 (order should have then requested amount in currency1)
requestedAmountCcy2 Yes String (which can be parsed as Float) Represents order amount in currency2, which was requested by Client (corresponds to CashOrderQty(152) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested amount in currency2 (order should have then requested amount in currency2).
initialOnHoldAmountCcy1 Yes String (which can be parsed as Float) Represents amount in currency1 which was hold from Client balance by aggregator before order execution. If this value is null, then it means that amount in currency1 was not hold from Clients account for this order
initialOnHoldAmountCcy2 Yes String (which can be parsed as Float) Represents amount in currency2 which was hold from Client balance by aggregator before order execution. If this value is null, then it means that amount in currency2 was not hold from Clients account for this order
feeAmount Yes String (which can be parsed as Float) Represents order commission, which was charged for this order (corresponds to Commission(12) field in Execution Report(8) message in FIX API). If this value is null, then it means there is no commission amount charged for this order.
feeCurrency Yes String Represents order commission currency (corresponds to CommCurrency(479) field in Execution Report(8) message in FIX API)
price Yes String (which can be parsed as Float) Represents order price, which was provided by Client during order creation (corresponds to Price(44) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested price for this order. It happens for order where price cannot be requested, for example, Market orders or Stop orders.
averagePrice Yes String (which can be parsed as Float) Represents average order execution price (corresponds to AvgPx(6) field in Execution Report(8) message in FIX API). If this value is null, then it means there is no executed amount (order has no executions).
clientCreateTimestamp Yes Number UTC timestamp in milliseconds. Represents a timestamp provided by Client during creation of the order (field TransactTime(60) in New Order Single(D) message in FIX API)
serverCreateTimestamp Yes Number UTC timestamp in milliseconds. Represents server timestamp when order is received.
lastUpdateTimestamp Yes Number UTC timestamp in milliseconds. Represents server timestamp when order changed its state last time.
expireTime Yes Number UTC timestamp in milliseconds. Represents an expired timestamp provided by Client during creation of the order (field ExpireTime(126) in New Order Single(D) message in FIX API). If this value is null, then it means Client did not provide expire time during order creation.
effectiveTime Yes Number UTC timestamp in milliseconds. Represents an effective timestamp provided by Client during creation of the order (field EffectiveTime(168) in New Order Single(D) message in FIX API). If this value is null, then it means that Client did not provide effective time during order creation.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to.

New Order

Client can place orders via WebSocket API. Along with a response to this request, Aggregator sends Account Event and Execution Report messages to Client if the request is successful.

Do My New Order Request

Do My New Order - place limit sell order

Request (client requests to place a limit order to sell 0.01 BTC for USD at price 7500)

{
  "e": "do_my_new_order",
  "oid": "1521711134776_1_do_my_new_order",
  "data": {
    "clientOrderId": "1521711134775",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "timestamp": 1521711134775,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "amountCcy1": "0.01",
    "price": 7500,
    "comment": "v_overdraft_test"
  }
}

Response (Aggregator sends acknowledgement message confirming that the order is placed)

{
  "e": "do_my_new_order",
  "oid": "1521711134776_1_do_my_new_order",
  "ok": "ok",
  "data": {}
}

Response (Aggregator sends Account Event notification. Before order execution starts, requested amount is locked on client’s account. After requested amount subtracted balance is 9.9893 BTC)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "BTC",
    "balance": "9.98930000",
    "timestamp": 1521708409281,
    "action": "order",
    "id": "17059"
  }
}

Response (Aggregator sends Execution Report event for the new order. The first Execution Report contains initial state: executed amounts are both 0, no fee have been charged so far)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "17062",
    "clientOrderId": "1521711134775",
    "accountId": null,
    "status": "NEW",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.01000000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "v_overdraft_test",
    "executionType": "New",
    "executionId": "1521616998836_0_1",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "7500.00",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
  }
}

Response (Aggregator sends Account Event notification. As a result of selling 0.1 BTC we earned 170.63 USD and new balance is 9274.94197930 USD)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "USD",
    "balance": "9274.94197930",
    "timestamp": 1521711136458,
    "action": "order",
    "id": "17062"
  }
}

Response (Aggregator sends Account Event notification after fee was charged (0.60063 USD). Updated balance is 9274.34134930 USD)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "USD",
    "balance": "9274.34134930",
    "timestamp": 1521711136727,
    "action": "order",
    "id": "17062"
  }
}

Response (Aggregator sends final execution report. It has status FILLED, executed amount in currency 1 is equal to requested amount in currency 1. Average price is greater than was requested for sell order (therefore limit order was executed immediately). Fee Amount field contains actual fee amount)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "17062",
    "clientOrderId": "1521711134775",
    "accountId": null,
    "status": "FILLED",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.01000000",
    "executedAmountCcy2": "170.63000000",
    "requestedAmountCcy1": "0.01000000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "v_overdraft_test",
    "executionType": "Trade",
    "executionId": "1521616998836_0_2",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "7500.00",
    "averagePrice": "17063.00",
    "lastQuantity": "0.01000000",
    "lastPrice": "17063.00",
    "feeAmount": "0.60063000",
    "feeCurrency": "USD"
  }
}

Do My New Order - place limit buy order

Request (client requests to place a limit order to sell 0.01 BTC for USD at price 18500)

{
  "e": "do_my_new_order",
  "oid": "1521713494191_1_do_my_new_order",
  "data": {
    "clientOrderId": "1521713494191",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "BUY",
    "timestamp": 1521713494191,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "amountCcy1": "0.01",
    "price": 18500,
    "destination": "cex-dev_CEX",
    "comment": "v_overdraft_test"
  }
}

Response (Aggregator sends acknowledgement message confirming that the order is placed)

{
  "e": "do_my_new_order",
  "oid": "1521713494191_1_do_my_new_order",
  "ok": "ok",
  "data": {}
}

Response (Aggregator sends Account Event notification. Before order execution starts, aggregator calculates approximate amount of currency2 (USD) needed to buy requested amount of currency1 (BTC). This calculation uses current market data and expected fee. This approximate amount is then locked on client’s account. After that amount was subtracted, the balance is 9161.57071930 USD)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "USD",
    "balance": "9161.57071930",
    "timestamp": 1521713494503,
    "action": "order",
    "id": "17065"
  }
}

Response (Aggregator sends Execution Report for the new order. The first Execution Report contains initial state: executed amounts are both 0, no fee have been charged so far)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "17065",
    "clientOrderId": "1521713494191",
    "accountId": null,
    "status": "NEW",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "BUY",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.01000000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "v_overdraft_test",
    "executionType": "New",
    "executionId": "1521616998877_2_4",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "18500.00",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
  }
}

Response (Aggregator sends Account Event notification. As a result of buying BTC we have 0.01 BTC added to client’s balance, and the result is 9.9693 BTC)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "BTC",
    "balance": "9.96930000",
    "timestamp": 1521713495376,
    "action": "order",
    "id": "17065"
  }
}

Response (Aggregator sends Account Event notification after order have been executed. By now we know actual price and fee amounts. We’ve got a better deal than our previous approximation suggested. So current balance is 9174.76767930 which is more than 9161.57071930 that we had after funds were initially locked for the order)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "USD",
    "balance": "9174.76767930",
    "timestamp": 1521713495615,
    "action": "order",
    "id": "17065"
  }
}

Response (Aggregator sends final execution report. It has status FILLED, executed amount in currency 1 is equal to requested amount in currency 1. Average price is bigger than was requested for sell order (therefore limit order was executed immediately). Fee Amount field contains actual fee amount)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "17065",
    "clientOrderId": "1521713494191",
    "accountId": null,
    "status": "FILLED",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "BUY",
    "executedAmountCcy1": "0.01000000",
    "executedAmountCcy2": "173.04000000",
    "requestedAmountCcy1": "0.01000000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "v_overdraft_test",
    "executionType": "Trade",
    "executionId": "1521616998877_2_5",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "18500.00",
    "averagePrice": "17304.00",
    "lastQuantity": "0.01000000",
    "lastPrice": "17304.00",
    "feeAmount": "0.61304000",
    "feeCurrency": "USD"
  }
}

Do My New Order - Invalid request

Request (client requests to place a limit order with missing price field)

{
  "e": "do_my_new_order",
  "oid": "1521736196696_1_do_my_new_order",
  "data": {
    "clientOrderId": "1521736196695",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "BUY",
    "timestamp": 1521736196695,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "amountCcy1": "0.001",
    "destination": "cex-dev_CEX",
    "comment": "v_overdraft_test"
  }
}

Response (Aggregator sends response that has no field "ok" and has "data.error" field containing error description)

{
  "e": "do_my_new_order",
  "oid": "1521736196696_1_do_my_new_order",
  "data": {
    "error": "Mandatory parameter price is missing"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_my_new_order" value allowed
oid Yes String Unique ID of this request
clientOrderId No String Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API). If this field is absent, it will be set automatically to current timestamp in milliseconds.
accountId No String Client’s sub-account ID. If the value is empty string, then the order is created by Client’s main account.
currency1 Yes String Represents first currency in currency pair of this order
currency2 Yes String Represents second currency in currency pair of this order
side Yes String Represents side of this order (corresponds to field Side(54) in Execution Report(8) and in New Order Single (D) messages in FIX API)
orderType Yes String Represents order type of this order (corresponds to field OrdType(40) in Execution Report(8) and in New Order Single (D) messages in FIX API).
timestamp Yes String UTC timestamp in milliseconds, represents client-side order creation time(field TransactTime(60) in New Order Single(D) message in FIX API). Timestamp should be within 30000 ms timeframe with server time, otherwise, order will be rejected with the corresponding error. This value could also be referred as clientCreateTimestamp in other messages, e.g. in response to Orders request ("get_my_orders" message response).
timeInForce No String Represents time in force of this order (corresponds to field TimeInForce(59) in Execution Report(8) and in New Order Single (D) messages in FIX API. For details see "Order TimeInForce" section. This value can be null for orders where time in force is not applied, for example, for Market order.
comment No String Comment for order (field Text(58) in New Order Single(D) in FIX API). Maximum length of comment string is 255 characters. If value is null, then it means Client did not provide such text during order creation.
amountCcy1 No String (parseable as Float) Represents order amount in currency1 (corresponds to OrderQty(38) field in New Order Single(D) message in FIX API). This value can be null if order requests amount in currency2
amountCcy2 No String (parseable as Float) Represents order amount in currency1 (corresponds to OrderQty(152) field in New Order Single(D) message in FIX API). This value can be null if order requests amount in currency1
price Yes String (parseable as Float) Represents order price (corresponds to Price(44) field in New Order Single(D) message in FIX API). This value can be null for order where price cannot be requested, for example, Market orders or Stop orders.
expireTime Yes Number UTC timestamp in milliseconds (field ExpireTime(126) in New Order Single(D) message in FIX API). If Expire Time is in the past, order will be rejected with the corresponding error.
stopPrice No String (parseable as Float) Stop Price for Market and Stop and StopLimit orders types (StopPx in FIX)

Do My New Order Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_my_new_order" value allowed
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to.

Execution Report Events

After client sent the New Order request and it has been accepted by Aggregator, order execution starts. Order execution consists of certain events such as: order execution started, order was filled (or partially filled), order was rejected, order was cancelled. Aggregator sends Execution Reports to inform client about these events.

New Order Event Notification

Field Name Mandatory Format Description
e Yes String Describes the type of this message, only "executionReport" value allowed
messageType Yes String Describes the type of this message, only "executionReport" value allowed
clientId Yes String Client CompId
accountId Yes String Client’s sub-account ID who created the order. If the value is empty string, then the order was created by Client’s main account.
orderId Yes String Order identifier assigned by Aggregator (OrderID(37) field in Execution Report(8) message in FIX API)
clientOrderId Yes String Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API)
status Yes String Represents current execution status of this order (corresponds to field OrdStatus(39) field in Execution Report(8) message in FIX API).
currency1 Yes String Represents first currency in currency pair of the order
currency2 Yes String Represents second currency in currency pair of the order
side Yes String Represents side of this order (corresponds to field Side(54) in Execution Report(8) and in New Order Single (D) messages in FIX API)
orderType Yes String Represents order type of this order (corresponds to field OrdType(40) in Execution Report(8) and in New Order Single (D) messages in FIX API).
timeInForce Yes String Represents time in force of this order (corresponds to field TimeInForce(59) in Execution Report(8) and in New Order Single (D) messages in FIX API). For details see "Order TimeInForce" section. This value can be null for orders where time in force is not applied, for example, for Market order.
comment Yes String Text value that was provided by Client during order creation (in field Text(58) in New Order Single(D) in FIX API). If value is null, it means Client did not provide such text during order creation.
orderRejectReason No String Text field describing rejection reason. Often (but not always) it contains is a JSON representation of an object with two fields: "code" — numeric error code; "reason" — human readable error description. If value is null, that means there is no error description.
executedAmountCcy1 Yes String (which can be parsed as Float) Represents executed amount in currency1. If this value is 0, then it means there is no executed amount (order has no executions).
executedAmountCcy2 Yes String (which can be parsed as Float) Represents executed amount in currency2. If this value is 0, then it means there is no executed amount (order has no executions).
requestedAmountCcy1 Yes String (which can be parsed as Float) Represents order amount in currency1, which was requested by Client (corresponds to OrderQty(38) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested amount in currency1 (order should have then requested amount in currency2)
requestedAmountCcy2 Yes String (which can be parsed as Float) Represents order amount in currency2, which was requested by Client (corresponds to CashOrderQty(152) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested amount in currency2 (order should have then requested amount in currency1).
feeAmount Yes String (which can be parsed as Float) Represents order commission, which was charged for this order (corresponds to Commission(12) field in Execution Report(8) message in FIX API). If this value is 0, then it means there is no commission amount charged for this order so far.
feeCurrency Yes String Represents order commission currency (corresponds to CommCurrency(479) field in Execution Report(8) message in FIX API)
price Yes String (which can be parsed as Float) Represents order price, which was provided by Client during order creation (corresponds to Price(44) field in New Order Single(D) message in FIX API). If this value is null, then it means there is no requested price for this order. It happens for order where price cannot be requested, for example, Market orders or Stop orders.
averagePrice Yes String (which can be parsed as Float) Represents average order execution price (corresponds to AvgPx(6) field in Execution Report(8) message in FIX API). If this value is null, then it means there is no executed amount (order has no executions).
expireTime Yes Number UTC timestamp in milliseconds. Represents an expired timestamp provided by Client during creation of the order (field ExpireTime(126) in New Order Single(D) message in FIX API). If this value is null, then it means Client did not provide expire time during order creation.
effectiveTime Yes Number UTC timestamp in milliseconds. Represents an effective timestamp provided by Client during creation of the order (field EffectiveTime(168) in New Order Single(D) message in FIX API). If this value is null, then it means that Client did not provide effective time during order creation.
ok Yes String "ok" value represents that event notification is successfully generated.

Cancel Order

Client can cancel orders. Along with a response to this request, Aggregator sends Account Event and Execution Report messages to Client if this request is successful. Also, if request to cancel an order is declined, Aggregator sends Order Cancellation Rejection message.

Cancel My Order Request

Do Cancel My Order - successful cancellation of limit sell BTC order

Request (client requests to cancel order that was created with clientOrderId equal to "1521719532817")

{
  "e": "do_cancel_my_order",
  "oid": "1521719532817_2_do_cancel_my_order",
  "data": {
    "clientOrderId": "1521719532817",
    "cancelRequestId": "cancel_1521719532817",
    "timestamp": 1521719535310
  }
}

Response (Aggregator sends acknowledgement message confirming that the cancellation request is accepted)

{
  "e": "do_cancel_my_order",
  "oid": "1521719532817_2_do_cancel_my_order",
  "ok": "ok",
  "data": {}
}

Response (Aggregator sends Execution Report for order being cancelled. Now it’s in the state PENDING_CANCEL)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "17066",
    "clientOrderId": "cancel_1521719532817",
    "OrigClOrdID": "1521719532817",
    "accountId": null,
    "status": "PENDING_CANCEL",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.00010000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "v_overdraft_test",
    "executionType": "PendingCancel",
    "executionId": "1521616998877_2_7",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "18500.00",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
  }
}

Response (Aggregator sends Account Event notification. Funds that were previously locked for the order are now returned to the account’s balance)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "BTC",
    "balance": "9.96930000",
    "timestamp": 1521719535842,
    "action": "order",
    "id": "17066"
  }
}

Response (Aggregator sends final execution report. It specifies final order status CANCELLED, executed amounts are 0, fee has not been charged)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "17066",
    "clientOrderId": "cancel_1521719532817",
    "OrigClOrdID": "1521719532817",
    "accountId": null,
    "status": "CANCELLED",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.00010000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "v_overdraft_test",
    "executionType": "Canceled",
    "executionId": "1521616998877_2_8",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "18500.00",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
  }
}

Do Cancel My Order - invalid cancellation request

Request (Client requests to cancel order with clientOrderId equal to "omg_not_an_order_order" (that was never created))

{
  "e": "do_cancel_my_order",
  "oid": "1521723623618_1_do_cancel_my_order",
  "data": {
    "clientOrderId": "omg_not_an_order_order",
    "cancelRequestId": "cancel_omgorder",
    "timestamp": 1521723623618
  }
}

Response (Aggregator sends acknowledgement message confirming that the cancellation request is accepted)

{
  "e": "do_cancel_my_order",
  "oid": "1521723623618_1_do_cancel_my_order",
  "ok": "ok",
  "data": {}
}

Response (Aggregator sends orderCancelReject with reason "unknown_order")

{
  "e": "orderCancelReject",
  "ok": "ok",
  "data": {
    "messageType": "orderCancelReject",
    "clientId": "IT_DEMO",
    "orderId": "NONE",
    "cancelRequestId": "cancel_omgorder",
    "clientOrderId": "omg_not_an_order_order",
    "accountId": null,
    "orderStatus": "REJECTED",
    "responseTo": "order_cancel_request",
    "cancelRejectReason": "unknown_order"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_cancel_my_order" value is allowed here
oid Yes String Unique ID of this request
clientOrderId Yes String Order identifier assigned by Client when the order was created.
cancelRequestId No String Cancel request identifier assigned by Client.
timestamp Yes String Current client time - UTC timestamp in milliseconds.

Cancel My Order Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_cancel_my_order" value is allowed here
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to.

Order Cancellation Rejection event

If request to cancel an order is declined, Aggregator sends Order Cancellation Rejection message.

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "orderCancelReject" value is allowed here
ok Yes String Represents that event notification is successfully generated. Only "ok" value is allowed here
messageType Yes String Describes the type of this message. Only "orderCancelReject" value is allowed here
clientId Yes String Client CompId
accountId No String If order referenced by clientOrderId field in cancellation request was found, this field contains client’s sub-account ID, that was specified when the order was created. If order was not found, this field will not be included.
orderId Yes String If order referenced by clientOrderId field in cancellation request was found, this field contains order identifier assigned by Aggregator (OrderID(37) field in Execution Report(8) message in FIX API). If order was not found, this field will contain string "NONE".
clientOrderId Yes String Order identifier specified in cancellation request which should have matched with corresponding field of an existing order.
orderStatus Yes String Represents current execution status of this order (corresponds to field OrdStatus(39) field in Execution Report(8) message in FIX API). If order was not found, it contains value "REJECTED".
responseTo Yes String The type of request that caused sending this notification.
cancelRejectReason No String Textual description of reason for rejection.

Cancel All Orders

Client can cancel all open orders via WebSocket API. Along with a response to this request Aggregator will start cancellation process for all open orders and send corresponding Account Event and Execution Report messages to the Client.

Do Cancel All Orders Request

Do Cancel All Orders

Request (client requests to cancel all opened orders)

{
  "e": "do_cancel_all_orders",
  "oid": "1521711134776_1_do_cancel_all_orders",
  "data": {}
}

Response (Aggregator sends acknowledgement message confirming the list of client’s opened orders which system is trying to cancel. There are 2 opened orders in this case)

{
  "e": "do_cancel_all_orders",
  "oid": "1575459976724_1_do_cancel_all_orders",
  "ok": "ok",
  "data": {
    "clientOrderIds": ["1575459943138","1575459942041"]
  }
}

Response (Aggregator sends Execution Report for the first order being cancelled. Now it’s in the state PENDING_CANCEL)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "2284074",
    "clientOrderId": "CANCEL_IT_DEMO_2284074",
    "OrigClOrdID": "1575459943138",
    "accountId": null,
    "status": "PENDING_CANCEL",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.00100000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "cancel all orders test",
    "executionType": "PendingCancel",
    "executionId": "1574407721714_101_19759",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "12000.0",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
    }
}

Response (Aggregator sends Execution Report for the second order being cancelled. Now it’s in the state PENDING_CANCEL)

{
  "e": "executionReport",
  "ok":"ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "2284073",
    "clientOrderId": "CANCEL_IT_DEMO_2284073",
    "OrigClOrdID": "1575459942041",
    "accountId": null,
    "status": "PENDING_CANCEL",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.00100000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "cancel all orders test",
    "executionType": "PendingCancel",
    "executionId": "1574407716536_102_19009",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime":null,
    "price": "12000.0",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
  }
}

Response (Aggregator sends Account Event notification. Funds that were previously locked for the first order are now returned to the account’s balance)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "BTC",
    "balance": "0.16822000",
    "timestamp": 1575459977538,
    "action": "order",
    "id": "2284074"
  }
}

Response (Aggregator sends final execution report for the first order. It specifies final order status CANCELLED, executed amounts are 0, fee hasn’t been charged)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "2284074",
    "clientOrderId": "CANCEL_IT_DEMO_2284074",
    "OrigClOrdID": "1575459943138",
    "accountId": null,
    "status": "CANCELLED",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.00100000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "cancel all orders test",
    "executionType": "Canceled",
    "executionId": "1574407721714_101_19761",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "12000.0",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
  }
}

Response (Aggregator sends Account Event notification. Funds that were previously locked for the second order are now returned to the account’s balance)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "IT_DEMO",
    "accountId": "",
    "currency": "BTC",
    "balance": "0.17022000",
    "timestamp": 1575459977542,
    "action": "order",
    "id": "2284073"
  }
}

Response (Aggregator sends final execution report for the second order. It specifies final order status CANCELLED, executed amounts are 0, fee hasn’t been charged)

{
  "e": "executionReport",
  "ok": "ok",
  "data": {
    "messageType": "executionReport",
    "clientId": "IT_DEMO",
    "orderId": "2284073",
    "clientOrderId": "CANCEL_IT_DEMO_2284073",
    "OrigClOrdID": "1575459942041",
    "accountId": null,
    "status": "CANCELLED",
    "currency1": "BTC",
    "currency2": "USD",
    "side": "SELL",
    "executedAmountCcy1": "0.00000000",
    "executedAmountCcy2": "0.00000000",
    "requestedAmountCcy1": "0.00100000",
    "requestedAmountCcy2": null,
    "orderType": "Limit",
    "timeInForce": "GTC",
    "comment": "cancel all orders test",
    "executionType": "Canceled",
    "executionId": "1574407716536_102_19010",
    "transactTime": null,
    "expireTime": null,
    "effectiveTime": null,
    "price": "12000.0",
    "averagePrice": null,
    "feeAmount": "0.00000000",
    "feeCurrency": "USD"
  }
}

Do Cancel All Orders - There are no client’s opened orders

Request (client requests to cancel all opened orders)

{
  "e": "do_cancel_all_orders",
  "oid": "1521711134776_1_do_cancel_all_orders",
  "data": {}
}

Response (Aggregator sends acknowledgement message confirming there are no client’s opened orders)

{
  "e": "do_cancel_all_orders",
  "oid": "1575459976724_1_do_cancel_all_orders",
  "ok": "ok",
  "data": {
    "clientOrderIds": []
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_cancel_all_orders" value is allowed here
data Yes Object This object contains request details. It is empty object ("{}") in this case.
oid Yes String Unique ID of this request

Do Cancel All Orders Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_cancel_all_orders" value is allowed here
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
clientOrderIds Yes Array This object contains list of client’s open orders and system is trying to cancel those orders. It might be empty array([]). If this array is empty, then it means there are no client’s open orders
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Execution Report Events

After client sent Cancel All Orders request and it has been accepted by Aggregator, orders cancellation starts. Orders cancellation consists of certain events such as: order is pending cancellation, order is cancelled, order cancellation is rejected. Aggregator sends Execution Reports to inform client about these events. Please refer to execution report specification described on FIX section.

Get Exchange Rate

Estimates exchange rate for given order parameters.

This is a short explanation of what this query means: If client creates an order with specified side (SELL or BUY) to convert given amount of currency to counterCurrency, what exchange rate (price) will be and what amount of counterCurrency will be used for this conversion. This estimation is based on order parameters provided in request and on current market data for given currency pair.

Get Exchange Rate Request

Get Exchange Rate request for sell order for BTC-EUR currency pair

Request (client queries order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521724219900_1_get_exchange_rate",
  "data": {
    "amount": "100",
    "currency": "EUR", // as a result of order execution 100 EUR should be earned
    "counterCurrency": "BTC", // currency pair BTC-EUR
    "side": "SELL" // sell order
  }
}

Response (Aggregator responds with expected order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521724219900_1_get_exchange_rate",
  "ok": "ok",
  "data": {
    "side": "SELL",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "EUR",
    "amount": "100.00000000",
    "counterAmount": "0.01251", // 0.01251 BTC will be sold at price 7993.60 to get 100 EUR
    "counterCurrency": "BTC",
    "price": "7993.60"
  }
}

Get Exchange Rate successful request for sell order for BTC-EUR currency pair

Request (client queries order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521814467767_1_get_exchange_rate",
  "data": {
    "amount": "0.1", // 0.1 BTC should be sold
    "currency": "BTC",
    "counterCurrency": "EUR", // currency pair BTC-EUR
    "side": "SELL" // sell order
  }
}

Response (Aggregator responds with expected order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521814467767_1_get_exchange_rate",
  "ok": "ok",
  "data": {
    "side": "SELL",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "BTC",
    "amount": "0.10000000",
    "counterAmount": "799.00000000", // 0.1 BTC will be sold at price 7990.00, 799 EUR will be earned
    "counterCurrency": "EUR",
    "price": "7990.00"
  }
}

Get Exchange Rate request for buy order for BTC-EUR currency pair

Request (client queries order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521814339144_1_get_exchange_rate",
  "data": {
    "amount": "100", // as a result of order execution 100 EUR should be spent
    "currency": "EUR",
    "counterCurrency": "BTC", // currency pair BTC-EUR
    "side": "BUY" // buy order
  }
}

Response (Aggregator responds with expected order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521814339144_1_get_exchange_rate",
  "ok": "ok",
  "data": {
    "side": "BUY",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "EUR",
    "amount": "100.00000000",
    "counterAmount": "0.01250", // 0.01250 BTC will be bought at price 8000.0 for 100 EUR
    "counterCurrency": "BTC",
    "price": "8000.00"
  }
}

Get Exchange Rate successful request for buy order for BTC-EUR currency pair

Request (client queries order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521814379863_1_get_exchange_rate",
  "data": {
    "amount": "0.1", // 0.1 BTC should be bought
    "currency": "BTC",
    "counterCurrency": "EUR", // currency pair BTC-EUR
    "side": "BUY" // buy order
  }
}

Response (Aggregator responds with expected order parameters)

{
  "e": "get_exchange_rate",
  "oid": "1521814379863_1_get_exchange_rate",
  "ok": "ok",
  "data": {
    "side": "BUY",
    "pair": "BTC-EUR", // pair is BTC-EUR
    "currency": "BTC",
    "amount": "0.10000000",
    "counterAmount": "800.00000000", // 0.1 BTC will be bought at price 8000.0, 800 EUR will be spent
    "counterCurrency": "EUR",
    "price": "8000.00"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_exchange_rate" value is allowed here
oid Yes String Unique ID of this request
side Yes String Side of the order the rate would be estimated for. Allowed values - "BUY", "SELL"
currency Yes String Currency to be converted from.
counterCurrency Yes String Currency to be converted to.
amount Yes String parseable as float Amount of "currency" to be converted.

Get Exchange Rate Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_exchange_rate" value is allowed here
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
side Yes String Side of the order as was specified in request. Allowed values - "BUY", "SELL"
currency Yes String Currency to be converted from as specified in request.
counterCurrency Yes String Currency to be converted to as specified in request.
amount Yes String parseable as float Amount of "currency" to be converted as specified in request.
pair Yes String Currency pair being used in conversion.
price Yes String parseable as float Estimated price for requested order parameters and current market data.
counterAmount Yes String parseable as float Amount of "counterCurrency" the conversion would expectedly result in.
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Get Current Rates

This request allows Client to find out current best bid and best ask for configured pairs. Using this request, Client can see current rates for all configured pairs or specific pairs.

Get Current Rates Request

Get Current Rates Request for all configured pairs

Request (Client queries current rates for all configured pairs)

{
  "e":"get_current_rates",
  "oid":"1521724219900_1_get_current_rates",
  "data":{}
}

Response (Aggregator responds with current rates for all configured pairs)

{
  "e": "get_current_rates",
  "oid": "1521724219900_1_get_current_rates",
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "bestBid": "8660.0",
      "bestAsk": "8670.0"
    },
    "ETH-BTC": {
      "bestBid": "162.0",
      "bestAsk": "163.0"
    },
    "LTC-BTC": {
      "bestBid": "0.00667",
      "bestAsk": "0.00669"
    }
  }
}

Get Current Rates Request for specific pairs

Request (Client queries current rates for the following pairs: BTC-USD, ETH-BTC)

{
  "e": "get_current_rates",
  "oid": "1521724219900_1_get_current_rates",
  "data": {
    "pairs": [
      "BTC-USD",
      "ETH-BTC"
    ]
  }
}

Response (Aggregator responds with current rates for BTC-USD, ETH-BTC. There is no any ask in order book for ETH-BTC.)

{
  "e": "get_current_rates",
  "oid": "1521724219900_1_get_current_rates",
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "bestBid": "8660.0",
      "bestAsk": "8670.0"
    },
    "ETH-BTC": {
      "bestBid": "162.0",
      "bestAsk": null
    }
  }
}

Get Current Rates Request for specific pairs where one pair is unsupported

Request (Client queries current rates for the following pairs: BTC-USD, ETH-BTC, DASH-BTC)

{
  "e": "get_current_rates",
  "oid": "1521724219900_1_get_current_rates",
  "data": {
    "pairs": [
      "BTC-USD",
      "ETH-BTC",
      "DASH-BTC"
    ]
  }
}

Response (Aggregator responds with current rates for BTC-USD, ETH-BTC. Pair DASH-BTC is unsupported for Client, so there are no rates in the response.)

{
  "e": "get_current_rates",
  "oid": "1521724219900_1_get_current_rates",
  "ok": "ok",
  "data": {
    "BTC-USD": {
      "bestBid": "8660.0",
      "bestAsk": "8670.0"
    },
    "ETH-BTC": {
      "bestBid": "162.0",
      "bestAsk": "163.0"
    },
    "DASH-BTC": {
      "error": "unsupported pair"
    }
  }
}

Get Current Rates Request - Incorrect Request

Request (Client sends request, however the value of the field “data” is not a valid JSON object)

{
  "e":"get_current_rates",
  "oid":"1521724219900_1_get_current_rates",
  "data": null
}

Response (Aggregator responds to Client that error happened when processing his request.)

{
  "e": "get_current_rates",
  "oid": "1521724219900_1_get_current_rates",
  "data": {
    "error": "Internal error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_current_rates" value is allowed here
oid Yes String Unique ID of this request
data Yes Object This object contains request details.
pairs No Array The list of specific pairs which rates are required. It might be empty object("{}"), which means that Client wants to receive current rates for all configured pairs.

Get Current Rates Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_current_rates" value is allowed here
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data Yes Object This object contains current rates, which satisfies request criteria.
bestBid No String Best bid price for specific pair. It could be "null" in case there is no any bid in order book
bestAsk No String Best ask price for specific pair. It could be "null" in case there is no any ask in order book
error No String This field is present in case requested pair is unsupported for Client or there is any error with pair configuration. Allowed values: "unsupported pair", "InternalError"
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Transaction History

This request allows Client to find out their historical financial transactions (deposits, withdrawals, internal transfers or trades).

Get My Transaction History Request

Get My Transaction History - For Main Account with specified period

Request (Client sends request to find their transactions for the main account with specified period)

{
  "e":"get_my_transaction_history",
  "oid":"1465501899597_1_get_my_transaction_history",
  "data":{
    "accountId": "",
    "operationType": "",
    "pageSize": 10,
    "pageNumber": 1,
    "dateTo": 1592238247933,
    "dateFrom": 1592238207039,
    "sortOrder": "ASC"
    }
}

Response

{
  "e": "get_my_transaction_history",
  "oid": "1465501899597_1_get_my_transaction_history",
  "ok": "ok",
  "data": [
    { 
      "timestamp": "2020-06-15 16:23:28.614",
      "accountId": "",
      "type": "trade",
      "amount": "200000",
      "details": "Finalization Trade orderId='22752' for DEMO_USER",
      "currency": "BTC" 
    },
    {   
      "timestamp": "2020-06-15 16:23:28.614",
      "accountId": "",
      "type": "trade",
      "amount": "-1873840000",
      "details": "Finalization Trade orderId='22752' for DEMO_USER",
      "currency": "USD" 
    },
    { 
      "timestamp": "2020-06-15 16:23:28.622",
      "accountId": "",
      "type": "commission",
      "amount": "-4684600",
      "details": "Commission for orderId='22752' for DEMO_USER",
      "currency": "USD" 
    }     
  ]
}

Get My Transaction History - For Main Account with Paging

Request (Client sends request to find their transactions for the main account and wants to see second page expecting the result set is chunked to pages size 2 (not more than 2 transactions per page))

{
  "e":"get_my_transaction_history",
  "oid":"1465501899597_1_get_my_transaction_history",
  "data":{
    "accountId": "",
    "operationType": "",
    "pageSize": 2,
    "pageNumber": 1,
    "sortOrder": "DESC"
    }
}

Response

{
  "e": "get_my_transaction_history",
  "oid": "1465501899597_1_get_my_transaction_history",
  "ok": "ok",
  "data": [
    {
      "timestamp": "2020-07-02 16:29:43.546",
      "accountId": "",
      "type": "commission",
      "amount": "-203966075",
      "details": "Commission for orderId='24206' for DEMO_USER",
      "currency": "USD" 
    },
    {
      "timestamp": "2020-07-02 16:29:43.538",
      "accountId": "",
      "type": "trade",
      "amount": "-10000000",
      "details": "Finalization Trade orderId='24206' for DEMO_USER",
      "currency": "BTC"
    }
  ]
}

Get My Transaction History - Deposit Transactions for Main Account

Request (Client sends request to find all their deposit transactions for main account)

{
  "e":"get_my_transaction_history",
  "oid":"1465501899597_1_get_my_transaction_history",
  "data":{
    "accountId": "",
    "operationType": "deposit",
    "sortOrder": "DESC"
    }
}

Response

{
  "e": "get_my_transaction_history",
  "oid": "1465501899597_1_get_my_transaction_history",
  "ok": "ok",
  "data": [
    {
      "timestamp": "2020-06-22 14:56:21.875",
      "accountId": "",
      "type": "deposit",
      "amount": "3000000",
      "details": "Deposit depositId=135704316 for DEMO_USER",
      "currency": "BTC"
    }
  ]
}

Get My Transaction History - For non-existing sub-account

Request (Client sends request for non-existing sub-account)

{
  "e":"get_my_transaction_history",
  "oid":"1465501899597_1_get_my_transaction_history",
  "data":{
    "accountId": "nonExistingAcc"
    }
}

Response

{
  "e": "get_my_transaction_history",
  "oid": "1465501899597_1_get_my_transaction_history",
  "ok": "ok",
  "data": []
}

Get My Transaction History - Incorrect "operationType" parameter

Request (Client sends request with incorrect "operationType" parameter)

{
  "e":"get_my_transaction_history",
  "oid":"1465501899597_1_get_my_transaction_history",
  "data":{
    "accountId": "",
    "operationType": "limitOrder"
    }
}

Response

{
  "e": "get_my_transaction_history",
  "oid": "1465501899597_1_get_my_transaction_history",
  "data": {
    "error": "Operation type is not supported. Supported types: trade,commission,deposit,withdraw,internalTransfer"
  }
}

Get My Transaction History - Page size is more than 100

Request

{
  "e":"get_my_transaction_history",
  "oid":"1465501899597_1_get_my_transaction_history",
  "data":{
    "accountId": "",
    "operationType": "",
    "pageSize": 150,
    "pageNumber": 1
    }
}

Response

{
  "e": "get_my_transaction_history",
  "oid": "1465501899597_1_get_my_transaction_history",
  "data": {
    "error": "Page size is limited to 100 items"
  }
}

Get My Transaction History - For Incorrect Request

Request (Client sends request to find their transactions, but mandatory "data" field is missing)

{
  "e":"get_my_transaction_history",
  "oid":"1465501899597_1_get_my_transaction_history"
}

Response

{
  "e": "get_my_transaction_history",
  "oid": "1465501899597_1_get_my_transaction_history",
  "data": {
    "error": "Internal error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_transaction_history" value is allowed here
data Yes Object This object contains request details. It might be empty object("{}"), which means that Client sets no criteria for transactions which Client wants to see. However, this field should be present anyway and it should contain an object. Setting no criteria for transactions means that Client wants to get all transactions for the main account and all sub-accounts.
accountId No String Account identifier, for which Client wants to find their transactions. Empty string ("") or null value in this field represents Client’s main account. If this field is missing, then it means Client wants to find transactions for the main account and all sub-accounts.
operationType No String If this field is present, then it means Client wants to get only transactions related to specified operation type. Allowed values are "trade", "deposit", "withdraw", "internalTransfer, "commission". If this field is missing, then it means Client wants to get transactions for all operation types.
dateFrom No Number UTC timestamp in milliseconds. Represents the earliest moment in time when transactions were created. In the result set transactions’ timestamp field value should be greater then or equal to (>=) dateFrom.
dateTo No Number UTC timestamp in milliseconds. Represents the latest moment in time when transactions were created. In the result set transactions’ timestamp field value should be less then (<) dateTo.
sortOrder No String Sort order of the result set. The result array is sorted by "timestamp" field. Allowed values: "ASC" - ascending order, "DESC" - descending order. If this field is missing then the default sort order is "DESC", so recently created transactions come first and oldest transactions come last.
pageSize No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request. If this field is missing, then the default value of 100 is used. This value cannot be greater than 100.
pageNumber No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. Result list is chunked into pages for not more than data.pageSize transactions per each page. This parameter specifies, which page number of the result set Client wants to see as the response to this request. First page number is 0. If this field is missing, then the default value of 0 is used. This value cannot be lower then 0.
oid Yes String Unique ID of this request.

Get My Transaction History Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_transaction_history" value is allowed here
data Yes Array or Object This object contains list of transactions, which satisfies request criteria. It might be empty array([]). If this array is empty, then it means there are no transactions, which satisfy Client’s request criteria. In case of error, the value of this filed should be not Array, but Object.
timestamp Yes Datetime Represents server timestamp when this transaction happened. Format: YYYY-MM-DD HH:MM:SS.sss
accountId Yes String Represents the Account ID.
type Yes String Represents the type of this operation. Allowed values are "trade", "deposit", "withdraw", "internalTransfer", "commission".
amount Yes String (which can be parsed as Float) Represents amount of the transaction.
details Yes String Represents transaction details.
currency Yes String Represents the currency of the transaction.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Funding History

This request allows Client to find out their historical deposit and withdrawal transactions. It includes deposit or withdrawal amount, commission amount. It does not include information about internal transfers (transfers between Client’s account).

Get My Funding History Request

Get My Funding History - For Main Account and all sub-accounts

Request (Client sends request to find their deposit/withdrawal transactions for the main account and all sub-accounts.)

{
  "e":"get_my_funding_history",
  "oid":"1465501899597_1_get_my_funding_history",
  "data":{}
}

Response (Aggregator responds that Client has 2 withdrawal transactions (1 withdrawal from sub-account and 1 withdrawal from main account) and 3 deposit transactions (2 deposits to sub-accounts and 1 deposit to main account))

{
  "e": "get_my_funding_history",
  "oid": "1465501899597_1_get_my_funding_history",
  "ok": "ok",
  "data": [
    {
      "txId": 148126,
      "clientId": "TestClient",
      "accountId": "100107_test",
      "currency": "BTC",
      "direction": "withdraw",
      "amount": "81.04000000",
      "commissionAmount": "1.14000000",
      "status": "approved",
      "updatedAt": 1465300456887
    },
    {
      "txId": 148127,
      "clientId": "TestClient",
      "accountId": "",
      "currency": "BTC",
      "direction": "withdraw",
      "amount": "11.34000000",
      "commissionAmount": "0.14000000",
      "status": "approved",
      "updatedAt": 1465300456889
    },
    {
      "txId": 148128,
      "clientId": "TestClient",
      "accountId": "100108_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "15.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300456900
    },
    {
      "txId": 148129,
      "clientId": "TestClient",
      "accountId": "100109_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    },
    {
      "txId": 148130,
      "clientId": "TestClient",
      "accountId": "",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    }
  ]
}

Get My Funding History - For Main Account and all Sub-accounts with Paging

Request (Client sends request to find their deposit/withdrawal transactions for the main account and all sub-accounts and wants to see second page expecting the result set is chunked to pages size 2 (not more than 2 transactions per page))

{
  "e": "get_my_funding_history",
  "oid": "1465501899597_1_get_my_funding_history",
  "data": {
    "pageSize": 2,
    "pageNumber": 1
  }
}

Response (Supposed that Client has 5 transactions (like in previous example), Aggregator responds with second page, which includes 2 transactions.)

{
  "e": "get_my_funding_history",
  "oid": "1465501899597_1_get_my_funding_history",
  "ok": "ok",
  "data": [
    {
      "txId": 148128,
      "clientId": "TestClient",
      "accountId": "100108_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "15.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300456900
    },
    {
      "txId": 148129,
      "clientId": "TestClient",
      "accountId": "100109_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    }
  ]
}

Get My Funding History - For Specified Sub-Account

Request (Client sends request to find their deposit/withdrawal transactions for specified sub-account.)

{
  "e": "get_my_funding_history",
  "oid": "1465501899597_1_get_my_funding_history",
  "data": {
    "accountId": "100109_test"
  }
}

Response (Aggregator responds with deposit/withdrawal transactions for specified sub-account)

{
  "e": "get_my_funding_history",
  "oid": "1465501899597_1_get_my_funding_history",
  "ok": "ok",
  "data": [
    {
      "txId": 148129,
      "clientId": "TestClient",
      "accountId": "100109_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "55.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300457000
    }
  ]
}

Get My Funding History - Deposit Transactions for Main Account and all Sub-accounts with specified Period

Request (Client sends request to find all their deposit transactions for main account and all sub-accounts, which happened between specified period)

{
  "e": "get_my_funding_history",
  "oid": "1465501899597_1_get_my_funding_history",
  "data": {
    "direction": "deposit",
    "dateFrom": 1464976020000,
    "dateTo": 1464978000000
  }
}

Response (Aggregator responds that Client has only one transaction, which satisfies criteria)

{
  "e": "get_my_funding_history",
  "oid": "1465501899597_1_get_my_funding_history",
  "ok": "ok",
  "data": [
    {
      "txId": 148128,
      "clientId": "TestClient",
      "accountId": "100108_test",
      "currency": "BTC",
      "direction": "deposit",
      "amount": "15.34000000",
      "commissionAmount": "0.00000000",
      "status": "approved",
      "updatedAt": 1465300456900
    }
  ]
}

Get My Funding History - For Incorrect Request

Request (Client sends request to find some deposit/withdrawal transactions, but mandatory "data" field is missing)

{
  "e":"get_my_funding_history",
  "oid":"1465567380491_1_get_my_funding_history"
}

Response (Aggregator responds to Client that such request is not allowed)

{
  "e": "get_my_funding_history",
  "oid": "1465567380491_1_get_my_funding_history",
  "data": {
    "error": "Internal error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_funding_history" value is allowed here
data Yes Object This object contains request details. It might be empty object("{}"), which means that Client sets no criteria for transactions which Client wants to see. However, this field should be present anyway and it should contain an object. Setting no criteria for transactions means that Client wants to get all deposits and withdrawals for the main account and all sub-accounts.
accountId No String Account identifier, for which Client wants to find their transactions. Empty string ("") or null value in this field represents Client’s main account. If this field is missing, then it means Client wants to find deposits and withdrawals for the main account and all sub-accounts.
txId No Number Transaction identifier. If this field is present, then it means Client wants to get information only for specified transaction.
direction No String If this field is present, then it means Client wants to get only transactions related to specified operation type. If this field is missing, then it means Client wants to get all deposits and withdrawals. Allowed values: "deposit", "withdraw"
currency No String If this field is present, then it means Client wants to get only transactions in the specified currency. If this field is missing, then it means Client wants to get deposits/withdrawals in all currencies.
dateFrom No Number UTC timestamp in milliseconds. Represents the earliest moment in time when transactions were created. In the result set transactions’ timestamp field value should be greater then or equal to (>=) dateFrom.
dateTo No Number UTC timestamp in milliseconds. Represents the latest moment in time when transactions were created. In the result set transactions’ timestamp field value should be less then (<) dateTo.
pageSize No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request. If this field is missing, then the default value of 100 is used. This value cannot be greater than 100.
pageNumber No Number Because the result might contain too many transactions, Client should specify, which portion of the result list they want to get as a response to this request. Result list is chunked into pages for not more than data.pageSize transactions per each page. This parameter specifies, which page number of the result set Client wants to see as the response to this request. First page number is 0. If this field is missing, then the default value of 0 is used. This value cannot be lower then 0.
oid Yes String Unique ID of this request.

Get My Funding History Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_my_funding_history" value is allowed here
data Yes Array or Object This object contains list of transactions, which satisfies request criteria. It might be empty array([]). If this array is empty, then it means there are no transactions, which satisfy Client’s request criteria. In case of error, the value of this filed should be not Array, but Object.
txId Yes Number Unique ID of the transaction.
clientId Yes String Represents the Client’s name.
accountId Yes String Represents the Account ID.
currency Yes String Represents the currency of the transaction.
direction Yes String Represents the type of this operation. Allowed values: "deposit", "withdraw"
amount Yes String (which can be parsed as Float) Represents amount of the transaction.
commissionAmount Yes String (which can be parsed as Float) Represents commission amount of the transaction.
status Yes String Represents the status of the transaction.
updatedAt Yes Number UTC timestamp in milliseconds. Represents server timestamp when this transaction happened.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Internal Transfer

Client can request to transfer money between their sub-accounts or between their main account and sub-account. Aggregator does not charge Client any commission for transferring funds between their accounts. Along with a response to this request, Aggregator sends Account Event messages to Client if this request is successful.

Do My Internal Transfer Request

Do My Internal Transfer - Create a New Sub-account

Request (Client requests to transfer 20 USD from the main account to sub-account "superhat". This sub-account does not exist yet, so such successful transfer action will create this sub-account.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465569412116_1_do_my_internal_transfer",
  "data": {
    "fromAccountId": "",
    "toAccountId": "superhat",
    "amount": 20,
    "currency": "USD"
  }
}

Response (Aggregator responds to Client that internal transfer operation was successful and shows transactionId of this transfer.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465569412116_1_do_my_internal_transfer",
  "ok": "ok",
  "data": {
    "transactionId": 667
  }
}

Response (Because successful internal transfer modifies Client’s main account, Aggregator sends Account Event notification about it, and includes main account snapshot after internal transfer.)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "BitFok",
    "accountId": "",
    "currency": "USD",
    "balance": "183.52797075",
    "timestamp": 1465557609146,
    "action": "internalTransfer",
    "id": 667
  }
}

Response (Because successful internal transfer modifies Client’s "superhat" sub-account, Aggregator sends Account Event notification about it, and includes sub-account snapshot after internal transfer.)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "BitFok",
    "accountId": "superhat",
    "currency": "USD",
    "balance": "20.00000000",
    "timestamp": 1465569413260,
    "action": "internalTransfer",
    "id": 667
  }
}

Do My Internal Transfer - Transfer Between Sub-accounts

Request (Client requests to transfer 2 USD from sub-account "superhat" to sub-account "hallo". Note that "amount" field is String in this request and is allowed as well Float.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465572149539_1_do_my_internal_transfer",
  "data": {
    "fromAccountId": "superhat",
    "toAccountId": "hallo",
    "amount": "2",
    "currency": "USD"
  }
}

Response (Aggregator sends Account Event notification event before the response. New "superhat" balance is 18 USD.)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "BitFok",
    "accountId": "superhat",
    "currency": "USD",
    "balance": "18.00000000",
    "timestamp": 1465569413260,
    "action": "internalTransfer",
    "id": 672
  }
}

Response (Aggregator responds to Client that internal transfer operation was successful and shows transactionId of this transfer.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465572149539_1_do_my_internal_transfer",
  "ok": "ok",
  "data": {
    "transactionId": 672
  }
}

Response (Aggregator sends Account Event notification event before the response. New "hallo" balance is 2 USD.)

{
  "e": "account_update",
  "ok": "ok",
  "data": {
    "clientId": "BitFok",
    "accountId": "hallo",
    "currency": "USD",
    "balance": "2.00000000",
    "timestamp": 1456839391786,
    "action": "internalTransfer",
    "id": 672
  }
}

Do My Internal Transfer - Insufficient Funds

Request (Client requests to transfer 180 USD from sub-account "superhat" to sub-account "hallo", but there are only 18 USD on "superhat" sub-account.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573018233_1_do_my_internal_transfer",
  "data": {
    "fromAccountId": "superhat",
    "toAccountId": "hallo",
    "amount": 180,
    "currency": "USD"
  }
}

Response (Aggregator responds that Client has insufficient funds on their "superhat" sub-account. So the internal transfer was rejected, balances did not change.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573018233_1_do_my_internal_transfer",
  "data": {
    "error": "Insufficient funds"
  }
}

Do My Internal Transfer - Incorrect Amount

Request (Client requests to transfer -10 USD from sub-account "superhat" to sub-account "hallo", but amount is <0, which is not allowed.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573131917_1_do_my_internal_transfer",
  "data": {
    "fromAccountId": "superhat",
    "toAccountId": "hallo",
    "amount": "-10",
    "currency": "USD"
  }
}

Response (Aggregator responds to Client that such request is not allowed.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573131917_1_do_my_internal_transfer",
  "data": {
    "error": "Amount should be greater than zero"
  }
}

Do My Internal Transfer - Incorrect AccountId

Request (Client requests to transfer 10 USD to sub-account "hallo", but did not specify, from which account.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573587788_1_do_my_internal_transfer",
  "data": {
    "toAccountId": "hallo",
    "amount": 10,
    "currency": "USD"
  }
}

Response (Aggregator responds to Client that such request is not allowed.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573587788_1_do_my_internal_transfer",
  "data": {
    "error": "Mandatory parameter fromAccountId is missing"
  }
}

Do My Internal Transfer - Same fromAccountId and toAccountId

Request (Client requests to transfer 10 USD from sub-account "superhat" to sub-account "superhat" (same account))

{
  "e": "do_my_internal_transfer",
  "oid": "1465573725661_1_do_my_internal_transfer",
  "data": {
    "fromAccountId": "superhat",
    "toAccountId": "superhat",
    "amount": 10,
    "currency": "USD"
  }
}

Response (Aggregator responds to Client that such request is not allowed.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573725661_1_do_my_internal_transfer",
  "data": {
    "error": "fromAccountId and toAccountId should be different"
  }
}

Do My Internal Transfer - Do My Internal Transfer - Wrong Currency

Request (Client requests to transfer 10 ABC from sub-account "superhat" to main account. However, ABC is not a valid currency.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573926410_1_do_my_internal_transfer",
  "data": {
    "fromAccountId": "superhat",
    "toAccountId": "",
    "amount": 20,
    "currency": "ABC"
  }
}

Response (Aggregator responds to Client that such request is not allowed.)

{
  "e": "do_my_internal_transfer",
  "oid": "1465573926410_1_do_my_internal_transfer",
  "data": {
    "error": "Internal error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_my_internal_transfer" value is allowed here
fromAccountId Yes String Account identifier, from which Client wants to transfer funds. Empty string ("") value in this field represents Client’s main account.
toAccountId Yes String Account identifier, to which Client wants to transfer funds. Empty string ("") value in this field represents Client’s main account.
currency Yes String Currency of internal transfer.
amount Yes Float (or String which can be parsed as Float) Amount of the transaction. It should be greater then 0
oid Yes String Unique ID of this request.

Do My Internal Transfer Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_my_internal_transfer" value is allowed here
transactionId No Number Unique identifier of successful internal transfer transaction.
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. . Only "ok" value is allowed here
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Get Deposit Address

Request for receiving a crypto address for deposit.

Get Deposit Address Request

Get Deposit Address Request for main account (BTC)

Request (Client queries deposit address)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "data": {
    "accountId": "", // main account
    "currency": "BTC" // currency "BTC"
  }
}

Response (Aggregator responds with information about crypto address for deposit)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "ok": "ok",
  "data": {
    "accountId": "",
    "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
    "currency": "BTC"
  }
}

Get Deposit Address Request for client’s sub account (BTC)

Request (Client queries deposit address)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "data": {
    "accountId": "superhat", // subaccount "superhat"
    "currency": "BTC" // currency "BTC"
  }
}

Response (Aggregator responds with information about crypto address for deposit)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "ok": "ok",
  "data": {
    "accountId": "superhat",
    "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
    "currency": "BTC"
  }
}

Get Deposit Address Request for client’s sub account (XRP)

Request (Client queries deposit address)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "data": {
    "accountId": "superhat", // subaccount "superhat"
    "currency": "XRP" // currency "XRP"
  }
}

Response (Aggregator responds with information for XRP deposit)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "ok": "ok",
  "data": {
    "accountId": "superhat",
    "destination": "rE1sdh25BJQ3qFwngiTBwaq3zPGGYcrjp1",
    "memo": "65629",
    "currency": "XRP"
  }
}

Get Deposit Address - Invalid currency

Request (Client queries deposit address)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "data": {
    "accountId": "",
    "currency": "ETC"
  }
}

Response (Aggregator responds that error occurred because unsupported currency is specified in the request.)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "data": {
    "error": "Provided currency is not supported for manual deposits"
  }
}

Get Deposit Address - Internal Error

Request (Client queries deposit address)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "data": {
    "accountId": "",
    "currency": "BTC"
  }
}

Response (Aggregator responds that error occurred.)

{
  "e": "get_deposit_address",
  "oid": "1521724219900_1_get_deposit_address",
  "data": {
    "error": "Internal error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_deposit_address" value is allowed here
oid Yes String Unique ID of this request.
accountId Yes String Account identifier, to which Client wants to make a deposit. Empty string ("") in this field represents Client’s main account.
currency Yes String Cryptocurrency name.

Get Deposit Address Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_deposit_address" value is allowed here
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
accountId Yes String Account identifier, to which Client wants to make a deposit.
address No String Crypto address for deposit. Please be informed that destination and memo fields are used for ledger cryptocurrencies (XRP, XLM, ATOM).
destination No String Destination address for deposit used for ledger cryptocurrencies (XRP, XLM, ATOM).
memo No String A special identifier used for ledger cryptocurrencies (XRP, XLM, ATOM).
currency Yes String Cryptocurrency name.
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Funds Withdrawal

Client can withdraw funds from Aggregator account to external crypto address.

Funds Withdrawal Request

Funds Withdrawal Request from main account (BTC)

Request (Client queries withdrawal to the crypto address via blockchain)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "data": {
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
  }
}

Response (Aggregator responds with information about withdrawal transaction)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "ok": "ok",
  "data": {
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "status": "pending",
    "instrument": "crypto"
  }
}

Funds Withdrawal Request from client’s sub account (XRP)

Request (Client queries withdrawal with destination and memo parameters (memo parameter for XRP must be of type integer))

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "data": {
    "accountId": "superhat",
    "clientTxId": "1223372036854775807",
    "currency": "XRP",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "destination": "rLHzPsX6oXkzU2qL12kHCH8G8cnZv1rBJh",
      "memo": 1318266718
    }
  }
}

Response (Aggregator responds with information about withdrawal transaction)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "ok": "ok",
  "data": {
    "clientTxId": "1223372036854775807",
    "currency": "XRP",
    "status": "pending",
    "instrument": "crypto"
  }
}

Funds Withdrawal Request - Duplicated Transaction

Request (Client queries withdrawal to the crypto address via blockchain)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "data": {
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
  }
}

Response (Aggregator responds with information about withdrawal transaction)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "ok": "ok",
  "data": {
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "status": "pending",
    "instrument": "crypto"
  }
}

Request (Client queries withdrawal transaction with the same clientTxId)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219999_1_do_withdrawal_funds",
  "data": {
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
  }
}

Response (Aggregator responds with processing error because withdrawal transaction with the same clientTxId has been already created.)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219999_1_do_withdrawal_funds",
  "data": {
    "error": "processing error"
  }
}

Funds Withdrawal Request - Insufficient funds

Request (Client queries withdrawal to the crypto address via blockchain)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "data": {
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
  }
}

Response (Aggregator responds that withdrawal transaction is not created because of insufficient funds.)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "data": {
    "error": "Insufficient funds"
  }
}

Funds Withdrawal Request - Internal Error

Request (Client queries withdrawal to the crypto address via blockchain)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "data": {
    "accountId": "",
    "clientTxId": "1223372036854775807",
    "currency": "BTC",
    "amount": "29.87",
    "instrument": "crypto",
    "parameters": {
      "address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
    }
  }
}

Response (Aggregator responds that error occurred.)

{
  "e": "do_withdrawal_funds",
  "oid": "1521724219900_1_do_withdrawal_funds",
  "data": {
    "error": "Internal error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_withdrawal_funds" value is allowed here
oid Yes String Unique ID of this request.
clientTxId Yes String Transaction identifier assigned by Client.
accountId No String Account identifier, from which Client wants to withdraw funds. Empty string ("") or null value in this field represents Client’s main account. If this field is missing, then it means Client wants to withdraw funds from the main account.
currency Yes String Cryptocurrency name.
amount Yes Float (or String which can be parsed as Float) Amount of the transaction.
instrument Yes String Describes instrument for withdrawal transaction. Allowed value: "crypto". Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain.
amount Yes Float (or String which can be parsed as Float) Amount of the transaction.
parameters. address No String Crypto address for withdrawal. Please be informed that destination and memo fields are used for ledger cryptocurrencies (XRP, XLM, ATOM).
parameters. destination No String Destination address for withdrawal used for ledger cryptocurrencies (XRP, XLM, ATOM).
parameters. memo No String (or Integer for XRP cryptocurrency) A special identifier for withdrawal used for ledger cryptocurrencies (XRP, XLM, ATOM).

Funds Withdrawal Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "do_withdrawal_funds" value is allowed here
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
clientTxId Yes String Transaction identifier assigned by Client.
currency Yes String Cryptocurrency name.
status Yes String Withdrawal transaction status. Allowed values: "rejected", "pending", "approved". Please check transaction status via get_withdrawal_status method in case status "pending" is received in the response.
instrument Yes String Describes instrument for withdrawal transaction. Allowed value: "crypto". Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain.
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

Withdrawal Status

This request allows Client to find out information about cryptocurrency withdrawal.

Withdrawal Status Request

Withdrawal Status Request - Pending Withdrawal Transaction

Request (Client queries status of the withdrawal transaction)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "data": {
    "clientTxId": "1476272036854775807",
    "instrument": "crypto",
    "currency": "XRP"
  }
}

Response (Aggregator responds with status of the withdrawal transaction. Overall transaction status is "pending". Transaction is waiting to be broadcasted to the cryptocurrency network in this case.)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "ok": "ok",
  "data": {
    "currency": "XRP",
    "instrument": "crypto",
    "clientTxId": "1476272036854775807",
    "requestedAmount": "0.00200033",
    "commissionAmount": "0.0005",
    "status": "pending",
    "cexWalletTx": {
      "status": "approved",
      "amount": "0.00200033",
      "commissionAmount": "0.00000000"
    },
    "externalTx": {
      "status": "pending",
      "amount": "0.00200033",
      "commissionAmount": "0.00050000",
      "blockchainTxId": "awaiting"
    }
  }
}

Withdrawal Status Request - Withdrawal Transaction that is sent to the cryptocurrency network (BTC)

Request (Client queries status of the withdrawal transaction)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "data": {
    "clientTxId": "1476272036854775807",
    "instrument": "crypto",
    "currency": "BTC"
  }
}

Response (Aggregator responds with status of the withdrawal transaction. Overall transaction status is "approved". Transaction was already broadcasted to the cryptocurrency network in this case. Unique identifier of this transaction in cryptocurrency network is available in the response.)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "ok": "ok",
  "data": {
    "currency": "BTC",
    "instrument": "crypto",
    "clientTxId": "1476272036854775807",
    "requestedAmount": "0.00269696",
    "commissionAmount": "0.0005",
    "status": "approved",
    "cexWalletTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00000000"
    },
    "externalTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00050000",
      "address": "3GSWtRkv7Qx5De6ZjyPmUHPig5VKHnc1iz",
      "blockchainTxId": "ab900691c7f2e3a68473403d68b92a5fb9a0b1ef8bdce8e850a7f29e1848302b"
    }
  }
}

Withdrawal Status Request - Withdrawal Transaction that is sent to the cryptocurrency network (XRP)

Request (Client queries status of the withdrawal transaction)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "data": {
    "clientTxId": "1476272036854775807",
    "instrument": "crypto",
    "currency": "XRP"
  }
}

Response (Aggregator responds with status of the withdrawal transaction. Overall transaction status is "approved". Transaction was already broadcasted to the cryptocurrency network in this case. Destination, memo and unique identifier of this transaction in cryptocurrency network are available in the response.)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "ok": "ok",
  "data": {
    "currency": "XRP",
    "instrument": "crypto",
    "clientTxId": "1476272036854775807",
    "requestedAmount": "0.00269696",
    "commissionAmount": "0.0005",
    "status": "approved",
    "cexWalletTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00000000"
    },
    "externalTx": {
      "status": "approved",
      "amount": "0.00269696",
      "commissionAmount": "0.00050000",
      "destination": "rLHzPsX6oXkzU2qL12kHCH8G8cnZv1rBJh",
      "memo": "1318266718",
      "blockchainTxId": "D641A1482072B6FCEE5F93AD26A7E8E67254F3FE3CCC65C767F0843E3BE636C1"
    }
  }
}

Withdrawal Status Request - Incorrect ClientTxId

Request (Client queries status of the withdrawal transaction)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "data": {
    "clientTxId": "1476272036854775800",
    "instrument": "crypto",
    "currency": "ATOM"
  }
}

Response (Aggregator responds that withdrawal transaction has not been found with such clientTxId.)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "ok": "ok",
  "data": {
    "currency": "ATOM",
    "instrument": "crypto",
    "clientTxId": "1476272036854775800",
    "status": "not_found"
  }
}

Withdrawal Status Request - Internal Error

Request (Client queries status of the withdrawal transaction)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "data": {
    "clientTxId": "1476272036854775807",
    "instrument": "crypto",
    "currency": "BTC"
  }
}

Response (Aggregator responds that error occurred.)

{
  "e": "get_withdrawal_status",
  "oid": "1521724219900_1_get_withdrawal_status",
  "data": {
    "error": "Internal Error"
  }
}
Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_withdrawal_status" value is allowed here
oid Yes String Unique ID of this request.
clientTxId Yes String Transaction identifier assigned by Client.
instrument Yes String Describes instrument for withdrawal transaction. Allowed value: "crypto". Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain.
currency Yes String Cryptocurrency name.

Withdrawal Status Response

Field Name Mandatory Format Description
e Yes String Describes the type of this message. Only "get_withdrawal_status" value is allowed here
ok No String If this field is present, then request is successful. If this field is missing, then request is not successful. Only "ok" value is allowed here
currency Yes String Cryptocurrency name.
instrument Yes String Describes instrument for withdrawal transaction. Allowed value: "crypto". Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain.
clientTxId Yes String Transaction identifier assigned by Client.
requestedAmount No Float (or String which can be parsed as Float) Requested amount of funds for withdrawal transaction.
commissionAmount No Float (or String which can be parsed as Float) Total commission amount for withdrawal transaction.
status Yes String Withdrawal transaction overall status. Technically, withdrawal transaction consists of 2 sub-transactions: 1) funds withdrawal from client’s account in CEX.IO Aggregator to client’s CEX.IO account; 2) funds withdrawal from client’s CEX.IO account to the external crypto address. This status is based on the statuses of those 2 sub-transactions. Allowed values: "rejected", "pending", "approved", "not_found". The status is "not_found" in case of incorrect clientTxId.
cexWalletTx.status No String Transaction status of funds withdrawal from client’s account in CEX.IO Aggregator to client’s CEX.IO account. Allowed values: "rejected", "pending", "approved".
cexWalletTx.amount No Float (or String which can be parsed as Float) Amount of funds transferred from client’s account in CEX.IO Aggregator to client’s CEX.IO account.
cexWalletTx. commissionAmount No Float (or String which can be parsed as Float) Commission amount for transaction of funds withdrawal from client’s account in CEX.IO Aggregator to client’s CEX.IO .
externalTx.status No String Transaction status of funds withdrawal from client’s CEX.IO account to the external crypto address. Allowed values: "rejected", "pending", "approved".
externalTx.amount No Float (or String which can be parsed as Float) Amount of funds transferred from client’s CEX.IO account to the external crypto address.
externalTx. commissionAmount No Float (or String which can be parsed as Float) Commission amount for transaction of funds withdrawal from client’s CEX.IO account to the external crypto address.
externalTx.address No String Crypto address that will receive the funds. Please be informed that destination and memo fields are used for ledger cryptocurrencies (XRP, XLM, ATOM).
externalTx. destination No String Destination address, that will receive the funds, used for ledger cryptocurrencies (XRP, XLM, ATOM).
externalTx.memo No String A special identifier used for ledger cryptocurrencies (XRP, XLM, ATOM).
externalTx. blockchainTxId No String Unique identifier of the transaction in cryptocurrency network with status "approved". This is optional field if transaction was already broadcasted to the cryptocurrency network. BlockchainTxId is "awaiting" in case of externalTx.status is "pending".
data.error No String If this field is present, then request is not successful. Represents human readable error reason of why request is not successful.
oid Yes String Unique ID of this Client’s request, for which this message is in response to

FIX

Overview

FIX (Financial Information eXchange) is an electronic messaging protocol widely adopted by financial institutions to transmit trading activity, such as submitting or canceling orders, and receiving information about execution and market data. Client and Aggregator interact with each other using FIX 4.4 protocol with a few additional features and restrictions. Interactions should fully satisfy the FIX 4.4 requirements and some additional Aggregator requirements described in this document.

FIX Dialect

There are following fields and values which are non-standard for FIX 4.4. Client might need to define FIX dialect to use it correctly.

  1. There is a field MDEntryID(278) in MDEntries(268) repeating group in Market Data Snapshot/Full Refresh (W) message. If Client prefer not to use this non-standard field then Aggregator may omit this field. See details in Market Data section below (Market Data Snapshot/Full Refresh (W) message)
  2. There are two additional values in MDEntryType(269) field in Market Data messages(V, W, X): Grouped Bid (100), Grouped Offer (101). If Client prefer not to use it, then Client should non request such MDEntryType(269) and Aggregator will not send such values to Client.

Session Level messages and connection:

  1. Aggregator has preliminary created FIX sessions for each Client, which remains active for a long time (might be weeks or months, depending on terms).
  2. Aggregator is waiting for Client connection, so that in terms of FIX, Client is Initiator and Aggregator is Acceptor.
  3. If Client disconnects from TCP port, it does not automatically terminate FIX session, so it does not cancel Client’s orders, does not cancel Client’s Market Data subscription, etc.
  4. Client and Aggregator periodically send each other Heartbeat(0) messages. Aggregator expects Heartbeat(0) message every 30 seconds.
  5. Client should send Logon(A) message as a first message after connection.
  6. Either Client or Aggregator can request resetting sequence numbers in Logon(A) message specifying ResetSeqNumFlag(141) flag.
  7. Either Client or Aggregator can terminate session sending Logout(5) message at any time. This might happen during maintenance period, or after application restart. If Client wishes to reconnect after this, he should send Logon(A) message again.
  8. In Logon(A) message Client should specify Username(553) and Password(554) fields.
  9. Connection is SSL encrypted. Aggregator expects an SSL connection over TCP to the hostname or IP address and TCP port number Client is assigned.

Application Level messages:

  1. Each message from Client should contain SenderCompID(49) - Client identifier and TargetCompID(56) - Aggregator identifier.
  2. Each message from Aggregator should contain SenderCompID(49) - Aggregator identifier and TargetCompID(56) - Client identifier.
  3. If sending party assumes that he might send specific message repeatedly (at least for a second time), so the message might be duplicate, he should include PossResend(97) field in such message. The party who receives such message with PossResend(97) flag should take necessary actions to avoid data loss or corruption (for example, it can be worth requesting current status of order or even all orders)
  4. Client can include additional fields in all messages which are not required by Aggregator and which are not restricted by FIX 4.4 requirements, however Aggregator will ignore such fields.
  5. Aggregator can include additional fields in all messages which are not described in this document and which are not restricted by FIX 4.4 requirements, and Client should ignore such fields.
  6. In case of error on Aggregator side, Aggregator will try to send a response to Client (in a way FIX 4.4 requires it) and, if it’s possible, to include human readable error description in Text(58) field in this message.

FIX Sessions

There are two types of FIX sessions:

Trade Session

TRD session is used for trading. When sending messages, Client should add “_TRD” to its Client identifier in SenderCompID. For example, if Client’s name is “Alpha”, then SenderCompID should be “Alpha_TRD”. Here are a few details on how this session works:

  1. Sequence number in this session is not automatically reset on each connection. However, either Aggregator or Client can request resetting sequence numbers in Logon(A) message at logon time by setting ResetSeqNumFlag(141) flag.
  2. If either Aggregator or Client terminates session by sending Logout(5) message, it does not automatically cancel Client’s orders.

Market Data Session

MD session is used for market data. When sending messages, Client should add “_MD” to its Client identifier in SenderCompID. For example, if Client’s name is “Alpha”, then SenderCompID should be “Alpha_MD”. Here are a few details on how this session works:

  1. Sequence number in this session is automatically reset on each connection. However, either Aggregator or Client can additionally request resetting sequence numbers in Logon(A) message at logon time by setting ResetSeqNumFlag(141) flag.
  2. If Aggregator receives Logon(A) message from Client it automatically cancels all Client’s active market data subscriptions.
  3. If either Aggregator or Client terminates session by sending Logout(5) message, it automatically cancels all Client’s active market data subscriptions.
  4. If Aggregator receives MarketDataRequest(V) for subscription that already exists then such subscription is reinitialized. That means for subscriptions with MDUpdateType(265) = 1 (Incremental Refresh) the Market Data - Snapshot/Full Refresh(W) message will be sent.

Usually Client has only one trade session and one market data session. But if Client requires more sessions then Aggregator can create more sessions.

Order Creation

Client can place order by sending New Order Single (D) message in TRD session to Aggregator

Tag Name Description
35 MsgType Must be "D" (New Order Single)
1 Account Optional. Any string, instructs Aggregator which Client’s Sub account to use. Aggregator will use main Client account if this field is missing.
11 ClOrdID Unique ID of the order assigned by Client
55 Symbol Tradable symbol or currency pair. For example, to buy or sell BTC for USD, use symbol "BTC/USD". Available symbols might be different for each Client.
54 Side Must be 1 to buy or 2 to sell
60 TransactTime Time when the order was originally initiated. Assigned by Client. TransactTime should be within 30000 ms timeframe with server time, otherwise, order will be rejected with the corresponding error. Format: YYYYMMDD-HH:MM:SS.sss
40 OrdType Must be 1 for Market, 2 for Limit, 3 for Stop, or 4 for Stop Limit (for details, see "Order Types" section). For Stop(3) and StopLimit(4) orders Aggregator holds the required amount from Client’s account not during creating the order, but during triggering the order by StopPx(99) price. So Client should make sure that he has enough money when the order is triggered, or else the order will be rejected right after triggering.
59 TimeInForce Specifies how long the order remains in effect (for details, see "Order TimeInForce" section). It should be present if OrdType(40) is Limit(2) or Stop Limit(4). Otherwise, it should be missing.
38 OrderQty Amount of order in currency1. For example, if Symbol(55) is "BTC/USD", then currency1 is BTC. Might be limited based on Client’s trading terms, i.e. minimum or maximum amount, or lot size. Default minimum order size is 0.01 in currency1 (for details, see "Order limitations" section). It should be present if OrdType(40) is Limit(2), or Stop(3) or Stop Limit(4). One field of OrderQty(38) or CashOrderQty(152) should be present, other field should be missing (for details, see "Order specification" section)
152 CashOrderQty Amount of order in currency2. For example, if Symbol(55) is "BTC/USD", then currency2 is USD. This field can be used only in Market order. Might be limited based on Client’s trading terms, i.e. minimum or maximum amount, or lot size (for details, see "Order limitations" section). One field of OrderQty(38) or CashOrderQty(152) should be present, other field should be missing (for details see "Order specification" section)
44 Price Price of the order. Price represents the amount of currency2 that should be paid to get one unit of currency1. For example, if Symbol(55) is "BTC/USD", then currency1 is BTC and currency2 is USD. It should be present if OrdType(40) is Limit(2) or Stop Limit(4). It should be missing if OrdType(40) is Market(1) or Stop(3) (for details, see "Order specification" section)
99 StopPx Price of the stop level of the order. Price represents the amount of currency2 that should be paid to get one unit of currency1. For example, if Symbol(55) is "BTC/USD" then currency1 is BTC and currency2 is USD. It should be present if OrdType(40) is Stop(3) or Stop Limit(4). Otherwise, it should be missing (for details see, "Order specification" section)
126 ExpireTime Date and time in the future when the order should expire, which means be cancelled. If ExpireTime is in the past, order will be rejected with the corresponding error. Format: YYYYMMDD-HH:MM:SS.sss. It should be present if TimeInForce(59) is GTD(6). It should be missing if TimeInForce(59) is not GTD(6).
168 EffectiveTime Optional, specify the date and time in the future when the order should be considered valid. If EffectiveTime is in the past, order will be rejected with the corresponding error. Format: YYYYMMDD-HH:MM:SS.sss. For orders with filled EffectiveTime(168) field Aggregator holds the required amount from Client’s account not during creating the order, but during triggering the order when EffectiveTime(168) time comes. So Client should make sure that he has enough money when the order is triggered, or else the order will be rejected right after triggering.
58 Text Optional, random text the Client wants to associate with this order. It would be included in execution reports and sent back to the Client. It could be any text: for example, JSON string, XML, or just a regular string. It could be useful if Client wants to store additional information like different IDs within this order. It has no effect on order processing in Aggregator. The text is just saved within this order. Text length should be less than 256 symbols. If Client sends text string with length of more than 256 symbols, then Aggregator does not generate error about it and just trims this text string to length 256 and continues processing.

TimeInForce Values

Value Description
1 Good Till Cancel (GTC)
3 Immediate or Cancel (IOC)
4 Fill or Kill (FOK)
6 Good Till Date (GTD)

Order Execution

Aggregator can send Execution Report (8) messages in TRD session to Client, in order to report various information regarding order status. The Execution Report (8) message is used to:

  1. Confirm the receipt of an order
  2. Confirm changes to an existing order (i.e. accept cancel request)
  3. Relay order status information
  4. Relay fill information on open orders
  5. Confirm order rejection
Tag Name Description
35 MsgType Must be "8" (Execution Report)
37 OrderID Unique order identifier assigned by Aggregator. If OrdRejReason(103) is Unknown Order(5), then OrderID(37) field contains "NONE"
11 ClOrdID If ExecType(150) is not Cancelled(4) and not Pending Cancel(6) and not Expired(C), then ClOrdID(11) contains unique order identifier assigned by Client in previously sent New Order Single(D) message in ClOrdID(11) field. If ExecType(150) is Cancelled(4) or Pending Cancel(6) (and order becomes PendingCancelled because of Client’s cancel request), then ClOrdID(11) contains cancel request id assigned by Client in previously sent Order Cancel Request(F) message in ClOrdID(11) field. If ExecType(150) is Expired(C) or Pending Cancel(6) (and order becomes PendingCancelled because the ExpireTime(126) time has come), then ClOrdID(11) contains the moment when the expiration procedure has been started if format “EXPIRED_AT_YYYYMMDD-HH:MM:SS.sss”
41 OrigClOrdID If ExecType(150) is Cancelled(4), it contains unique order identifier assigned by Client in previously sent New Order Single(D) message in ClOrdID(11) field. It should be present if ExecType(150) is Cancelled(4) or Expired(C). Otherwise, it should be missing.
1 Account It contains a sub-account identifier assigned by Client in previously sent New Order Single(D) message in Account(1) field. It should be present if Client specified Account(1) field in previously sent New Order Single(D) message. Otherwise, it should be missing.
39 OrdStatus Describes the current state of the order
150 ExecType Describes the reason why Aggregator is sending this Execution Report to Client
17 ExecID If ExecType(150) is OrderStatus(I) then ExecID(17) field should be 0. If ExecType(150) is not OrderStatus(I) then ExecID(17) field should be an unique identifier of execution report assigned by Aggregator
55 Symbol Tradable symbol or currency pair. For example "BTC/USD"
54 Side Must be 1 to buy or 2 to sell. If OrdRejReason(103) is Unknown Order(5), then Side(54) value should be Buy(1). It is just a default value, and it has no specific meaning, for case when Aggregator cannot find order that satisfies criteria provided by Client in previously sent Order Mass Status Request(AF) or Order Status Request(H)
40 OrdType Must be 1 for Market, 2 for Limit, 3 for Stop, or 4 for Stop Limit (for details, see "Order Types" section)
59 TimeInForce Specifies how long the order remains in effect (for details, see "Order TimeInForce" section). It should be present if OrdType(40) is Limit(2) or Stop Limit(4). Otherwise, it should be missing.
58 Text This field contains a string which can be parsed as JSON object. This object always contains field "cumulativeAmountCcy1" which shows current cumulative executed amount in currency1, and field "cumulativeAmountCcy2" which shows current cumulative executed amount in currency2. Such fields show only executed order amounts, and do not show commission amount. In some cases, such information is redundant because it might be also included in some other fields or calculated from set of previous execution reports. However, in some cases, such information is not possible to calculate using other fields. For example, it is almost not possible to precisely define executed amount in currency1 if order was Market with CashOrderQty, in this case such fields are very useful. This JSON object also contains field "comment" which shows the text provided by Client in previously sent message New Order Single(D) in Text(58) field. This field is missing if Client did not set Text(58) field. If ExecType(150) is Rejected(8), then this JSON object contains field "error", which contains another JSON object, which has field "code" (code of the error) and field "reason" (human readable error description).
60 TransactTime Date and time in UTC when the transaction represented by this Execution Report occurred. Format: YYYYMMDD-HH:MM:SS.sss
126 ExpireTime Date and time in UTC when the order should expire, meaning be cancelled. Format: YYYYMMDD-HH:MM:SS.sss. It should be present if TimeInForce(59) is GTD(6). It should be missing if TimeInForce(59) is not GTD(6).
168 EffectiveTime Optional, date and time in UTC when the order should be considered valid. Format: YYYYMMDD-HH:MM:SS.sss
44 Price Price of the order. Price represents the amount of currency2 that should be paid to get one unit of currency1. For example, if Symbol(55) is "BTC/USD", then currency1 is BTC and currency2 is USD. It should be present if OrdType(40) is Limit(2) or Stop Limit(4). Otherwise, it should be missing (for details see "Order specification" section)
99 StopPx Price of the stop level of the order. Price represents the amount of currency2 that should be paid to get one unit of currency1. For example, if Symbol(55) is "BTC/USD", then currency1 is BTC and currency2 is USD. It should be present if OrdType(40) is Stop(3) or Stop Limit(4). Otherwise, it should be missing (for details see "Order specification" section)
6 AvgPx If OrdStatus(39) is Partially Filled(1) or Filled(2), then AvgPx(6) contains an average execution price for order. If OrdStatus(39) is not Partially Filled(1) and is not Filled(2) then AvgPx(6) should be 0.
151 LeavesQty Amount open for further execution. Amount in this field represents the remaining amount from either OrderQty(38) or CashOrderQty(152) fields, whichever was present in previously sent New Order Single(D) message from Client.
14 CumQty Currently executed amount for this order. This field holds total executed cumulative amount for this order. Amount in this field represents the cumulative amount from either OrderQty(38) or CashOrderQty(152) fields, whichever was present in previously sent New Order Single(D) message from Client.
32 LastQty Amount bought/sold on this (last) fill. Amount in this field represents last executed amount from either OrderQty(38) or CashOrderQty(152) fields, whichever was present in previously sent New Order Single(D) message from Client. It should be present if ExecType(150) is Trade(A). It should be missing if ExecType(150) is not Trade(A).
31 LastPx Price of this (last) fill. It should be present if ExecType(150) is Trade(A). It should be missing if ExecType(150) is not Trade(A).
38 OrderQty Amount in this field represents original amount requested by Client from either OrderQty(38) or CashOrderQty(152) fields, whichever was present in previously sent New Order Single(D) message from Client.
12 Commission Optional field, currently paid commission for this order. Actual commission is provided only in Execution Report when order reaches its final status. Final statuses for OrdStatus(39) are: Filled(2), Cancelled(4), Rejected(8).
13 CommType Optional, describes the type of the commission. Allowed values: 3 - Absolute (means the commission is provided as total monetary amount). Only Absolute commission type is currently supported.
479 CommCurrency Optional, describes the currency of the amount provided in Commission(12) field. Should be equal to currency2.
103 OrdRejReason Describes the reason why the order was rejected. Should be present if ExecType(150) is Rejected(8).
584 MassStatusReqId Contains the unique identifier assigned by Client in previously sent Mass Status Request (AF) message in MassStatusReqId(584) field. Should be present if this Execution Report is a response to Client’s Order Mass Status Request (AF) message. Should be missing if this Execution Report is not a response to Client’s Order Mass Status Request (AF) message.
912 LastRptRequested Indicates whether this Execution Report is the last report as a result to previously sent Client’s Mass Status Request (AF) message. Allowed values are: Y - Last Execution Report; N - Not last Execution Report. Should be present if this Execution Report is a response to Client’s Order Mass Status Request (AF) message. Should be missing if this Execution Report is not a response to Client’s Order Mass Status Request (AF) message
911 TotNumReports The total number of Execution Reports, which will be returned as a result for previously sent Client’s Mass Status Request (AF) message. Should be present if this Execution Report is a response to Client’s Order Mass Status Request (AF) message. Should be missing if this Execution Report is not a response to Client’s Order Mass Status Request (AF) message

OrdStatus Values

Value Name Description
A Pending New It means that the New Order Request(D) message was received by Aggregator, however Aggregator hasn’t completed (or started) amount holding procedure and placing procedure yet
C Expired It means that ExpireTime(126) moment has come and Aggregator has cancelled the order
8 Rejected It means that Aggregator cannot process the order for some reason. Rejection reason can be described in OrdRejReason(103) and in Text(58) fields. If OrdRejReason(103) is Unknown Order(5), then OrdStatus(39) value should be Rejected(8)
0 New It means that Aggregator has completed amount holding procedure and has placed the order, however order is not executed yet
6 Pending Cancel It means the Order Cancel Request(F) message was received by Aggregator, however Aggregator hasn’t completed (or started) order cancellation procedure yet, so order cannot be considered as cancelled yet
4 Cancelled It means that the order is cancelled, so Aggregator has completed order cancellation procedure
1 Partially Filled It means the order is partly executed, order still has some non-executed remaining amount that might be executed in future
2 Filled It means that all order amount is executed and order can be considered as fully completed

ExecType Values

Value Name Description
A Pending New The reason is that the New Order Request(D) message was received by Aggregator, however Aggregator hasn’t started amount holding procedure and placing procedure yet. It happens right after New Order Request(D) message before the order is triggered and only if in New Order Request(D) message the OrdType(40) field is Stop(3) or OrdType(40) field is StopLimit(4) or EffectiveTime(168) field was filled
0 New The reason is that the order is just placed
I Order Status The reason is that Aggregator wants to report current order status to Client for some reason. The reason might be that the Client has recently sent Order Mass Status Request(AF) or Order Status Request(H) messages, so this Execution Report is the response to order status request sent previously by Client; or maybe Client sent New Order Single(D) message with PossResend(97)=‘Y’ flag
F Trade The reason is that a trade on this order has just happened, so the order is filled or partially filled now
8 Rejected The reason is that the order was just rejected for some reason. Rejection reason can be described in OrdRejReason(103) and in Text(58) fields
6 Pending Cancel The reason is that cancellation procedure has just been initiated
4 Cancelled The reason is that cancellation procedure was just completed, so the order can be considered as cancelled
C Expired It means that expiration procedure was completed, so the order can be considered as expired

OrdRejReason Values

Value Name Description
5 Unknown Order Aggregator cannot find order that satisfies criteria provided by Client in previously sent Order Mass Status Request(AF) or Order Status Request(H) message
6 Duplicate Order Response to Client’s New Order Single(D) message, when the described order already exists and cannot be placed repeatedly
99 Other All other rejection reasons which cannot be categorised in other way for some reason

Order Creation Examples

New order acceptance, placement, and execution

Seq id Client msg Aggr msg Exec Type Ord Status Order Qty Cum Qty Leaves Qty Last Qty Comm Type Commi ssion Comm Currency
1 New Order Single 100
2 Execution Report New New 100 0 100 0
3 Execution Report Trade Partially Filled 100 20 80 20 Absolute 30 USD
4 Execution Report Trade Partially Filled 100 30 70 10 Absolute 36 USD
5 Execution Report Trade Filled 100 100 0 70 Absolute 240 USD

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300. Symbol BTC/USD
2 Client has enough (more than 100) BTC on his account. Aggregator has held 100 BTC successfully for this order and placed it for execution.
3 Sold 20 BTC at this partial execution. Paid commission of 30 USD.
4 Sold 10 BTC at this partial execution. In total, for this order: 30 BTC are sold, 36 USD are paid for commission, and 70 BTC are still remaining (open for further execution)
5 Sold 70 BTC at this partial execution. In total, for this order: all 100 BTC are sold, 240 USD are paid for commission. Order is fully executed.

New order reject because of insufficient funds

Seq id Client msg Aggr msg Exec Type Ord Status Account Order Qty Cum Qty Leaves Qty Last Qty OrdRej Reason Text
1 New Order Single superhat 100 hallo
2 Execution Report Rejected Rejected superhat 100 0 100 0 Other {"error":{"code":404, "reason":"Insufficient funds"}, "cumulativeAmountCcy1":"0.00000000", "cumulativeAmountCcy2":"0.00000000", "comment":"hallo"}

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300, Symbol BTC/USD
2 Client has less than 100 BTC on his BTC sub-account "superhat", thus order is rejected.

New order acceptance, placement, and execution

Seq id Client msg Aggr msg Exec Type Ord Status Price ClOrd Id OrderID Order Qty Cum Qty Leaves Qty Last Qty OrdRej Reason Text
1 New Order Single 300 14 100
2 Execution Report New New 300 14 1234567 100 0 100 0
3 New Order Single 250 14 50
4 Execution Report Trade Partially Filled 300 14 1234567 100 10 90 10
5 Execution Report Reject Partially Filled 300 14 1234567 100 10 90 0 Duplicate Order {"error": {“code":6,"reason":"Duplicate order"}, "cumulativeAmountCcy1":"0.00000000", "cumulativeAmountCcy2":"0.00000000"}

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order and assigned unique identifier "1234567" to this order
3 New order: SELL Limit 50 BTC at price 250 (different values). However, it is a duplicate order, because ClOrdId is the same, but it should be unique for each new order.
4 Partial execution of 10 BTC of the order
5 This is a response to Client’s message number 3. ClOrdID is not unique, so the order is duplicated and cannot be processed, thus the request is rejected. Also Aggregator shows the current state of the processing order.

New order with PossResend

Seq id Client msg Aggr msg Exec Type Ord Status Price ClOrd Id OrderID Order Qty Cum Qty Leaves Qty Last Qty Poss Resend
1 New Order Single 300 14 100
2 Execution Report New New 300 14 1234567 100 0 100 0
3 New Order Single 300 14 100 Y
4 Execution Report Order Status New 300 14 1234567 100 0 100 0
5 New Order Single 350 15 200 Y
6 Execution Report New New 350 15 1235008 200 0 200 0

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed order
3 SELL Limit 100 BTC at price 300 (same values). One more new order request, and Client assumes that he could possibly send this message (sequenceId 3) not for the first time (for example because of Client’s software failure or his order data recovery from backup)
4 There is no difference in order parameters between message 1 and message 3 (they are the same), so there is no reason to reject message number 3. Aggregator confirms to Client that order was previously received and shows the current state of the processing order.
5 SELL Limit 200 BTC at price 350 (different orderId). Client also assumes that he could possibly send this message not for the first time
6 PossResend in Client’s previous message makes no effect, because Aggregator received this message for the first time. So Aggregator processes and places this order like a new order.

Stop Order - triggering and successful execution

Seq id Client msg Aggr msg Exec Type Ord Status Price Stop Px Avg Px Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 200 100
2 Execution Report Pending New Pending New 200 0 100 0 100 0
3
4 Execution Report New New 200 0 100 0 100 0
5 Execution Report Trade Filled 200 195 100 100 0 100

Comments for the above example

Seq id Comment
1 SELL Stop 100 BTC at market price when the market price surpasses 200 price level.
2 Aggregator notifies Client that he received the order, however hasn’t start holding amount procedure yet, and will start it once the order is triggered by StopPx price
3 Assume some time has passed and the market price falls to level 200
4 Aggregator notifies Client that his Stop order becomes Market order because market price comes to requested level 200. Also this message means that Aggregator has successfully hold enough money from Client’s account to start processing this order as a Market order
5 Aggregator notifies Client that his order was successfully executed and average execution price is 195. Please note that there is no guarantee that actual execution price for Stop order would be better or worser then requested StopPx 200 price level, because when the order is triggered then it becomes Market order which has no guarantees regarding execution price

Stop Limit Order - triggering and successful placing

Seq id Client msg Aggr msg Exec Type Ord Status Price Stop Px Avg Px Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 250 200 100
2 Execution Report Pending New Pending New 250 200 0 100 0 100 0
3
4 Execution Report New New 250 200 0 100 0 100 0

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC for 250 price when the market price surpasses 200 price level
2 Aggregator notifies Client that he received the order, however hasn’t start holding amount procedure yet, and will start it once the order is triggered by StopPx price
3 Assume some time has passed and the market price falls to level 200
4 Aggregator notifies Client that his StopLimit order becomes SELL Limit 250 order because market price comes to requested level 200.

Stop Order - triggering and not successful execution

Seq id Client msg Aggr msg Exec Type Ord Status Price Stop Px Avg Px Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 200 100
2 Execution Report Pending New Pending New 200 0 100 0 100 0
3
4 Execution Report Rejected Rejected 200 0 100 0 100 0

Comments for the above example

Seq id Comment
1 SELL Stop 100 BTC at market price when the market price surpasses 200 price level.
2 Aggregator notifies Client that he received the order, however hasn’t start holding amount procedure yet, and will start it once the order is triggered by StopPx price
3 Assume some time has passed and the market price falls to level 200
4 Aggregator notifies Client that his Stop order becomes Market order because market price comes to requested level 200. However now Client has less than 100 BTC on his BTC account, thus order is rejected.

Order with EffectiveTime - triggering and successful placing

Seq id Client Message Aggregator Message ExecType Ord Status
1 New Order Single
2 Execution Report Pending New Pending New
3
4 Execution Report New New

Comments for the above example

Seq id Comment
1 Some order, which should be valid only after EffectiveTime moment specified by Client
2 Aggregator notifies Client that he received the order, however hasn’t start holding amount procedure yet, and will start it once EffectiveTime moment come
3 Assume some time has passed and EffectiveTime moment comes
4 Aggregator notifies Client that his order is placed (order becomes valid) because EffectiveTime moment has come. Also this message means that Aggregator has successfully hold enough money from Client’s account to start processing this order

Order with EffectiveTime - triggering and not successful placing

Seq id Client Message Aggregator Message ExecType Ord Status
1 New Order Single
2 Execution Report Pending New Pending New
3
4 Execution Report Rejected Rejected

Comments for the above example

Seq id Comment
1 Some order, which should be valid only after EffectiveTime moment
2 Aggregator notifies Client that he received the order, however hasn’t start holding amount procedure yet, and will start it once EffectiveTime moment come
3 Assume some time has passed and EffectiveTime moment comes
4 Aggregator notifies Client that EffectiveTime moment has come for this order. However now Client has not enough money on his account to start processing this order, thus order is rejected.

Order Cancellation

Client can manipulate (cancel or replace) the order during order life by sending appropriate requests to Aggregator. Aggregator tries to fulfill such requests, however it is not always possible to fulfill it immediately because of communication lag between trade parties, especially on fast moving markets. FIX 4.4 protocol provides means of communication in such conditions and monitors the process of changing the order.

OrderMassCancelRequest (q) FIX message type is also supported. Using this message type client can request the cancellation of all of the remaining quantity of a group of orders matching criteria specified within the request. The following parameters are used in query criteria: MassCancelRequestType (530), Side(54), Symbol(55). An order mass cancel request is assigned a ClOrdID (11) and is treated as a separate entity. The order mass cancel request is acknowledged using an Order Mass Cancel Report (r). The Order Mass Cancel Report (r) will contain the ClOrdID (11) that was specified on the Order Mass Cancel Request . The ClOrdID (11) assigned to the cancel request must be unique amongst the ClOrdID (11) assigned to regular orders, replacement orders, cancel requests, and order mass cancel requests. An immediate response to this message is required. It is recommended that an ExecutionReport with ExecType (150)=Pending Cancel be sent unless the Order Mass Cancel Request (q) can be immediately accepted (ExecutionReport with ExecType (150)=Canceled) or rejected (Order Cancel Reject (9) message).

Client can cancel the order by sending Order Cancel Request (F) message in TRD session to Aggregator. Cancellation is made by order identifier.

Order Cancel Request (F)

Tag Name Description
35 MsgType Must be "F" (Order Cancel Request)
11 ClOrdID Unique ID of the cancel request (not ID of the order) assigned by Client. Must be unique amongst the ClOrdID (11) assigned to regular orders, replacement orders, cancel requests, and order mass cancel requests.
41 OrigClOrdID Unique ID of the order (assigned by Client) which Client wants to cancel. One of OrigClOrdID(41) or OrderID(37) should be present. If both OrigClOrdID(41) and OrderID(37) fields are present then Aggregator will use OrderID(37) and will ignore OrigClOrdID(41) value.
37 OrderID Unique ID of the order (assigned by Aggregator) which Client wants to cancel. One of OrigClOrdID(41) or OrderID(37) should be present. If both OrigClOrdID(41) and OrderID(37) fields are present then Aggregator will use OrderID(37) and will ignore OrigClOrdID(41) value.
55 Symbol Tradable symbol or currency pair. For example, "BTC/USD". This field is required by FIX 4.4 specification but for now Aggregator ignores this value.
54 Side Must be 1 to buy or 2 to sell. This field is required by FIX 4.4 specification but for now Aggregator ignores this value.
60 TransactTime Time when the cancellation request was originally initiated. Assigned by Client. Format: YYYYMMDD-HH:MM:SS.sss

As a response to Order Cancel Request (F), Aggregator can send either Execution Report(8) or Order Cancel Reject (9) message in TRD session

Order Cancel Reject (9)

Tag Name Description
35 MsgType Must be "9". It means order cancellation is rejected
11 ClOrdID Unique ID of the cancellation request (not ID of the order) assigned by Client
41 OrigClOrdID Unique ID of the order (assigned by Client), to which this cancellation reject message relates to
37 OrderID Unique ID of the order (assigned by Aggregator), to which this cancellation reject message relates to. It will contain "NONE" id CxlRejReason(102) is Unknown order(1).
1 Account Optional, sub-account identifier assigned by Client in previously sent New Order Single(D) message in Account(1) field
39 OrdStatus Describes the current state of the order
434 CxlRejResponseTo Identifies the type of request that this Order Cancel Reject(9) is in response to. Allowed value is only: 1 - response to Order Cancel Request(F) message
102 CxlRejReason Reason of cancellation rejection

CxlRejReason Values

Value Name Description
0 Too late to cancel Order is in such state that does not allow cancellation, for example if order is already filled
1 Unknown order If Client requested to cancel the order, which does not exist in Aggregator
3 Already cancelling Cancellation procedure has already been started earlier
6 Duplicate Unique ID Duplicate Unique ID of cancel request (ClOrdID(11) field)
99 Other Any other reason

Client can cancel multiple orders by sending Order Mass Cancel Request (q) message in TRD session to Aggregator.

Order Mass Cancel Request (q)

Tag Name Description
35 MsgType Must be "q". It means Order Mass Cancel Request
11 ClOrdID Unique ID of the cancel request assigned by Client. Must be unique amongst the ClOrdID (11) assigned to regular orders, replacement orders, cancel requests, and order mass cancel requests.
530 MassCancelRequestType Must be 6 to Cancel Orders only for current trading session or 7 to Cancel All orders for a client.
55 Symbol Optional. Tradable symbol or currency pair. For example, "BTC/USD".
54 Side Optional. Must be 1 to buy or 2 to sell.
60 TransactTime Time when the cancellation request was originally initiated. Assigned by Client. Format: YYYYMMDD-HH:MM:SS.sss

The order mass cancel request is acknowledged using an Order Mass Cancel Report (r)

Order Mass Cancel Report (r)

Tag Name Description
35 MsgType Must be "q". It means Order Mass Cancel Request
11 ClOrdID Unique ID of the cancel request assigned by Client
37 OrderID Unique ID of the Order Mass Cancel Report (assigned by Aggregator)
530 MassCancelRequestType Must be 6 to Cancel Orders only for current trading session or 7 to Cancel All orders for a client.
531 MassCancelResponse Action taken by the Aggregator as a result of Mass Cancel
532 MassCancelRejectReason Indicates why Mass Cancel Request was rejected: 99 - Other. It is mandatory if MassCancelResponse(531)=0
58 Text This field contains a string which can be parsed as JSON object. If MassCancelResponse(531) is Rejected (0), then this JSON object contains field "error", which contains another JSON object, which has field "code" (code of the error) and field "reason" (human readable error description). It is mandatory if MassCancelResponse(531)=0
55 Symbol Optional. Tradable symbol or currency pair. For example, "BTC/USD".
54 Side Optional. Must be 1 to buy or 2 to sell.

MassCancelResponse Values

Value Description
0 Cancel Request Rejected
6 Cancel Orders only for current trading session
7 Cancel All orders for a client

Order Cancellation Examples

Cancellation of zero-filled order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 Order Cancel Request 5553 14 1234567
4 Execution Report Pending Cancel Pending Cancel 5553 14 1234567 100 0 100 0
5 Execution Report Canceled Canceled 5553 14 1234567 100 0 0 0

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order
3 Client requests to cancel the order
4 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started
5 Aggregator confirms to Client that order is canceled

Cancellation of placed order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 14 100
2 Order Cancel Request 5553 14
3 Execution Report New New 14 1234567 100 0 100 0
4 Execution Report Pending Cancel Pending Cancel 5553 14 1234567 100 0 100 0
5 Execution Report Canceled Canceled 5553 14 1234567 100 0 0 0

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Client requests to cancel the order before order is placed
3 Aggregator reports to Client that order is placed.
4 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started
5 Aggregator confirms to Client that order is canceled

Cancellation of non-placed order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 14 100
2 Order Cancel Request 5553 14
3 Execution Report Pending Cancel Pending Cancel 5553 14 1234567 100 0 100 0
4 Execution Report New New 14 1234567 100 0 100 0
5 Execution Report Canceled Canceled 5553 14 1234567 100 0 0 0

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Client requests to cancel the order before order is placed
3 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started
4 Aggregator reports to Client that order is placed. Order was placed before the cancellation request is processed
5 Aggregator confirms to Client that order is canceled

Cancellation of partially-filled order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 Execution Report Trade Partially Filled 14 1234567 100 20 80 20
4 Order Cancel Request 5553 14 1234567
5 Execution Report Trade Partially Filled 14 1234567 100 50 50 30
6 Execution Report Pending Cancel Pending Cancel 5553 14 1234567 100 50 50 0
7 Execution Report Trade Pending Cancel 14 1234567 100 60 40 10
8 Execution Report Canceled Canceled 5553 14 1234567 100 60 0 0

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order
3 Partial execution of 20 BTC
4 Client requests to cancel the order
5 Partial execution of 30 BTC. This execution happened right after cancellation request was sent.
6 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started. Also, Aggregator shows the current actual state of the processing order.
7 Partial execution of 10 BTC. This execution happened after cancellation was started, thus order status is Pending Cancel.
8 Aggregator confirms to Client that order is finally canceled. However, there were partial executions between the moment when cancellation request was sent and moment when the order was cancelled. Also, Aggregator shows the current state of the processing order.

Cancellation of filled order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty CxlRej Reason
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 Execution Report Trade Partially Filled 14 1234567 100 20 80 20
4 Order Cancel Request 5553 14 1234567
5 Execution Report Trade Partially Filled 14 1234567 100 30 70 10
6 Execution Report Pending Cancel Pending Cancel 5553 14 1234567 100 30 70 0
7 Execution Report Trade Pending Cancel 14 1234567 100 100 0 70
8 Order Cancel Reject Filled 5553 14 1234567 Too late to cancel

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order
3 Partial execution of 20 BTC
4 Client requests to cancel the order
5 Partial execution of 10 BTC. This execution happened right after cancellation request sent
6 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started.
7 Full execution of 70 BTC. This execution fills the order, and order is completed.
8 Aggregator reports to Client that cancellation attempt was not successful, because the order is already filled.

Cancelling of non-existing order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty CxlRej Reason
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 Order Cancel Request 5553 15 1235008
4 Order Cancel Reject Rejected 5553 15 NONE Unknown order

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order
3 Client requests to cancel the order which does not exists
4 Aggregator reports to Client that cancellation attempt was not successful ,because order does not exist.

Cancelling the order which is already being cancelled

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty CxlRej Reason
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 Order Cancel Request 5553 14 1234567
4 Execution Report Pending Cancel Pending Cancel 5553 14 1234567 100 0 100 0
5 Order Cancel Request 6004 14 1234567
6 Order Cancel Reject Pending Cancel 6004 14 1234567 Already cancelling

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order
3 Client requests to cancel the order
4 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started.
5 Another request from Client to cancel the same order
6 Aggregator reports to Client that order is already being cancelled.

Cancelling the order which is already being cancelled

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 New Order Single 15 100
4 Execution Report New New 15 1234568 100 0 100 0
5 OrderMass Cancel Request 5553
6 OrderMass Cancel Report 5553
7 Execution Report Pending Cancel Pending Cancel 5553 14 1234567 100 0 100 0
8 Execution Report Pending Cancel Pending Cancel 5553 15 1234568 100 0 100 0
9 Execution Report Trade Pending Cancel 14 1234567 100 100 0 100
10 OrderCancel Reject Filled 5553 14 1234567
11 Execution Report Canceled Canceled 5553 15 1234568 100 0 0 0

Comments for the above example

Seq id Comment
1 BUY Limit 100 BTC at price 280
2 Aggregator placed the order
3 SELL Limit 100 BTC at price 300
4 Aggregator placed the order
5 Client requests to cancel all orders
6 Aggregator confirms to Client that OrderMassCancelRequest received by sending a Report message
7 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started
8 Aggregator confirms to Client that cancellation request is received and cancellation procedure is started
9 Order is filled and cannot be cancelled
10 Too late to cancel
11 Aggregator confirms to Client that order is canceled

Order Expiration

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrigCl OrdID OrderID ExpireTime
1 New Order Single 14 20090323- 15:40:29.000
2 Execution Report New New 14 1234567
3
4 Execution Report Pending Cancel Pending Cancel EXPIRED_AT_20090323- 15:40:31.000 14 1234567
5 Execution Report Expired Expired EXPIRED_AT_20090323- 15:40:31.000 14 1234567

Comments for the above example

Seq id Comment
1 Client creates order and fill ExpireTime(126) field, which means Client want this order to be cancelled after this moment if order is not in final state
2 Aggregator reports to Client that order is placed.
3 Order remains open and ExpireTime moment has come. Client expects Aggregator to automatically start expiration procedure for this orders.
4 Aggregator notifies Client that expire time has come and expiration procedure is started. Also Aggregator reports the moment when expiration procedure was started, which usually happens few seconds after ExpireTime. Similar to Cancel Request Aggregator reports ClOrdId as text in format "EXPIRED_AT_"+expirationTime
5 Aggregator confirms to Client that order is expired. Also Aggregator reports the moment when expiration procedure was started, which should be the same value like in previously sent Pending Cancel message

Order Monitoring

Client can monitor current order state by sending appropriate message to Aggregator in TRD session:

  1. Order Status Request (H) to find out the status of one order.
  2. Order Mass Status Request (AF) to find out the statuses of all active orders matching criteria specified by Client

In response to such requests, Aggregator sends one or more appropriate Execution Report(8)s to Client.

Order Status Request (H)

Tag Name Description
35 MsgType Must be "H". It means Order Status Request
11 ClOrdID Unique ID of the order assigned by Client
37 OrderID Optional. Unique ID of the order assigned by Aggregator. If OrderID(37) field is present, then Aggregator will use OrderID(37) and will ignore ClOrdID(11) value
55 Symbol Tradable symbol or currency pair. For example, "BTC/USD". This field is required by FIX 4.4 specification but for now Aggregator ignores this value.
54 Side Must be 1 to buy or 2 to sell. This field is required by FIX 4.4 specification but for now Aggregator ignores this value.

Order Mass Status Request (AF)

Tag Name Description
35 MsgType Must be "AF". It means Order Mass Status Request
584 MassStatusReqID Unique ID of mass status request assigned by Client
585 MassStatusReqType Type of mass status request. Allowed values are: 7 - All Orders (means Client wants to know statuses of all active orders matching specified criteria); 6 - Trading Session (means Client wants to know statuses of all active orders matching specified criteria for a trading session)
1 Account Optional. Sub-account identifier assigned by Client in previously sent New Order Single(D) message in Account(1) field. If this field is present, Aggregator returns orders matching this field.
55 Symbol Optional. Tradable symbol or currency pair. For example, "BTC/USD". If this field is present, Aggregator returns orders matching this field.
54 Side Optional. Must be 1 to buy or 2 to sell. If this field is present, Aggregator returns orders matching this field.

Order Monitoring Examples

Requesting status of executing order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrderID Order Qty Cum Qty Leaves Qty Last Qty
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 Order Status Request 14 1234567
4 Execution Report Order Status New 14 1234567 100 0 100 0
5 Execution Report Trade Partially Filled 14 1234567 100 20 80 20
6 Order Status Request 14 1234567
7 Execution Report Order Status Partially Filled 14 1234567 100 20 80 0
8 Execution Report Trade Filled 14 1234567 100 100 0 80
9 Order Status Request 14 1234567
10 Execution Report Order Status Filled 14 1234567 100 100 0 0

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order
3 Client requests order status
4 Aggregator responds to Client’s status request and shows current order status
5 Trade happened. Partial execution 20 BTC.
6 Client requests order status
7 Aggregator responds to Client’s status request and shows current order status
8 Trade happened. Full execution 80 BTC.
9 Client requests order status
10 Aggregator responds to Client’s status request and shows current actual order status

Requesting status of non-existing order

Seq id Client msg Aggr msg Exec Type Ord Status ClOrd Id OrderID Order Qty Cum Qty Leaves Qty Last Qty OrdRej Reason
1 New Order Single 14 100
2 Execution Report New New 14 1234567 100 0 100 0
3 Order Status Request 15
4 Execution Report Order Status Rejected 15 NONE 0 0 0 0 Unknown Order

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC at price 300
2 Aggregator placed the order
3 Client requests status of the order which does not exist
4 Aggregator responds to Client’s status request and shows that such order does not exist.

Requesting mass status with criteria

Seq id Client msg Aggr msg Exec Type Ord Status Mass Status ReqID ClOrd Id OrderID Account Symbol Side TotNum Reports LastRpt Requested
1 New Order Single 14 superhat BTC/USD SELL
2 Execution Report New New 14 1234 superhat BTC/USD SELL
3 New Order Single 15 cowboy BTC/USD BUY
4 Execution Report Trade Partially Filled 14 1234 superhat BTC/USD SELL
5 Execution Report Rejected Rejected 15 2345 cowboy BTC/USD BUY
6 New Order Single 16 cowboy BTC/USD SELL
7 Execution Report New New 16 2993 cowboy BTC/USD SELL
8 Order Mass Status Request 9112 BTC/USD SELL
9 Execution Report Order Status Partially Filled 9112 14 1234 superhat BTC/USD SELL 2 N
10 Execution Report Order Status New 9112 16 2993 cowboy BTC/USD SELL 2 Y

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC using "superhat" account
2 Aggregator placed the order 14
3 BUY Limit 100 BTC using "cowboy" account
4 Partial execution for order 14
5 Aggregator rejects order 15 because of insufficient USD on "cowboy" account
6 SELL Limit 150 BTC using "cowboy" account
7 Aggregator placed the order 16
8 Client requests statuses of all active orders with Side "SELL", Symbol "BTC/USD" and for any account
9 One of the active orders which matches the criteria. Total number of execution reports 2, this report is not the last one.
10 One of the active orders which matches the criteria. Total number of execution reports 2, this report is the last one.

Requesting mass status with no orders matching criteria

Seq id Client msg Aggr msg Exec Type Ord Status Mass Status ReqID ClOrd Id OrderID Account Symbol Side TotNum Reports LastRpt Requested OrdRej Reason
1 New Order Single 14 superhat BTC/USD SELL
2 Execution Report New New 14 1234 superhat BTC/USD SELL
3 New Order Single 15 cowboy BTC/USD BUY
4 Execution Report Rejected Rejected 15 2345 superhat BTC/USD BUY
5 New Order Single 16 cowboy BTC/USD SELL
6 Execution Report New New 16 2993 cowboy BTC/USD SELL
7 Order Mass Status Request 9112 BUY
8 Execution Report Order Status Rejected 9112 NONE BUY 1 Y Unknown Order

Comments for the above example

Seq id Comment
1 SELL Limit 100 BTC using "superhat" account
2 Aggregator placed the order 14
3 BUY Limit 100 BTC using "cowboy" account
4 Aggregator rejects order 15 because of insufficient USD on "cowboy" account
5 SELL Limit 150 BTC using "cowboy" account
6 Aggregator placed the order 16
7 Client requests statuses of all active orders with Side "BUY", any Symbol and for any account
8 Client has no active orders matching that criteria, so Aggregator reports to Client that there are no such orders.

Market Data

Client can monitor market data by sending Market Data Request(V) in MD session to Aggregator. In response, Client can receive either Market Data Snapshot (W) or Market Data Incremental Refresh(X) or Market Data Request Reject (Y) in MD session. Client can see and use only the liquidity which satisfies Client’s maximum commission rate. The higher “maximum commission rate” Client has, the more liquidity Client can see and use in their orders. See “Order Commission” section for more details. If Client creates market data subscription, then Aggregator sends Market Data Snapshot (W) or Market Data Incremental Refresh(X) message to Client on each market data change event. If Client has active market data subscriptions and MD session is terminated (either by Client or by Aggregator), then all active subscriptions are cancelled. So active subscriptions are terminated either on Logon(A) or on Logout(5). If Client has active market data subscriptions and his FIX connection is disconnected, then all active subscriptions are cancelled.

Aggregator supports both types (MDUpdateType(265)) of the market data subscriptions: 0 = Full Refresh and 1 = Incremental Refresh.

By default only subscriptions with Incremental Refresh (1) MDUpdateType(265) are supported. If Client wants to subscribe with Full Refresh (0) MDUpdateType(265) it can be turned on by request.

If turned on Subscriptions with MDUpdateType(265) = Full Refresh(0) provide limited support of MarketDepth(264). Maximum value of market depth which is supported for Full Refresh(0) subscriptions is 5. MarketDepth(264)=0 is not supported in Full Refresh(0) subscriptions.

For Clients who want to receive not only 5 top positions but full order book, there is an Incremental Refresh subscription MDUpdateType option. In this case Client will receive Market Data - Snapshot/Full Refresh(W) message with full order book and then will start receiving Market Data - Incremental Refresh(X) messages which should be applied to initial market data snapshot incrementally on the Client side to keep Market Data snapshot up to date. Each Incremental Refresh item should be applied to existing Snapshot at specific MDEntryPx level.

There are 3 MDUpdateType that are supported for Incremental Refresh item.

Value Name Description
0 New Add new item to snapshot at MDEntryPx level
1 Change Change MDEntrySize at MDEntryPx level
2 Delete Delete item from snapshot at MDEntryPx level

Market Data - Snapshot/Full Refresh(W) is sent from Aggregator to Client every minute to minimize risk of incorrect applying of incremental refresh on Client side.

Duplicate subscriptions. The expected Client’s behavior regarding MD subscriptions is:

  1. Client should know all MDReqIDs of all his active subscriptions
  2. Before new subscription creation Client should ensure than it’s MDReqID is unique among currently active subscriptions
  3. Client can reinitialize existing subscription and trigger Market Data - Snapshot/Full Refresh(W) message from Aggregator by making a subscription request with the exactly same parameters as the existing subscription.
  4. Client should not create new subscription which overlaps with existing subscriptions by MDEntryType(269) and Symbol(55). If Client has active subscription A (for example “BTC/USD Offer,Bid, Depth=3”) and he requests to create another subscription B (for example “BTC/USD Bid Depth=5”) which overlaps existing subscription A, then subscription A is reinitialized and subscription B is not created at all.
  5. If Client wants to create new subscription which overlaps with existing subscriptions then Client should cancel such existing subscriptions first.
  6. If Client wants to change parameters of existing subscription (for example Depth parameter) then Client should unsubscribe from existing subscription and subscribe for the new one with updated parameters.
  7. If Client wants to cancel multiple subscriptions then Client can either cancel all subscriptions one by one, or Client can logout and login again in MD FIX session and such action should cancel all his currently active subscriptions.

Its recommended to reinitialize MD FIX session (do logout and login) in case of any inconsistencies on Client side, for example when Client realizes he does not know MDReqID or other parameters for each of his currently active subscriptions or he does not know the complete list of his currently active subscriptions.

Order Book Grouping

By default this functionality is turned off it can be turned on by request.

Grouped Book consists of rough estimation of the available liquidity. Such order book consists of real order book grouped by certain price levels and discrete amounts for each price level. So, in average, Client may see a bit worse liquidity in Grouped Book compared to regular Book. However, it allows Client to group very small liquidity amounts and see a broader picture of the liquidity. The most valuable benefit of it is that Grouped Book allows Client to ignore (or “to group”) insignificant liquidity movements and not to receive updates on each tiny liquidity changes, but only receive updates on significant liquidity changes. For liquidity subscriptions, it also allows to significantly decrease the load for a FIX MD communication channel if the detailed Order Book is not required for the Client.

Additional non-standard FIX MDEntryType (269) values are available for Client: “Grouped Bid”(100) and “Grouped Offer”(101). If Client wants to use such values, they might need to define FIX dialect, meaning to configure their FIX software to accept and understand such non-standard values. If Client does not want to use order book grouping, they just should not request it, so Aggregator does not send back such non-standard values to Client.

Client can request and see both regular (real) book (Bid(0) and Offer(1) MDEntryTypes(269)) and/or grouped book (Grouped Bid(100) and Grouped Offer(101) MDEntryTypes(269)). Client can request either snapshot or subscription for either regular book or grouped book.

Formal. How the book is grouped. The price levels for grouping are multiplies of P, and amounts are multiplies of A. That means that for each positive integer n, all the liquidity between n*P and (n+1)*P prices are summed and shown at (n+1)*P price level for Offers and at n*P price level for Bids. And for each positive integer m, for each grouped price level if the resulting summed amount is between m*A and (m+1)*A then the m*A amount is shown for this price level. If m*A appears to be 0, that means that at this price level the summed amount is >0 and <A. See the examples below for better understanding how the grouping works.

Currently price levels for grouping are multiplies of 0.1 (P), and amounts are multiplies of 0.5 (A). However, Aggregator can change such P and A divisors’ values later.

Market Data Request (V)

Tag Name Description
35 MsgType Must be "M" (Market Data Request)
262 MDReqID Unique ID of the market data request assigned by Client. It should be unique only within Client’s active subscriptions. As a result, it is allowed to use the identifier which is equal to any old completed snapshot ID or to any cancelled subscription ID. For example, it is allowed to use the same ID "ABC" for each new snapshot request. However, Aggregator encourages Clients to use the new ID for each new request, if possible.
263 SubscriptionRequestType Describes the type of the result which Client wants to achieve by this request
264 MarketDepth Depth of the market Client wants to see: Allowed values: 0 - Full Book (all rows of the Book); 1 - Top of Book (one best price row of the Book); N - Reports best (N best price rows of the Book). Maximum allowed Market Depth value is 200. If Client requests depth of more than 200 or Full(0), then Aggregator will respond with no more than 200 MD entries to Client. If SubscriptionRequestType(263) is Subscribe(1) and MdUpdateType(265) is Full Refresh(0) then maximum allowed Market Depth is 5. If SubscriptionRequestType(263) is Subscribe(1) and MdUpdateType(265) is Full Refresh(0) then Market Depth value 0(Full Book) is not allowed. If SubscriptionRequestType(263) is Unsubscribe(2) then MarketDepth value is ignored by Aggregator. Aggregator identifies Market Data Subscription to unsubscribe only by MDReqID(262) field.
265 MDUpdateType Describes the type of an update Client wants to receive on each market data change. Should be present if SubscriptionRequestType(263) is Subscribe(1). Should be missing if SubscriptionRequestType(263) is not Subscribe(1).
267 NoMDEntryTypes Start of repeating group. Number of MDEntryType(269) requested in this message. If SubscriptionRequestType(263) is Unsubscribe(2) then MDEntryTypes are ignored by Aggregator. Aggregator identifies Market Data Subscription to unsubscribe only by MDReqID(262) field.
=>269 MDEntryType Repeating group field. Type of requested market data. Client cannot create new subscription if active Client’s subscription with Symbol which is equal to Symbol in this request and with MDEntryTypes which are overlapping with MDEntryTypes(269) in this request already exists. If such active subscription exists, then Aggregator would reject this request and provide Client with ID of such subscription. If SubscriptionRequestType(263) is Unsubscribe(2) then MDEntryType is ignored by Aggregator. Aggregator identifies Market Data Subscription to unsubscribe only by MDReqID(262) field.
146 NoRelatedSym Start of repeating group. Only one Symbol per request is supported. So, allowed value is only 1. If Client wants to get market data for a few Symbols, then he should send separate MD request for each Symbol he is interested in.
=>55 Symbol Repeating group field. Tradable symbol or currency pair. For example "BTC/USD".

SubscriptionRequestType Values

Value Name Description
0 Snapshot Client wants to get only one message as a response which contains current market data values
1 Subscribe Client wants to receive one message which contains current market data values and wants to continually receive messages with market data snapshot or incremental refresh whenever market data changes
2 Unsubscribe Client wants to stop receiving market data snapshots or incremental refresh messages for previous Market Data Request

MDUpdateType Values

Value Name Description
0 Full Refresh It means that Aggregator sends Market Data Snapshot (W) message to Client on each market data change event
1 Incremental Refresh It means that Aggregator sends Market Data Snapshot (W) message to Client as a first message and then sends Incremental Refresh updates only for price levels that are affected by each market data change event

MDEntryType Values

Value Name Description
0 Bid Active orders of other traders who want to BUY Symbol(55) grouped for each price observed on the market
1 Offer Active orders of other traders who want to SELL Symbol(55) grouped for each price observed on the market
2 Grouped Bid Executed trades observed on the market
100 Grouped Bid Bid order book grouped by the price levels and by the amount. This is non-standard FIX 4.4 field value.
101 Grouped Offer Offer order book grouped by the price levels and by the amount. This is a non-standard FIX 4.4 field value.

Market Data Snapshot/Full Refresh (W)

Tag Name Description
35 MsgType Must be "W" (Market Data Snapshot)
262 MDReqID Identifier of the market data request assigned by Client to which this market data snapshot is in response to
55 Symbol Tradable symbol or currency pair. For example "BTC/USD".
268 NoMDEntries Start of repeating group. Number of entries following.
=>278 MDEntryID Repeating group field. Market Data Entry identifier (which is unique among currently active entries). In case of subscription this MDEntryID value should be used in subsequent Market Data Incremental Refresh (X) messages to change or delete this MDEntry. Note: this field is not defined in this repeating group in this message in FIX 4.4. So it is non-standard field for FIX 4.4. So Client might need to define FIX dialect to use it correctly. If Client wants to use FIX 4.4 and does not want to have non-standard fields in it, so Aggregator may omit this field for such Client.
=>269 MDEntryType Repeating group field. Type of requested market data.
=>270 MDEntryPx Repeating group field. Price of the market data entry. For example, if the corresponding MDEntryType(269) is 1, then this field represents offer price.
=>271 MDEntrySize Repeating group field. Amount of the market data entry. It represents amount in currency1. For example, if Symbol(55) is "BTC/USD", then this field represents BTC amount of the market data entry.
=>272 MDEntryDate Repeating group field. Date when this trade occurred. Might be inaccurate. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that trade date is not defined. Format: YYYYMMDD
=>273 MDEntryTime Repeating group field. Time when this trade occurred. Might be inaccurate. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that trade time is not defined. Format: HH:MM:SS.sss
=>288 MDEntryBuyer Repeating group field. This flag with "Y" value indicates that this trade was triggered by someone’s BUY order. "N" means it was not. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that it is not known if this trade was actually triggered by someone’s BUY order. If value MDEntryBuyer(288) or MDEntrySeller(289) in this MDEntry is "Y", then another field should be either missing or should have value "N"
=>289 MDEntrySeller Repeating group field. This flag with "Y" value indicates that this trade was triggered by someone’s SELL order. "N" means it was not. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that it is not known if this trade was triggered by someone’s SELL order. If value of MDEntryBuyer(288) or MDEntrySeller(289) in this MDEntry is "Y" then another field should be either missing or should have value "N"

Market Data Incremental Refresh (X)

Tag Name Description
35 MsgType Must be "X" (Market Data Incremental Refresh)
262 MDReqID Identifier of the market data request assigned by Client to which this market data incremental refresh message is in response to
268 NoMDEntries Start of repeating group. Number of entries following.
=>278 MDEntryID Repeating group field. Market Data Entry identifier (which is unique among currently active entries). In case of MDUpdateAction(279) is New(0) this MDEntryID value should be used in subsequent Market Data Incremental Refresh (X) messages to delete or change this MDEntry. In case of MDUpdateAction(279) is Change(1) or Delete(2) this MDEntryID value specifies which MDEntry should be changed or deleted.
=>279 MDUpdateAction Repeating group field. Type of Market Data update action.
=>269 MDEntryType Repeating group field. Type of requested market data. Allowed values are: 0 - Bid (active orders of other traders who want to BUY Symbol(55) grouped for each price observed on the market); 1 - Offer (active orders of other traders who want to SELL Symbol(55) grouped for each price observed on the market)
=>55 Symbol Repeating group field. Tradable symbol or currency pair. For example "BTC/USD".
=>270 MDEntryPx Repeating group field. Price of the market data entry. For example, if the corresponding MDEntryType(269) is 1, then this field represents offer price.
=>271 MDEntrySize Repeating group field. Amount of the market data entry. It represents amount in currency1. For example, if Symbol(55) is "BTC/USD", then this field represents BTC amount of the market data entry.
=>272 MDEntryDate Repeating group field. Date when this trade occurred. Might be inaccurate. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that trade date is not defined. Format: YYYYMMDD
=>273 MDEntryTime Repeating group field. Time when this trade occurred. Might be inaccurate. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that trade time is not defined. Format: HH:MM:SS.sss
=>288 MDEntryBuyer Repeating group field. This flag with "Y" value indicates that this trade was triggered by someone’s BUY order. "N" means it was not. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that it is not known if this trade was actually triggered by someone’s BUY order. If value MDEntryBuyer(288) or MDEntrySeller(289) in this MDEntry is "Y", then another field should be either missing or should have value "N"
=>289 MDEntrySeller Repeating group field. This flag with "Y" value indicates that this trade was triggered by someone’s SELL order. "N" means it was not. This field might be present if MDEntryType(269) of this MDEntry is Trade(3). Otherwise, it should be missing. If this field is missing, that means that it is not known if this trade was triggered by someone’s SELL order. If value of MDEntryBuyer(288) or MDEntrySeller(289) in this MDEntry is "Y" then another field should be either missing or should have value "N"

MDUpdateAction Values

Value Name Description
0 New It means that new entry with MDEntrySize MDEntryPx should be added to the order book
1 Change It means that MDEntrySize should be updated on MDEntryPx level of the order book
2 Delete It means that entry on MDEntryPx level should be removed form the order book

Market Data Request Reject (Y)

Tag Name Description
35 MsgType Must be "Y" (Market Data Request Reject)
262 MDReqID Identifier of the market data request assigned by Client to which this market data incremental refresh message is in response to
281 MDReqRejReason Reason of the rejection of a Market Data Request (V)
58 Text This field contains a string which can be parsed as JSON object. This object always contains field "code" which shows the code of the error, and field "reason" which shows human readable error description. If MDReqRejReason(281) is Duplicate(1), then this object contains field "duplicateId" which shows identifier of the active Client’s subscription that is in conflict with this MD request. In case of Duplicate, if Client wants this request to succeed then they should cancel the subscription with identifier in "duplicateId" and should send this request once again after that. Cancelling subscription with identifier in "duplicateId" does not guarantee that this request will succeed after that, because MDEntryTypes(269) in this request might overlap with multiple subscriptions but not just with single subscription. If this happens, then Aggregator will reject such request once again, but with different "duplicateId", and Client should cancel that subscription and repeat such process until all overlapping active subscriptions are cancelled. Eventually, Aggregator will accept such Client’s request when all overlapping subscriptions are canceled. Another solution for Client would be just to modify this request (change Symbol(55) or MDEntryTypes(269)) to avoid overlapping with other active subscriptions and send modified request once again. Another more radical solution for Client would be to terminate MD session and connect back again, which will cancel all active subscriptions automatically. However, such approach would cancel all Client’s subscriptions, not just conflicting ones.

MDReqRejReason Values

Value Name Description
0 Unknown Symbol Client requested market data of the unknown or restricted Symbol(55) or Client requested to cancel subscription which does not exist
1 Duplicate Client requested the market data subscription which already exists

Market Data Examples

Requesting Bid and Offer Market Data Snapshot

Client wants to see 2 best rows of Offer Book and 2 best rows of Bid Book for Symbol "BTC/USD"

Message type MDReqID Subscription RequestType NoRelated Sym Symbol Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3131 Snapshot 1 BTC/USD 2 2 Bid
Offer

Aggregator shows 2 best Offers and 2 best Bids which are observed currently on the market. So Aggregator shows 4 MD Entries in total.

In this example, there are 14.5 BTC offered for sale on price level 349.1255 on the market and there are 120.16 BTC offered for sale on price level 350.1624 on the market. So, for example, Client might fairly assume that if he quickly places order "BUY Limit 134 BTC at price 350.2000" after that then there is good chance that his order will be filled quite quickly (if market data doesn't change too much during the time the order is in progress)

Message type MDReqID Symbol Repeating groups of market data _ _
Market Data Snapshot Full Refresh (W) 3131 BTC/USD NoMDEntries 4
MDEntryType MDEntryPx MdEntrySize
Bid 345.2517 0.12420000
Bid 345.2412 6.34805025
Offer 349.1255 14.50000000
Offer 350.1624 120.16000000

Requesting Trade Market Data Snapshot

Client wants to see the last 5 trades which were observed on the market for Symbol "BTC/USD"

Message type MDReqID Subscription RequestType NoRelated Sym Symbol Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3132 Snapshot 1 BTC/USD 5 1 Trade

Aggregator reports to Client information about last 5 trades which were observed on the market:

  1. At 15:41:29 someone sold 0.1242 BTC at price 345.2517
  2. At undefined time recently someone bought 6.346 BTC for price 350.16
  3. At 15:40:33 there was a trade of unknown direction of 2.5 BTC for price 345.2412
  4. At 15:40:12.561 someone bought 18.16 BTC for price 349
  5. At 15:40:02.123 someone sold 17,0112332 BTC at price 351.01
Message type MDReqID Symbol Repeating groups of market data _ _ _ _ _ _
Market Data Snapshot Full Refresh (W) 3132 BTC/USD NoMDEntries 5
MDEntryType MDEntryPx MdEntrySize MdEntryDate MDEntryTime MDEntryBuyer MdEntrySeller
Trade 345.2517 0.12420000 20090624 15:41:29.000 N Y
Trade 350.1600 6.34600000 Y N
Trade 345.2412 2.50000000 20090624 15:40:33.000
Trade 349.0000 18.16000000 20090624 15:40:12.561 Y
Trade 351.0100 17.01123320 20090624 15:40:02.123 N Y

Requesting Bid Market Data Subscription with update type Incremental Refresh

Client wants to see 2 best rows of Bid Book for Symbol "BTC/USD" and wants to receive updates each time. Offer book was not requested

Message type MDReqID Subscription RequestType NoRelated Sym Symbol MDUpdate Type Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3134 Subscribe 1 BTC/USD Incremental Refresh 2 1 Bid

Aggregator sends initial snapshot (W) with 2 best Bids which are currently observed on the market.

Then market data changed:

  1. bid at price level 345.2517 is no longer available
  2. bid at price 344.0000 should be added to the book on the client side because it became second bid value from the top of the book

Then market data changed:

  1. available bid BTC amount decreases at price level 345.2412
  2. bid at price level 344.0000 is no longer available
  3. bid at price 343.0231 should be added to the book on the client side
N Message type MDReqID Symbol Repeating groups of market data _ _ _
1 Market Data Snapshot Full Refresh (W) 3134 BTC/USD NoMDEntries 2
MDEntryType MDEntryPx MdEntrySize
Bid 345.2517 0.12420000
Bid 345.2412 6.34805025
2 Market Data Incremental Refresh (X) 3134 BTC/USD NoMDEntries 2
MDEntryType MDUpdateAction MDEntryPx MdEntrySize
Bid Delete (2) 345.2517
Bid New (0) 344.0000 12.50000000
3 Market Data Incremental Refresh (X) 3134 BTC/USD NoMDEntries 3
MDEntryType MDUpdateAction MDEntryPx MdEntrySize
Bid Update (1) 345.2412 2.95805025
Bid Delete (2) 344.0000
Bid New (0) 343.0231 0.01738464

Cancelling Existing Bid Market Data Subscription with update type Incremental Refresh

Client wants to Unsubscribe from BTC/USD subscription with MDReqID 3134.

MarketDepth, NoMDEntryType, MDEntryType fields are required by FIX protocol standard but are ignored by Aggregator. Aggregator identifies Market Data Subscription to unsubscribe only by MDReqID field.

Message type MDReqID Subscription RequestType NoRelated Sym Symbol Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3134 Unsubscribe 1 BTC/USD 2 1 Bid

Aggregator cancels MdSubscription with MDReqID = 3134 and stops sending market data updates to client on this subscription

Cancelling Market Data Subscription that does not exist

Client wants to Unsubscribe from BTC/USD subscription with MDReqID 3136, which does not exist.

MarketDepth, NoMDEntryType, MDEntryType fields are required by FIX protocol standard but are ignored by Aggregator. Market Data Subscription to unsubscribe from is looked up using only MDReqID field.

Message type MDReqID Subscription RequestType NoRelated Sym Symbol Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3136 Unsubscribe 1 BTC/USD 2 1 Bid

Aggregator sends rejection message to indicate that such subscription does not exist.

FIX 4.4 does not have appropriate MDReqRejReason(281) value for such case, so Aggregator uses "Unknown Symbol" for this and provides more details in the Text field

Message type MDReqID Subscription RequestType NoRelated Sym
Market Data Request Reject (Y) 3136 Unknown Symbol {"code":445,"reason": "Cannot find any subscription to delete: BTC/USD 3136"}

Requesting Bid Market Data Subscription with update type Snapshot/Full Refresh

Client wants to see 2 best rows of Bid Book for Symbol "BTC/USD" and wants to receive Full Order Book Snapshot each time update happens. Note: in case of Full Refresh MarketDepth is limited to 5

Message type MDReqID Subscription RequestType NoRelated Sym Symbol MDUpdate Type Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3133 Subscribe 1 BTC/USD Full Refresh 2 1 Bid

Aggregator sends initial snapshot (W) with 2 best Bids which are currently observed on the market.

Then market data changed:

  1. bid at price level 345.2517 is no longer available
  2. bid at price 344.0000 added to snapshot because it became second bid value from the top of the book

Then market data changed:

  1. available bid BTC amount decreases at price level 345.2412
N Message type MDReqID Symbol Repeating groups of market data _ _
1 Market Data Snapshot Full Refresh (W) 3133 BTC/USD NoMDEntries 2
MDEntryType MDEntryPx MdEntrySize
Bid 345.2517 0.12420000
Bid 345.2412 6.34805025
2 Market Data Snapshot Full Refresh (W) 3133 BTC/USD NoMDEntries 2
MDEntryType MDEntryPx MdEntrySize
Bid 345.2412 6.34805025
Bid 344.0000 12.50000000
3 Market Data Snapshot Full Refresh (W) 3133 BTC/USD NoMDEntries 2
MDEntryType MDEntryPx MdEntrySize
Bid 345.2412 2.95805025
Bid 344.0000 12.50000000

Client wants to see 2 best rows of Grouped Offer Book and 2 best rows of Grouped Bid Book for Symbol "BTC/USD"

Message type MDReqID Subscription RequestType Symbol NoRelated Sym Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3135 Snapshot BTC/USD 1 2 2 Grouped Bid
Grouped Offer

Aggregator shows 2 best Grouped Offers and 2 best Grouped Bids which are currently observed on the market.

In this example, Aggregator summed all bids’ amounts between price levels >=345.2 and <345.3 into one row for price 345.2, and also rounded the summed amount to the discrete amount which is here the multiply of 0.5 BTC. For more details see section Order Book Grouping above.

For example, if there were 2 real bids: 0.1242 BTC for price 345.2517, and 6.34805025 BTC for price 345.2412, then both would be grouped to the price level 345.2 with amount 6.47225025, however amount 6.0 BTC is shown as the discrete amount instead.

Aggregator makes similar actions for Grouped Offer book: Aggregator sums all offers’ amounts between prices >349.1 and <=349.2 into one row for price 349.2, and rounds the summed amount to the discrete amount which is here the multiply of 0.5 BTC.

Message type MDReqID Symbol Repeating groups of market data _ _
Market Data Snapshot Full Refresh (W) 3135 BTC/USD NoMDEntries 4
MDEntryType MDEntryPx MdEntrySize
Grouped Bid 345.2 6.00000000
Grouped Bid 345.1 1.50000000
Grouped Offer 349.2 14.50000000
Grouped Offer 350.2 120.00000000

Requesting Trade Subscription with update type Snapshot/Full Refresh

Client wants to see each Trade on Symbol "BTC/USD" observed on the market.

Message type MDReqID Subscription RequestType NoRelated Sym Symbol MDUpdate Type Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 3136 Subscribe 1 BTC/USD Full Refresh 1 1 Trade
  1. Aggregator reports to Client that Trade happened on the market: someone sold 0.1 BTC at price 345.2517

  2. Aggregator reports to Client that Trade happened on the market: someone bought 160 BTC at price 350.1624

  3. Aggregator reports to Client that Trade happened on the market at the price 345.2412 and amount 6.34805025 BTC. Trade side is not known

N Message type MDReqID Symbol Repeating groups of market data _ _ _ _ _ _
1 Market Data Snapshot Full Refresh (W) 3136 BTC/USD NoMDEntries 1
MDEntryType MDEntryPx MdEntrySize MdEntryDate MDEntryTime MDEntryBuyer MdEntrySeller
Trade 345.2517 0.10000000 20090624 15:41:29.000 N Y
2 Market Data Snapshot Full Refresh (W) 3136 BTC/USD NoMDEntries 1
MDEntryType MDEntryPx MdEntrySize MdEntryDate MDEntryTime MDEntryBuyer MdEntrySeller
Trade 350.1624 160.00000000 20090624 15:41:31.530 Y N
3 Market Data Snapshot Full Refresh (W) 3136 BTC/USD NoMDEntries 1
MDEntryType MDEntryPx MdEntrySize MdEntryDate MDEntryTime MDEntryBuyer MdEntrySeller
Trade 345.2412 6.34805025 20090624 15:41:32.162

Requesting Duplicate Subscription with different MDReqID

Message type MDReqID Subscription RequestType NoRelated Sym Symbol Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 313 Snapshot 1 BTC/USD 5 2 Bid
Offer
Market Data Request (V) 314 Snapshot 1 BTC/USD 2 2 Bid
Offer

Aggregator will ignore later subscription with MDReqID = 314 and will reinitialize subscription with MDReqID = 313 and continue sending updates for subscription with MDReqID = 313.

Requesting Duplicate Subscription with existing MDReqID

Message type MDReqID Subscription RequestType Symbol NoRelated Sym Market Depth NoMDEntry Type MDEntry Type
Market Data Request (V) 313 Snapshot BTC/USD 1 10 2 Bid
Offer
Market Data Request (V) 313 Snapshot BTC/USD 1 2 2 Trade

Aggregator will reinitialize subscription with MDReqID = 313 (Depth=10) and continue sending updates for subscription with MDReqID = 313 (Depth=10).