Introduction
Last updated: 2024-10-17
Welcome to CEX.IO Prime Liquidity trader and developer documentation. This document outline exchange functionality, market details, and APIs.
Latest Changes
Please find the list of changes in API functionality effective from the specified date.
2024-07-12
REST API, WebSocket API - added new Wallet Balance method (REST, WebSocket specifications), which allows Client to retrieve current balances on CEX.IO Wallet account.
2023-10-26
WebSocket API - updates for Execution Report Event Notifications (see specification here):
Execution Reports with executionType “Trade” will contain additional new fields lastAmountCcy1 and lastAmountCcy2, which represent order last trade amounts in CCY1 and CCY2 .
Due to implemented changes, fields lastQuantity and lastPrice will soon be deprecated, so all Clients should switch to usage of new fields as soon as possible.
2023-10-09
WebSocket API - for Clients' convenience WebSocket Account Events will contain additional sub-account currency total on hold balance snapshot (funds reserved for active orders, initiated withdrawals, etc.) in "onHoldBalance" field.
General
Prime Liquidity
is a solution within CEX.IO, which provides services for Clients for professional trading. It allows Clients to view liquidity, place orders, cancel orders and view order status using protocol FIX 4.4.Client
is a company, institution, or high-volume trader (Broker, Bank, Payment System, Trade institution, etc)Liquidity
— current open orders (order book) from liquidity providers, which may be filled by Client’s orders based on his trading terms.Liquidity provider
is an external business entity that Prime Liquidity can use to place orders and view liquidity. Order is a Client’s instruction to Prime Liquidity to buy or sell something on Client’s behalf.
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, he can create sub-accounts.
Sub-accounts is the option the Client can use at his will. Client can specify the sub-account in his trade order, and that instructs Prime Liquidity, which sub-account to use to transfer to/from the funds during this order execution. Only one sub-account can be specified for single trade order.
Sub-accounts may be useful for Client if he wishes 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, he can then simply ignore it and use only his main account, without specifying sub-accounts.
When depositing funds to his Prime Liquidity account, Client can omit sub-accounts, for funds to be transferred to his main account in Prime Liquidity. 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 than 0 and less than 256.
Client can transfer funds between his sub-accounts in Prime Liquidity using special web page, API, or making a request to support service. Client can view his sub-accounts and main account balances in Prime Liquidity using special web page, API, or making a request to support service.
Deposit and Withdrawal
To be able to trade via Prime Liquidity, Client should prepare his CEX.IO account:
- Client registers a user on CEX.IO website and completes required user verification.
- Client provides his CEX.IO user identifier to Prime Liquidity.
- Client can fund his CEX.IO account using any available deposit methods (for example, bank transfer, payment card or Bitcoin transfer).
- Client can withdraw his 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 Prime Liquidity account, Client should:
- Initiate a withdrawal using withdrawal method called “Prime Liquidity” on CEX.IO website. Client should specify the amount and currency to be transferred to his account in Prime Liquidity. 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.
- After successful withdrawal, Client’s CEX.IO account balance decreases, while Client’s Prime Liquidity 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 Prime Liquidity account, Client should:
- Initiate deposit using deposit method called “Prime Liquidity”. Client should specify the amount and currency to be transferred from his account in Prime Liquidity. 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.
- After successful deposit, Client’s CEX.IO account balance increases, while Client’s Prime Liquidity 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 and REST APIs (see “WebSocket” and "REST" sections for details). Prime Liquidity does not charge Client any commission for transferring funds between his accounts.
Deposit and Withdrawal limitations
- 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.
- 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.
- 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 Prime Liquidity account.
- 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 Prime Liquidity account and 98 USD should be added to Client’s CEX.IO account.
- 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 Prime Liquidity 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 Prime Liquidity 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:
- Fully executed immediately.
- Not executed immediately, and left open to be fully or partially executed, or cancelled (depending on TimeInForce(59) field value).
- Partially executed immediately and have open outstanding amount waiting to be fully or partially executed, or cancelled (depending on TimeInForce(59) field value).
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. Prime Liquidity 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. Prime Liquidity 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.00243732 BTC and amount in currency2 is 99.93 USD (average execution price is 41000 USD).
Leverage and debts
Currently, Prime Liquidity does not provide leverage trading, loans, etc. However, Client's account balance might appear to be negative in some rare cases, which means Client owes funds to Prime Liquidity. If such situation happens, Prime Liquidity 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 Prime Liquidity can undertake any or all of the following forced actions:
- Deny Client’s withdrawal requests if any of Client’s accounts balance is negative.
- Execute market order on Client’s behalf to eliminate negative balance.
- 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 Limit(4) | Present |
Missing | Present |
Present |
Order TimeInForce
If Client uses TimeInForce(59) field, he instructs Prime Liquidity how long the order should be open after initial placement or execution. TimeInForce(59) is used only for Limit and Stop Limit orders.
- Good Till Cancel (GTC)(1) — the order remains open till either full execution or cancellation. GTC orders can be executed partially.
- 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.
- 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 method (refer to(REST and WebSocket specifications). The following order limitations are present in Prime Liquidity system:
- Minimum Order Amount in currency1. Applies to orders where amount is specified in currency1.
- Maximum Order Amount in currency1. There are two options: 1) pendingPayout that apply for Market and orders 2) other orders (regular Limit orders).
- 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.
- Minimum Order Amount in currency2. Applies to orders where amount is specified in currency2. For example, for Market order with currency2 specified.
- Maximum Order Amount in currency2. Applies to orders where amount is specified in currency2. For example, for Market order with currency2 specified.
- 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.
- Order amount precision. This limit describes maximum decimal places the order amount can have.
- 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.
- Maximum number of active (open) orders Client can have. By default, Client can have a maximum of 20 active taker orders and 50 active maker orders.
Order throttling
Prime Liquidity 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 Prime Liquidity.
Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity to build new servers for it), Prime Liquidity 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. Prime Liquidity charges commission only for executed order amount. For example, if the order is placed, not executed and cancelled, Prime Liquidity holds amount X as order commission before placement and returns the whole amount X to Client’s account after the order is cancelled.
Prime Liquidity holds commission amount in currency2 before order placement in case order is “BUY Symbol”, because Prime Liquidity needs to be sure that Client has enough currency2 funds to pay for both order and commission. Prime Liquidity does not hold commission before placing the order is case the order is “SELL Symbol”, because Prime Liquidity 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 22.56 USD. Thereby, Prime Liquidity may round the commission amount and charge 0.07 USD commission (0.3% * 22.56 = 0.06768 USD), which is 0.310284% 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 Prime Liquidity and Client, the Client has “maximum commission rate” value, meaning the maximum percentage from order amount in currency2 that Prime Liquidity can charge for order execution. Prime Liquidity holds maximum order commission amount from Client’s account before the order is placed. Prime Liquidity 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 in final status, 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, Prime Liquidity 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 Prime Liquidity holds the specified amount from Client’s account including maximum order commission. If the amount to hold cannot be strictly defined, then Prime Liquidity estimates the required amount to execute order and order commission. If there is enough amount on Client’s account, then Prime Liquidity holds this amount and starts order processing. If there is not enough amount on Client’s account, then Prime Liquidity 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 Prime Liquidity finalises the order. During order finalisation, Prime Liquidity 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, Prime Liquidity can charge additional amount from Client’s account (e.g. when amount to hold was underestimated).
Amount estimation
Amount is estimated only for Market orders in such cases:
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 0.3 BTC at market price” Prime Liquidity 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 41,000 USD per BTC, then Prime Liquidity needs to ensure the Client has at least 12,300 USD (41,000 * 0.3 = 12,300) 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 12,915 USD (12,300 + 4%marketRisk + 1%commission). So, Prime Liquidity will try to hold 12,915 USD to start processing this order. If there is not enough USD on specified Client’s account, then Prime Liquidity will reject such order without any hold.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 61,500 USD” Prime Liquidity 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 41,000 USD per BTC, then Prime Liquidity needs to ensure the Client has at least 1.5 BTC (~ 61,500 / 41,000 = 1.5) 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 1.575 BTC (1.5 + 4%marketRisk + 1%commission) for order amount. So, Prime Liquidity will try to hold 1.575 BTC to start processing the order. If there is not enough BTC funds on specified Client’s account, then Prime Liquidity will reject such order without any hold.
For all other order types (all Limit orders, all Stop Limit orders, some Market orders), amount is not estimated, and Prime Liquidity uses requested order amounts without any marketRisk coefficient etc.
API
Client interacts with Prime Liquidity through API (Application Programming Interface). There are three available API channels which can be used by Client:
FIX (Financial Information eXchange)
— this API should be used for trading and receiving market data.WS (WebSocket)
— this API should be used for trading, receiving information about Client’s accounts balances and receiving market data.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 Prime Liquidity will reach out with information on how to set up Client’s connection. Client can also get access to DEV/UAT Prime Liquidity environments before connecting to PROD, in order to smooth the integration process.
We published public client library to communicate with Prime Liquidity via REST and WS. You can use it if you have NodeJS or just check realization and adapt it to your programming language. Check it here https://github.com/cex-io-exchange/cexio-prime-liquidity
REST API Endpoint URL
https://liquidity.prime.cex.io/api/rest
WebSocket API Endpoint URL
https://liquidity.prime.cex.io/api/ws
Client should provide the following information to Prime Liquidity:
- Prime Liquidity needs to know the IP address or network range, from which Client will be connecting for whitelisting in Prime Liquidity’s firewall.
- If Client wishes to provide his SSL certificate, Prime Liquidity 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.
Prime Liquidity should provide the following information about connection settings to the Client:
- Prime Liquidity CompId.
- Client CompIds (there can be a few sessions per Client, and therefore a few Client’s CompId which can be used by Client).
- Client’s username and password that should be used in Username(553) and Password(554) fields in Logon(A) message in FIX API.
- Client’s apiKey and apiSecret that should be used in WebSocket and REST APIs.
- Prime Liquidity host name or IP address, TCP port number and URL, where Client should connect to, for FIX, REST and WebSocket APIs.
- Prime Liquidity SSL certificate. Client should add this certificate to his trust store or set “Trust all certificates” option in his software to be able to connect.
- If Client wishes to connect to Prime Liquidity through VPN, Prime Liquidity should provide VPN connection settings and instruction on how to setup VPN connection on Client’s side. This connection option is optional and is disabled by default.
Maintenance period
Prime Liquidity regularly performs maintenance works. Usually it happens once a week or once a month and usually takes less than an hour. Prime Liquidity should inform Client in advance about maintenance schedule. During this period:
- Prime Liquidity cancels all active Client’s orders.
- Prime Liquidity does not accept new Client’s orders.
- Prime Liquidity can drop both FIX and WS connections. After maintenance period is over, Client should reconnect.
- Prime Liquidity resets sequence numbers in all FIX sessions.
Prime Liquidity's team does its best to achieve 100% availability of all the services and components. However, in rare cases due to various reasons there can also occur short-time unscheduled maintenance periods.
Nevertheless, in response to API requests Client can receive error messages about temporary unavailability of some services in case of ongoing scheduled or unscheduled maintenance (for example, "market_data is on maintenance", "order_placement is on maintenance", "order_cancellation is on maintenance", "order_status is on maintenance" etc.).
Operating hours
Prime Liquidity operates 24/7 with no holidays. The only cases, when Prime Liquidity might be not available, are:
- IT system failures. Prime Liquidity team does its best to achieve 100% availability, however sometimes failures happen because of various reasons. Prime Liquidity team will resolve such problems as soon as possible, but services might be unavailable for Clients during this period.
- Scheduled maintenance period.
REST
The REST API has endpoint 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.
REST API Endpoint URL
https://liquidity.prime.cex.io/api/rest
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 exist. |
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 period of time. |
500: Service Unavailable | This status indicates that something is wrong on the server side, additional info will be provided in response. If this status is returned too often, please contact your account 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://liquidity.prime.cex.io/api/rest/${action}`,
method: 'POST',
headers: headers,
json: true,
body: params
}, (error, response, body) => {
console.log('statusCode:', response && response.statusCode)
console.log('body:', body)
})
Prime Liquidity uses API keys to allow access to private APIs. You can obtain them by asking your account manager.
All REST requests must contain the following headers:
Header name | Description |
---|---|
X-AGGR-KEY | The api key as a string. |
X-AGGR-TIMESTAMP | A unix timestamp (in seconds) 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).
API Key Permissions
To restrict access to certain functionality while using of API Keys there should be defined specific set of permissions for each API Key. The defined set of permissions can be edited further if necessary.
The following permission levels are available for API Keys:
Read – permission level for viewing of account related data, receiving reports, subscribing to market data etc.
Trade – permission level, which allows placing and cancelling orders on behalf of account.
Funds Internal – permission level, which allows transferring funds between accounts (between sub-accounts or main account and sub-accounts) of CEX.IO Prime Liquidity Portfolio.
Funds Wallet - permission level, which allows transferring funds from CEX.IO Prime Liquidity Portfolio accounts (main account and sub-accounts) to CEX.IO account and vice versa.
Funds External – permission level, which allows transferring funds from CEX.IO Prime Liquidity Portfolio accounts (main account and sub-accounts) to external addresses.
Required permissions as to each API method are listed in the documentation below.
Trading Conditions
Using this request, Client can find out his actual settings for each trading pair.
HTTP REQUEST
POST /get_my_trading_conditions
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Successful Get My Trading Conditions Request
Request (client sends a request to find out his trading settings for the pair “BTC-USD”)
{
"pairs": ["BTC-USD"]
}
Response (Prime Liquidity 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 is 100 BTC
"pendingPayout": "10.00000000" // Max Order Amount in currency1 for Market orders is 10 BTC
},
"maxOrderAmountCcy2": {
"default": "50000.00000000", // Max Order Amount in currency2 for orders other than Market is 50000 USD
"pendingPayout": "5000.00000000" // Max Order Amount in currency2 for Market 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 (Prime Liquidity 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 his trading settings, however the mandatory field “pairs” is missing)
{}
Response (Prime Liquidity 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 his 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 show Client’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 if 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 | 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. |
maxOrderAmountCcy1. pendingPayout | Yes | Float | Maximum Order Amount in currency1. pendingPayout option apply to Market orders. |
maxOrderAmountCcy2. default | Yes | Float | Maximum Order Amount in currency2. default option apply to all orders other than Market. |
maxOrderAmountCcy2. pendingPayout | Yes | Float | Maximum Order Amount in currency2. pendingPayout option apply to Market 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 V3
By using Account Status V3 method, Client can find out current balance and it’s indicative equivalent in converted currency (by default “USD”), amounts locked in open (active) orders as to each sub-account and currency.
If credit line is enabled for Client, then response will also contain general credit line data such as base currency name, exposure limit, total debt amount, total balance on hold in base currency together with specific balance and balance on hold equivalents in base currency as to each currency on all Client’s sub-accounts.
If overdraft limit for specific currencies is enabled for Client, then response will also contain data as to amount of overdraft limit for each of such currencies.
It’s Client’s responsibility to track his sub-accounts available trading balance as current sub-account balance reduced by the balance amount locked in open (active) orders on sub-account. Client should also take into consideration general overdraft limits and credit line exposure limit, total debt and total balance on hold (if overdraft limit and\or credit line were configured for Client).
HTTP REQUEST
POST /get_my_account_status_v3
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Get My Account Status V3 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 (Prime Liquidity responds that Client has main account with currencies "EUR", "USD" and "BTC" and sub-account "hallo" with currencies "EUR", "USD" and "ADA". Also, it contains balance equivalents in converted currency for each account and each currency)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"EUR": {
"balance": "81268.59756471",
"balanceOnHold": "1000.00000000",
"balanceInConvertedCurrency": "91237.00374199"
},
"USD": {
"balance": "1537803.93463592",
"balanceOnHold": "1150.28899854",
"balanceInBaseCurrency": "1537803.93463592"
},
"BTC": {
"balance": "981.03037775",
"balanceOnHold": "0.00100000",
"balanceInConvertedCurrency": "29288171.41253737"
}
},
"hallo": {
"EUR": {
"balance": "10004.99100000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "11233.60389480"
},
"USD": {
"balance": "9994.87699999",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "9994.87699999"
},
"ADA": {
"balance": "3999.10000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "1219.32559000"
}
}
}
}
}
Get My Account Status V3 for selected Sub-accounts for All Currencies
Request (Client sends a request to find out Client's accounts’ statuses for specified accounts for all currencies)
{
"accountIds": ["hallo", "superhat"]
}
Response (Prime Liquidity responds that Client has sub-account "hallo" with currencies "USD" and "ADA". Sub-account "superhat" status was requested, but 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": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"hallo": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39.79438200"
},
"ADA": {
"balance": "15.00000000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "4.57350000",
"balanceInConvertedCurrency": "4.57350000"
}
}
}
}
}
Get My Account Status V3 for All Accounts for Selected Currencies
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies)
{
"currencies":["USD","BTC"]
}
Response (Prime Liquidity responds that Client has main account and sub-account "account123", each with currencies "USD" and "BTC". Note that other currencies (like "EUR", "ETH" etc.) are not included into response, because their balances were not requested)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39.79438200"
},
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"USD": {
"balance": "100.00000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "100.00000000"
},
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V3 for All Accounts for One Selected Currency
Request (Client sends request to find out his accounts’ statuses for all accounts for "BTC" currency)
{
"currencies": ["BTC"]
}
Response (Prime Liquidity responds that main account and sub-account "account123" have "BTC" balances. Note that other currencies (like "USD", "EUR", "SHIB" etc.) and other sub-accounts are not included in the response, because they were not requested or do not contain balances in requested currencies)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V3 - No Account Matching Criteria
Request (Client sends request to find out his accounts’ statuses for main account and sub-account "hallo" only for "EUR" currency balance)
{
"currencies": ["EUR"],
"accountIds": ["", "hallo"]
}
Response (Prime Liquidity responds that Client has no accounts which satisfy request criteria)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {}
}
}
Get My Account Status V3 for Single Account for Single Currency
Request (Client sends request to find out the main account status for USD currency)
{
"currencies": ["USD"],
"accountIds": [""]
}
Response (Prime Liquidity responds that Client has main account and includes USD balance on it. No other accounts are included, and no other currencies are included, because they were not requested for)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "1537803.93463592",
"balanceOnHold": "1150.28899854",
"balanceInConvertedCurrency": "1537803.93463592"
}
}
}
}
}
Get My Account Status V3 for All Accounts for Selected Currencies with enabled Credit Line and Overdraft Limit
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies. Client has enabled Credit Line and Overdraft Limit)
Note that Client has enabled Credit Line and Overdraft Limit for "USD" currency
{
"currencies":["USD","BTC"]
}
Response (Prime Liquidity responds that Client has balances in "USD" and "BTC" on main account and sub-accounts "hallo", "account123" and also balance in "BTC" on "someAccount2" sub-account)
Note that Client has enabled Credit Line and Overdraft Limit for "USD" currency
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"creditLine": {
"baseCurrency": "USD",
"exposureLimit": "1000000.00000000",
"totalDebt": "33.14403771",
"totalBalanceOnHold": "3.92144100",
"overdraftLimits": {
"USD": "450.00000000"
},
}
},
"balancesPerAccounts": {
"": {
"USD": {
"balance": "-33.14403771",
"balanceOnHold": "3.92144100",
"balanceInBaseCurrency": "-33.14403771",
"balanceInConvertedCurrency": "-33.14403771",
"balanceOnHoldInBaseCurrency": "3.92144100"
},
"BTC": {
"balance": "0.00650000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "260.30615000",
"balanceInConvertedCurrency": "260.30615000",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
},
"hallo": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceOnHoldInBaseCurrency": "0.00000000"
},
"BTC": {
"balance": "1.10000000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "43964.30458121",
"balanceInConvertedCurrency": "43964.30458121",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
},
"account123": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceOnHoldInBaseCurrency": "0.00000000"
},
"BTC": {
"balance": "0.00020000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "8.00942000",
"balanceInConvertedCurrency": "8.00942000",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
},
"someAccount2": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "39969.03458121",
"balanceInConvertedCurrency": "39969.03458121",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
}
}
}
}
}
Get My Account Status V3 - Incorrect Request
Request (Client sends request, however "accountIds" field contains not an Array but a number value)
{
"accountIds": 3,
"currencies":["BTC"]
}
Response (Prime Liquidity responds about request processing error because not an array has been sent in "accountIds" field and "accountIds" array should consist of string type values)
{
"error": "accountIds array should consist of string type values",
"statusCode": 422
}
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 and of string type. 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 an empty array ([]), then it means Client wants to find out balances for all available currencies. |
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 of string type and should be present only once in this array. For example, ["hallo", "", "account123", "hallo"] is not allowed. If this field is missing or if it contains an empty array ([]), then it means Client wants to find out balances for all accounts. |
Response Content
Field Name | Mandatory | Format | Description |
---|---|---|---|
data | Yes | Object | This object contains response details. It should contain balancesPerAccounts and convertedCurrency mandatory fields and could also contain creditLine optional field. |
data.convertedCurrency | Yes | String | The currency in which balanceInConvertedCurrency is calculated by CEX.IO Prime Liquidity. By default only "USD" value is allowed herein. |
data.creditLine | No | Object | This object contains details about Client’s credit line configuration (base currency, exposure limit, total debt, total balance on hold), overdraft limits, withdrawal overdraft limits (if at least one of these options are enabled for Client). If such options are not enabled for Client, then this field would be missing. |
data.creditLine.baseCurrency | No | String | The currency in which exposureLimit, totalDebt, totalBalanceOnHold, balanceInBaseCurrency and balanceOnHoldInBaseCurrency values are calculated by CEX.IO Prime Liquidity. |
data.creditLine.exposureLimit | No | String (which can be parsed as Float) | Credit line limit available for Client. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is defined in baseCurrency. |
data.creditLine.totalDebt | No | String (which can be parsed as Float) | Describes total amount of negative balances on all Client's accounts. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is calculated in baseCurrency. |
data.creditLine.totalBalanceOnHold | No | String (which can be parsed as Float) | Describes total amount of сurrent balances which is reserved (locked) for active orders on all Client’s accounts. This amount is cummulative and common for all Client’s accounts (main and sub-accounts) and is calculated in baseCurrency. |
data.creditLine.overdraftLimits | No | Object | This object contains details about Client’s overdraft limit configuration if such option is enabled for Client. Overdraft limit is set for specific currencies and is common for all Client’s accounts (main and sub-accounts). If overdraft limit is not enabled for Client, then this field would be missing. |
data.creditLine.overdraftLimits.ZZZ | Yes | String (which can be parsed as Float) | Overdraft limit for specific ZZZ currency, which is enabled for all Client's accounts. |
data.balancesPerAccounts | Yes | Object | This object contains details about Client's currencies' balances as to each account which satisfies request criteria. It might be empty object ("{}"), but this field should be present anyway and it should contain an object. If this field contains an empty object, then it means Client has no accounts which satisfy Client’s request criteria. |
data.balancesPerAccounts.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.balancesPerAccounts.X.YYY | No | Object | Represents an object which describes X account statuses for YYY currency. |
data.balancesPerAccounts.X.YYY. balance | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency. It includes balance which is reserved (locked) for active orders (please find this information in "balanceOnHold" field). |
data.balancesPerAccounts.X.YYY. balanceOnHold | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency which is reserved (locked) for active orders. |
data.balancesPerAccounts.X.YYY. balanceInBaseCurrency | No | String (which can be parsed as Float) | Equivalent in base currency of current YYY currency balance on Client's X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If credit line is not enabled for Client OR if current YYY currency balance on Client's X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in base currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceInConvertedCurrency | No | String (which can be parsed as Float) | Equivalent in converted currency of current YYY currency balance on Client’s X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to converted currency. If current YYY currency balance on Client’s X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in converted currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceOnHoldInBaseCurrency | No | String (which can be parsed as Float) | Equivalent in base currency of current X account balance in YYY currency which is reserved (locked) for active orders on Client’s X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If credit line is not enabled for Client, then this field would be missing. |
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. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Account Status V2 (deprecated)
Using Account Status V2 request, Client can find out current balance and it’s indicative equivalent in converted currency (by default “USD”), available trading balance and amounts which are locked in open (active) orders as to each sub-account and currency.
Available trading balance is calculated as current balance plus overdraft limit (if allowed for the Client) and reduced by the balance amount locked in open (active) orders.
If credit line is enabled for Client, then response will also contain data as to the base currency name, exposure limit, total debt amount, currencies balance equivalents in base currency as to each currency on all Client’s accounts (main account and sub-accounts).
If overdraft limit for specific currency is enabled for Client, then response will also contain data as to amount of overdraft limit for such currency on all Client’s accounts (main account and sub-account), which have balance in specified currency.
HTTP REQUEST
POST /get_my_account_status_v2
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Get My Account Status V2 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 (Prime Liquidity responds that Client has main account with currencies "USD", "ADA" and "BTC" and sub-account "hallo" with currencies "ETH" and "SHIB". Also, it contains balance equivalents in converted currency for each account and each currency)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceAvailable": "39.79438200",
"balanceInConvertedCurrency": "39.79438200"
},
"ADA": {
"balance": "20.24000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "20.24000000",
"balanceInConvertedCurrency": "16.21191616"
},
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00040000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"hallo": {
"ETH": {
"balance": "15.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "15.00000000",
"balanceInConvertedCurrency": "38962.11113119"
},
"SHIB": {
"balance": "1573107",
"balanceOnHold": "1210584",
"balanceAvailable": "362523",
"balanceInConvertedCurrency": "35.61514248"
}
}
}
}
}
Get My Account Status V2 for selected Sub-accounts for All Currencies
Request (Client sends a request to find out Client's accounts’ statuses for specified accounts for all currencies)
{
"accountIds": ["hallo", "superhat"]
}
Response (Prime Liquidity responds that Client has sub-account "hallo" with currencies "ETH" and "SHIB". Sub-account "superhat" status was requested, but 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": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"hallo": {
"ETH": {
"balance": "15.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "15.00000000",
"balanceInConvertedCurrency": "38962.11113119"
},
"SHIB": {
"balance": "1573107",
"balanceOnHold": "1210584",
"balanceAvailable": "362523",
"balanceInConvertedCurrency": "35.61514248"
}
}
}
}
}
Get My Account Status V2 for All Accounts for Selected Currencies
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies)
{
"currencies":["USD","BTC"]
}
Response (Prime Liquidity responds that Client has main account and sub-account "account123", each with currencies "USD" and "BTC". Note that other currencies (like "EUR", "ETH" etc.) are not included into response, because their balances were not requested)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceAvailable": "39.79438200",
"balanceInConvertedCurrency": "39.79438200"
},
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00040000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"USD": {
"balance": "100.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "100.00000000",
"balanceInConvertedCurrency": "100.00000000"
},
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V2 for All Accounts for One Selected Currency
Request (Client sends request to find out his accounts’ statuses for all accounts for "BTC" currency)
{
"currencies": ["BTC"]
}
Response (Prime Liquidity responds that main account and sub-account "account123" have "BTC" balances. Note that other currencies (like "USD", "EUR", "SHIB" etc.) and other sub-accounts are not included in the response, because they were not requested or do not contain balances in requested currencies)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00040000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V2 - No Account Matching Criteria
Request (Client sends request to find out his accounts’ statuses for main account and sub-account "hallo" only for "EUR" currency balance)
{
"currencies": ["EUR"],
"accountIds": ["", "hallo"]
}
Response (Prime Liquidity responds that Client has no accounts which satisfy request criteria)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {}
}
}
Get My Account Status V2 for Single Account for Single Currency
Request (Client sends request to find out the main account status for USD currency)
{
"currencies": ["USD"],
"accountIds": [""]
}
Response (Prime Liquidity responds that Client has main account and includes USD balance on it. No other accounts are included, and no other currencies are included, because they were not requested for)
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "100.79438200",
"balanceOnHold": "70.00000000",
"balanceAvailable": "30.79438200",
"balanceInConvertedCurrency": "100.79438200"
}
}
}
}
}
Get My Account Status V2 for All Accounts for Selected Currencies with enabled Credit Line and Overdraft Limit
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies. Client has enabled Credit Line and Overdraft Limit for "USD" currency)
Note that Client has enabled Credit Line and Overdraft Limit for "USD" currency
{
"currencies":["USD","BTC"]
}
Response (Prime Liquidity responds that Client has balances in "USD" and "BTC" on main account and sub-accounts "hallo", "account123" and also balance in "BTC" on "someAccount2" sub-account)
Note that Client has negative "USD" balance on main account and, consequently, used Credit Line. Also, Client has some "USD" balance locked in orders and overall 450 "USD" overdraft limit for all Client's accounts.
{
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"creditLine": {
"baseCurrency": "USD",
"exposureLimit": "999.00000000",
"totalDebt": "33.14403771"
},
"balancesPerAccounts": {
"": {
"USD": {
"balance": "-33.14403771",
"balanceOnHold": "3.92144100",
"balanceAvailable": "412.93452129",
"overdraftLimit": "450.00000000",
"balanceInBaseCurrency": "-33.14403771",
"balanceInConvertedCurrency": "-33.14403771"
},
"BTC": {
"balance": "0.00650000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00650000",
"balanceInBaseCurrency": "260.30615000",
"balanceInConvertedCurrency": "260.30615000"
}
},
"hallo": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "450.00000000",
"overdraftLimit": "450.00000000"
},
"BTC": {
"balance": "1.10000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.10000000",
"balanceInBaseCurrency": "43964.30458121",
"balanceInConvertedCurrency": "43964.30458121"
}
},
"account123": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "450.00000000",
"overdraftLimit": "450.00000000"
},
"BTC": {
"balance": "0.00020000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00020000",
"balanceInBaseCurrency": "8.00942000",
"balanceInConvertedCurrency": "8.00942000"
}
},
"someAccount2": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.00000000",
"balanceInBaseCurrency": "39969.03458121",
"balanceInConvertedCurrency": "39969.03458121"
}
}
}
}
}
Get My Account Status V2 - Incorrect Request
Request (Client sends request, however "accountIds" field contains not an Array but a number value)
{
"accountIds": 3,
"currencies":["BTC"]
}
Response (Prime Liquidity responds about request processing error because not an array has been sent in "accountIds" field and "accountIds" array should consist of string type values)
{
"error": "accountIds array should consist of string type values",
"statusCode": 422
}
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 and of string type. 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 an empty array ([]), then it means Client wants to find out balances for all available currencies. |
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 of string type and should be present only once in this array. For example, ["hallo", "", "account123", "hallo"] is not allowed. If this field is missing or if it contains an empty array ([]), then it means Client wants to find out balances for all accounts. |
Response Content
Field Name | Mandatory | Format | Description |
---|---|---|---|
data | Yes | Object | This object contains response details. It should contain balancesPerAccounts and convertedCurrency mandatory fields and could also contain creditLine optional field (if credit line is enabled for Client). |
data.convertedCurrency | Yes | String | The currency in which balanceInConvertedCurrency is calculated by CEX.IO Prime Liquidity. By default only "USD" value is allowed herein. |
data.creditLine | No | Object | This object contains details about Client's credit line configuration (if enabled for Client), including information about the base currency, exposure limit and total debt. If credit line is not enabled for Client, then this field would be missing. |
data.creditLine.baseCurrency | Yes | String | The currency in which exposureLimit, totalDebt and balanceInBaseCurrency values are calculated by CEX.IO Prime Liquidity. |
data.creditLine.exposureLimit | Yes | String (which can be parsed as Float) | Credit line limit available for Client. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is defined in baseCurrency. |
data.creditLine.totalDebt | Yes | String (which can be parsed as Float) | Describes total amount of negative balances on all Client's accounts. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is calculated in baseCurrency. |
data.balancesPerAccounts | Yes | Object | This object contains details about Client's currencies' balances as to each account which satisfies request criteria. It might be empty object ("{}"), but this field should be present anyway and it should contain an object. If this field contains an empty object, then it means Client has no accounts which satisfy Client’s request criteria. |
data.balancesPerAccounts.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.balancesPerAccounts.X.YYY | No | Object | Represents an object which describes X account statuses for YYY currency. |
data.balancesPerAccounts.X.YYY. balance | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency. It includes balance which is reserved (locked) for active orders (please find this information in "balanceOnHold" field). |
data.balancesPerAccounts.X.YYY. balanceOnHold | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency which is reserved (locked) for active orders. |
data.balancesPerAccounts.X.YYY. balanceAvailable | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency which is available for trading. It is calculated as current X account balance in YYY currency plus overdraft limit for YYY currency (if enabled for the Client) and reduced by the X account balance amount in YYY currency, which is locked in open (active) orders. |
data.balancesPerAccounts.X.YYY. overdraftLimit | No | String (which can be parsed as Float) | Overdraft limit for YYY currency, which is enabled for all Client's accounts. Cverdraft limit is set for specific YYY currency and is common for all Client's accounts (main and sub-accounts), but is shown in each account of the response which has balances in YYY currency. If overdraft limit is not set for YYY currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceInBaseCurrency | No | String (which can be parsed as Float) | Equivalent in base currency of current YYY currency balance on Client's X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If credit line is not enabled for Client OR if current YYY currency balance on Client's X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in base currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceInConvertedCurrency | No | String (which can be parsed as Float) | Equivalent in converted currency of current YYY currency balance on Client's X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If current YYY currency balance on Client's X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in converted currency, then this field would be missing. |
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. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Wallet Balance
This request allows Client to receive his CEX.IO Wallet balances, which can be useful for Client to check his current Wallet balances while depositing\withdrawing funds between Prime Liquidity and Wallet accounts.
HTTP REQUEST
POST /get_my_wallet_balance
API Key Permission
This method requires “Read” permission set for API Key.
Get My Wallet Balance - Successful request
Request (Client sends request to receive his Wallet account balances)
{}
Response (CEX.IO Prime Liquidity responds with Client's current balances in BTC, ETH, USD, EUR on Wallet account)
{
"ok": "ok",
"data": {
"BTC": {
"balance": "9.72101000"
},
"ETH": {
"balance": "10.000000"
},
"USD": {
"balance": "23567.02"
},
"EUR": {
"balance": "728.99"
}
}
}
Wallet Balance 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. |
XXX | Yes | Object | Represents an object which describes CEX.IO Wallet account status for XXX currency. |
XXX.balance | Yes | String (which can be parsed as Float) | Current CEX.IO Wallet account balance in XXX currency. |
error | No | String | If this field is present, then request is not successful. Represents human readable error reason of why request is not successful. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Orders
This request allows Client to find out info about his orders.
HTTP REQUEST
POST /get_my_orders
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Get My Orders - All Open Orders
Request (Client sends request to find all his open orders for all pairs and all accounts; setting no criteria for orders means that Client wants to get statuses for all open orders)
{}
Response (Prime Liquidity 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 his 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), Prime Liquidity 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 his open orders for "BTC-EUR" pair)
{
"pair": "BTC-EUR"
}
Response (Prime Liquidity 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 his open orders for currency pair "BTC-USD" and for sub-accounts "hallo" or "superhat")
{
"accountIds": ["hallo", "superhat"],
"pair": "BTC-USD"
}
Response (Prime Liquidity 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 received by server between 2016-06-06T16:11:29 and 2016-06-07T08:53:09)
{
"accountIds": [""],
"pageSize": 50,
"serverCreateTimestampFrom": 1465229489578,
"serverCreateTimestampTo": 1465289589579
}
Response (Prime Liquidity 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 his archived SELL orders)
{
"archived": true,
"side": "SELL",
"serverCreateTimestampFrom": 1516699048964,
"serverCreateTimestampTo": 1516699987501
}
Response (supposed that Client has 3 archived orders (like in previous example), Prime Liquidity responds to Client that he has 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 sends request, but doesn't specify data object)
{}
Response (Prime Liquidity responds that error occurred. Note: "data" field hold an object value here, not the array)
{
"error": "Bad Request"
}
Get My Order - Page Size is Too Big
Request (Client sends 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 (Prime Liquidity 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 sends request to get his open orders, however "archived" field value is a number)
{
"archived": 0
}
Response (Prime Liquidity 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 his single order by orderId)
{
"orderId": 18
}
Response (Prime Liquidity 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 his single order by clientOrderId)
{
"clientOrderId": "1465299852968-0"
}
Response (Prime Liquidity 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 Market Buy Cash Order with includeFeeInAmount option used
Request (Client sends request to find his Market Buy Cash Order by clientOrderId)
{
"clientOrderId": "IncludeFee_order_112123in"
}
Response (Prime Liquidity responds with status of this order. Response among other contains both originalAmountCcy2 (amount in currency2 originally requested by Client to be executed) and requestedAmountCcy2 (amount calculated by Prime Liquidity to be executed) values, which indicate that Client originally asked for includeFeeInAmount option to be used for this order)
{
"ok": "ok",
"data": [
{
"orderId": "979524",
"clientOrderId": "IncludeFee_order_112123in",
"clientId": "IT_DEMO",
"accountId": null,
"status": "FILLED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"orderType": "Market",
"timeInForce": null,
"comment": null,
"rejectCode": null,
"rejectReason": null,
"initialOnHoldAmountCcy1": null,
"initialOnHoldAmountCcy2": "20.00000000",
"executedAmountCcy1": "0.00091316",
"executedAmountCcy2": "19.80198020",
"requestedAmountCcy1": null,
"requestedAmountCcy2": "19.80198020",
"originalAmountCcy2": "20.00000000",
"feeAmount": "0.19801980",
"feeCurrency": "USD",
"price": null,
"averagePrice": "21685.1",
"statusIsFinal": true,
"clientCreateTimestamp": 1674051322611,
"serverCreateTimestamp": 1674051325798,
"lastUpdateTimestamp": 1674051329147,
"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, Prime Liquidity ignores all other parameters in "data" field. |
orderId | No | Number | Order identifier assigned by Prime Liquidity (OrderID(37) field in Execution Report(8) message in FIX API). If both fields "orderId" and "clientOrderId" are present, then Prime Liquidity ignores "orderId" field. If this field is present (and "clientOrderId" is absent), then it means Client wants to see the status of the exact order. In this case, Prime Liquidity 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 his 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 his 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 his orders. |
accountIds | No | Array | List of account identifiers, for which Client wants to find his 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 his orders for all accounts. |
serverCreate TimestampFrom | No | Number | UTC timestamp in milliseconds. Represents the earliest server timestamp when order is received. In the result set orders’ serverCreateTimestamp should be greater than or equal to (>=) serverCreateTimestampFrom. Period indicated by serverCreateTimestampFrom and serverCreateTimestampTo values can not be greater than 365 days. This parameter is mandatory if Client queries info about archived orders. |
serverCreate TimestampTo | No | Number | UTC timestamp in milliseconds. Represents the latest server timestamp when order is received. In the result set orders’ serverCreateTimestamp should be less than (<) serverCreateTimestampTo. Period indicated by serverCreateTimestampFrom and serverCreateTimestampTo values can not be greater than 365 days. If this field is missing than current date is set by default. |
sortOrder | No | String | Sort order of the result set. The result array is sorted by serverCreateTimestamp. "ASC" - ascending order, "DESC" - descending order. If this field is missing then the default sort order is "DESC". |
pageSize | No | Number | Because the result might contain too many orders, Client should specify which portion of the result list he wants 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 he wants 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 than 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 field should be not Array, but Object. |
orderId | Yes | String | Order identifier assigned by Prime Liquidity (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 orders. |
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 currency2). |
requestedAmountCcy2 | Yes | String (which can be parsed as Float) | By default, 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). If both requestedAmountCcy2 and originalAmountCcy2 fields are present in the response, this field represents amount in currency2, which was calculated by Prime Liquidity system to be executed for execution of Client's Market Buy order with indicated amount in currency2 and enabled includeFeeInAmount option. |
originalAmountCcy2 | No | String (which can be parsed as Float) | If this field is present, it means Client has requested information about Market Buy order with amountCcy2 and enabled includeFeeInAmount option. In this case, the value in this field represents order amount in currency2, which was originall specified by Client in amountCcy2 field at placing of order. The value in this field should equal the sum of values specified in executedAmountCcy2 and feeAmount fields if the order was fully executed. |
initialOnHoldAmountCcy1 | Yes | String (which can be parsed as Float) | Represents amount in currency1, which was hold from Client's balance by Prime Liquidity before order execution. If this value is null, then it means that amount in currency1 was not hold from Client's account for this order. |
initialOnHoldAmountCcy2 | Yes | String (which can be parsed as Float) | Represents amount in currency2, which was hold from Client's balance by Prime Liquidity before order execution. If this value is null, then it means that amount in currency2 was not hold from Client's account for this order. |
feeAmount | Yes | String (which can be parsed as Float) | Represents order commission amount, 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, in which feeAmount is calculated for this order (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 was 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 new orders via REST API by using Do My New Order Request. The parameters and samples of such requests are shown in this section.
Response message indicates the last up-to-date status of order which is available in the system at the moment of sending the response.
If the Client did not receive a Response message to Do My New Order Request - the Client can query current status of the order by using Get My Orders Request with clientOrderId parameter.
When sending a request for new order, it is highly recommended to use clientOrderId parameter which corresponds to the specific new order request on the client's side. Prime Liquidity protects multiple placing of orders with the same clientOrderId for a reasonable period of time.
If more than one new orders with identical clientOrderId and other order parameters are identified - Prime Liquidity places only the first order and returns the status of such order to the Client in response to the second and subsequent new order requests with the same parameters. If orders with identical clientOrderId but with different other order parameters are identified - Prime Liquidity processes only the first order and rejects the second and subsequent new order requests with the same clientOrderID but with different other order parameters. Nevertheless, if Client creates more than one orders with same clientOrderId in a significant period of time, order with same clientOrderId can be accepted by the system. It's Client's responsibility to control unique indication of clientOrderIds.
HTTP REQUEST
POST /do_my_new_order
API Key Permission
This method requires “Trade” permission set for API Key.
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 7,500)
{
"clientOrderId": "1521711134775",
"currency1": "BTC",
"currency2": "USD",
"side": "SELL",
"timestamp": 1521711134775,
"orderType": "Limit",
"timeInForce": "GTC",
"amountCcy1": "0.01",
"price": 7500,
"comment": "v_overdraft_test"
}
Response (Prime Liquidity sends acknowledgement message with a current status of order)
{
"ok": "ok",
"data": {
"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"
}
}
Do My New Order - place Market BUY order
Request (Client requests to place a Market order to BUY 10 BTC for USD)
{
"accountId": "someAccount01",
"clientOrderId": "manual_1614173000191",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"timestamp": 1614173000191,
"orderType": "Market",
"amountCcy1": 10
}
Response (Prime Liquidity sends acknowledgement message with a status of order. The order has been rejected due to insufficient funds on Client’s account)
{
"ok": "ok",
"data": {
"clientId": "IT_DEMO",
"orderId": "338306",
"clientOrderId": "manual_1614173000191",
"accountId": "someAccount01",
"status": "REJECTED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "10.00000000",
"requestedAmountCcy2": null,
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Rejected",
"executionId": "1614012430993_103_295",
"transactTime": null,
"expireTime": null,
"effectiveTime": null,
"averagePrice": null,
"feeAmount": null,
"feeCurrency": null,
"orderRejectReason": "{\"code\":403,\"reason\":\"Insufficient funds\"}",
"rejectCode":403,
"rejectReason":"Insufficient funds"
}
}
Do My New Order - place Market BUY order
Request (Client requests to place a Market order to BUY 10 BTC for USD)
{
"accountId": "someAccount01",
"clientOrderId": "manual_1614173000191",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"timestamp": 1614173000191,
"orderType": "Market",
"amountCcy1": 10
}
Response (Prime Liquidity sends acknowledgement message with a status of order. The order has been rejected due to the exceeded limit of active (open) orders)
{
"ok": "ok",
"data": {
"clientId": "IT_DEMO",
"orderId": "338306",
"clientOrderId": "manual_1614173000191",
"accountId": "someAccount01",
"status": "REJECTED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "10.00000000",
"requestedAmountCcy2": null,
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Rejected",
"executionId": "1614012430993_103_295",
"transactTime": null,
"expireTime": null,
"effectiveTime": null,
"averagePrice": null,
"feeAmount": null,
"feeCurrency": null,
"orderRejectReason": "{\"code\":437,\"reason\":\"Too many active orders\"}",
"rejectCode":437,
"rejectReason":"Too many active orders"
}
}
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 18,500)
{
"clientOrderId": "1521713494191",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"timestamp": 1521713494191,
"orderType": "Limit",
"timeInForce": "GTC",
"amountCcy1": "0.01",
"price": 18500,
"comment": "v_overdraft_test"
}
Response (Prime Liquidity sends acknowledgement message with a current status of order)
{
"ok": "ok",
"data": {
"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"
}
}
Do My New Order - place Market BUY order with includeFeeInAmount option
Request (Client requests to place a Market order to BUY BTC for 20 USD and wants to include fee in the requested amount of order in currency2)
{
"accountId": "",
"clientOrderId": "IncludeFee_order_2",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"timestamp": 1674045860158,
"orderType": "Market",
"amountCcy2": 20,
"includeFeeInAmount": true
}
Response (Prime Liquidity sends response in the result of order execution. The order has been fully executed, the amount requested by Client to be executed is indicated in originalAmountCcy2 field, executed amount of currency2 is indicated executedAmountCcy2 field. The sum of executedAmountCcy2 (19.80198020 USD) and feeAmount (0.19801980 USD) equals originalAmountCcy2 requested by Client (20.00000000))
{
"ok": "ok",
"data": {
"messageType": "executionReport",
"clientId": "IT_DEMO",
"orderId": "979512",
"clientOrderId": "IncludeFee_order_2",
"accountId": null,
"status": "FILLED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00092567",
"executedAmountCcy2": "19.80198020",
"requestedAmountCcy1": null,
"requestedAmountCcy2": "19.80198020",
"originalAmountCcy2": "20.00000000",
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Trade",
"executionId": "1673607322492_100_3202",
"transactTime": "2023-01-18T12:44:27.084Z",
"expireTime": null,
"effectiveTime": null,
"averagePrice": "21392.1",
"lastQuantity": "19.80198020",
"lastPrice": "21392.1",
"feeAmount": "0.19801980",
"feeCurrency": "USD",
"clientCreateTimestamp": 1674045860158,
"serverCreateTimestamp": 1674045863598,
"lastUpdateTimestamp": 1674045867053
}
}
Do My New Order - Pending Market Order
Request (Client requests to place a Market order)
{
"clientOrderId": "12345678916",
"currency1": "ADA",
"currency2": "USD",
"side": "BUY",
"timestamp": 1673608169456,
"orderType": "Market",
"amountCcy1": "10"
}
Response (Prime Liquidity sends notification that order is pending)
{
"ok": "ok",
"data": {
"messageType": "executionReport",
"clientId": "someAccount01",
"orderId": "977174",
"clientOrderId": "12345678916",
"accountId": null,
"status": "NEW",
"currency1": "ADA",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "10.00000000",
"requestedAmountCcy2": null,
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "OrderStatus",
"executionId": 0,
"transactTime": "2023-01-13T11:09:45.614Z",
"expireTime": null,
"effectiveTime": null,
"averagePrice": null,
"feeAmount": "0.00000000",
"feeCurrency": "USD",
"clientCreateTimestamp": 1673608169456,
"serverCreateTimestamp": 1673608170503,
"lastUpdateTimestamp": 1673608170648
}
}
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",
"comment": "v_overdraft_test"
}
Response (Prime Liquidity 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 | Yes | String | Order identifier assigned by Client (ClOrdID(11) field in Execution Report(8) and in New Order Single (D) messages in FIX API). |
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 | Number | UTC timestamp in milliseconds, represents client-side order creation time (field TransactTime(60) in New Order Single(D) message in FIX API). By default, timestamp should be within 30000 ms timeframe with server time, otherwise, order will be rejected. Please be informed that default timeframe value 30000 ms can be changed for the Client by request. |
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 orders. |
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 currency2 (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 | No | String (parseable as Float) | Represents order price (corresponds to Price(44) field in New Order Single(D) message in FIX API). Please omit this field for orders, where price cannot be requested, for example, Market orders or Stop orders. |
expireTime | No | 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 (StopPx in FIX) for Stop and StopLimit types of orders. |
includeFeeInAmount | No | Boolean | This field can be applied only for Market Buy orders with indicated amountCcy2. Represents an instruction by Client to CEX.IO Prime Liquidity to include feeAmount for order execution in amountCcy2 specified by Client. If the value is "true", then Prime Liquidity will execute order in a way that the sum of executedAmountCcy2 and feeAmount should equal amountCcy2 requested by Client. If this parameter is missing or the value is "false", then Prime Liquidity will execute order in a way that executedAmountCcy2 should equal amountCcy2 requested by Client and feeAmount for order execution value will be charged additionally to executedAmountCcy2. |
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. |
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 Prime Liquidity (OrderID(37) field in Execution Report(8) message in FIX API). "NONE" value can be returned if order is rejected due to validation errors: failed minOrderAmountCcy, maxOrderAmountCcy, lotSizeCcy, max active orders checks. |
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 orders. |
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. |
executionType | Yes | String | Describes the type of order execution event, due to which executionReport is being sent to Client. Allowed values are “PendingNew”, “New”, “Trade”, “PendingCancel” , “Canceled”, “Rejected”, “OrderStatus”. |
orderRejectReason | No | String | Text field describing rejection reason. Often (but not always) it 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. |
rejectCode | No | Number | Numeric error code. |
rejectReason | No | String | Text field indicating 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) | By default, 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). If both requestedAmountCcy2 and originalAmountCcy2 fields are present in the response, it means Client has requested to place Market Buy order with amount in currency2 with enabled includeFeeInAmount option and the value in this field represents amount in currency2, which was calculated by Prime Liquidity system and is expected to be executed so that the sum of executedAmountCcy2 and feeAmount equals amount in currency2 requested by the Client (indicated in originalAmountCcy2 field). |
originalAmountCcy2 | No | String (which can be parsed as Float) | If this field is present, it means Client has requested to place Market Buy order with amountCcy2 and enabled includeFeeInAmount option. In this case, the value in this field represents order amount in currency2, which was specified by Client in amountCcy2 field. Upon full order execution the value in this field should equal the sum of values specified in executedAmountCcy2 and feeAmount fields. |
feeAmount | Yes | String (which can be parsed as Float) | Represents order commission amount, 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, in which feeAmount is calculated (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 orders, 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. |
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
API Key Permission
This method requires “Trade” permission set for API Key.
Request Parameters
Do Cancel My Order - successful cancellation of Limit SELL BTC order by clientOrderId
Request (Client requests to cancel order that was created with clientOrderId equal to "1521719532817")
{
"clientOrderId": "1521719532817",
"cancelRequestId": "cancel_1521719532817",
"timestamp": 1521719535310
}
Response (Prime Liquidity sends acknowledgement message confirming that the cancellation request is accepted)
{
"ok": "ok",
"data": {}
}
Do Cancel My Order - successful cancellation of Limit BUY BTC order by orderId
Request (Client requests to cancel order, to which Prime Liquidity assigned orderId equal to 123456789)
{
"orderId": 123456789,
"cancelRequestId": "cancel_1521719532818",
"timestamp": 1521719535311
}
Response (Prime Liquidity sends acknowledgement message confirming that the cancellation request is accepted)
{
"ok": "ok",
"data": {}
}
Do Cancel My Order - incorrect request with missing "orderId" and "clientOrderId" parameters
Request (Client requests to cancel order but doesn't indicate either "orderId" or "clientOrderId" parameters)
{
"cancelRequestId": "cancel_1521719532834",
"timestamp": 1521719535322
}
Response (Prime Liquidity responds that either "clientOrderId" or "orderId" should be specified)
{
"error": "ClientOrderId or orderId should be specified",
"statusCode": 422
}
Do Cancel My Order - incorrect request with both "orderId" and "clientOrderId" parameters
Request (Client requests to cancel order but indicates both "orderId" and "clientOrderId" parameters)
{
"clientOrderId": "1521719532817",
"orderId": 123456789,
"cancelRequestId": "cancel_1521719532899",
"timestamp": 1521719535349
}
Response (Prime Liquidity responds that either "clientOrderId" or "orderId" should be specified - not both of them)
{
"error": "Only one of the fields ClientOrderId or orderId should be specified, not both",
"statusCode": 422
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
orderId | No | Number | Order identifier assigned by Prime Liquidity (OrderID(37) field in Execution Report(8) message in FIX API). If this field is present and contains valid value, then it means Client wants to cancel specific order with orderId, which was assigned by Prime Liquidity. If "orderId" field is present, then "clientOrderId" should be absent. Either "orderId" or "clientOrderId" should be indicated in request anyway. |
clientOrderId | No | String | Order identifier assigned by Client when the order was created. If this field is present and contains valid value, then it means Client wants to cancel specific order with clientOrderId indicated by Client at order placement. If "clientOrderId" field is present, then "orderId" field should be absent. Either "clientOrderId" or "orderId" should be indicated in request anyway. |
cancelRequestId | Yes | String | Cancel request identifier assigned by Client. |
timestamp | Yes | Number | 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
API Key Permission
This method requires “Trade” permission set for API Key.
Do Cancel All Orders
Request (Client requests to cancel all open orders)
{}
Response (Prime Liquidity sends acknowledgement message confirming the list of client’s open orders, which system is trying to cancel. There are 2 open orders in this case)
{
"ok": "ok",
"data": {
"clientOrderIds": ["1575459943138","1575459942041"]
}
}
Do Cancel All Orders - There are no client’s open orders
Request (Client requests to cancel all open orders)
{}
Response (Prime Liquidity sends acknowledgement message confirming there are no client’s open 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.
Order book contains 2 sides: bid and ask. Get Exchange Rate request allows to perform rate estimation on both sides of the order book. There are 4 possible cases for rate estimation:
When Client sends BUY BTC-USD Get Exchange Rate request and specifies amount X and currency USD that means that he wants to buy BTC for X USD. In this case ask side of the order book will be used to perform the measurement.
When Client sends BUY BTC-USD Get Exchange Rate request and specifies amount Y and currency BTC that means that he wants to buy Y BTC for USD. In this case ask side of the order book will be used to perform the measurement.
When Client sends SELL BTC-USD Get Exchange Rate request and specifies amount X and currency USD that means that he wants to sell BTC to X USD. In this case bid side of the order book will be used to perform the measurement.
When Client sends SELL BTC-USD Get Exchange Rate request and specifies amount Y and currency BTC that means that he wants to sell Y BTC to USD. In this case bid side of the order book will be used to perform the measurement.
HTTP REQUEST
POST /get_exchange_rate
API Key Permission
This method requires “Read” permission set for API Key.
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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Get Current Rates Request for all configured pairs
Request (Client queries current rates for all configured pairs)
{}
Response (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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 no market data is available in Bid part of the order book. |
bestAsk | No | String | Best ask price for specific pair. It could be "null" in case no market data is available in Ask part of the 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 his financial transactions (deposits, withdrawals, internal transfers, commissions or trades).
HTTP REQUEST
POST /get_my_transaction_history
API Key Permission
This method requires “Read” permission set for API Key.
Get My Transaction History Request
Get My Transaction History - For Main Account with specified period
Request (Client sends request to find all transactions for the main account with specified period)
{
"accountId": "",
"type": "",
"dateTo": 1614336230587,
"dateFrom": 1613101662720,
"sortOrder": "ASC"
}
Response
{
"ok": "ok",
"data": [
{
"transactionId": "7831622",
"timestamp": "2021-02-12T09:44:35.078Z",
"accountId": "",
"type": "trade",
"amount": "0.00200000",
"details": "Finalization Trade orderId='335805' for DEMO_USER",
"currency": "BTC"
},
{
"transactionId": "7831619",
"timestamp": "2021-02-12T09:44:35.078Z",
"accountId": "",
"type": "trade",
"amount": "-33.40944038",
"details": "Finalization Trade orderId='335805' for DEMO_USER",
"currency": "USD"
},
{
"transactionId": "7831618",
"timestamp": "2021-02-12T09:44:35.090Z",
"accountId": "",
"type": "commission",
"amount": "-0.16704721",
"details": "Commission for orderId='335805' for DEMO_USER",
"currency": "USD"
}
]
}
Get My Transaction History - For Main Account with Paging
Request (Client sends request to find transactions for the main account and wants to see second page expecting the result set is chunked to pages size 3 (not more than 3 transactions per page))
{
"accountId": "",
"type": "",
"pageSize": 3,
"pageNumber": 2,
"sortOrder": "DESC"
}
Response
{
"ok": "ok",
"data": [
{
"transactionId": "7831618",
"timestamp": "2021-02-24T16:36:23.271Z",
"accountId": "",
"type": "commission",
"amount": "-1242.90844594",
"details": "Commission for orderId='338348' for DEMO_USER",
"currency": "USD"
},
{
"transactionId": "7831613",
"timestamp": "2021-02-24T16:36:23.259Z",
"accountId": "",
"type": "trade",
"amount": "-1.56398259",
"details": "Finalization Trade orderId='338348' for DEMO_USER",
"currency": "BTC"
},
{
"transactionId": "7831609",
"timestamp": "2021-02-24T16:36:23.259Z",
"accountId": "",
"type": "trade",
"amount": "77753.71512521",
"details": "Finalization Trade orderId='338348' for DEMO_USER",
"currency": "USD"
}
]
}
Get My Transaction History - Deposit Transactions for Main Account
Request (Client sends request to find all deposit transactions for main account)
{
"accountId": "",
"type": "deposit",
"sortOrder": "DESC"
}
Response
{
"ok": "ok",
"data": [
{
"transactionId": "7834322",
"timestamp": "2021-02-19T10:56:16.255Z",
"accountId": "",
"type": "deposit",
"amount": "0.05000000",
"details": "Deposit fundingId=57693 clientId=DEMO_USER walletTxId=136047928",
"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 "type" parameter
Request (Client sends request with incorrect "type" parameter)
{
"accountId": "",
"type": "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 (Client sends request with pageSize which is over max allowed limit 100)
{
"accountId": "",
"type": "",
"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 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 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. |
type | No | String | If this field is present and contains one of the allowed values, 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 or if this field is present but contains an empty string (""), 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 than or equal to (>=) dateFrom. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateFrom should be less than the value in the field dateTo. |
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 than (<) dateTo. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateTo should be greater than the value in the field dateFrom. |
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 he wants to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request and cannot be greater than 100. If this field is missing, then the default value of 100 is used. If this field contains one of the allowed values and, simultaneously, the pageNumber field is missing, then the default pageNumber value is applied. Specifying the value in the field pageSize is mandatory if the value in the field pageNumber is also sent in the Client's request. |
pageNumber | No | Number | Because the result might contain too many transactions, Client should specify, which portion of the result list he wants 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 1. If this field is missing, then the default value of 1 is used. This value cannot be lower than 1. If any valid value is specified in this field, then it is mandatory to also send the value in the field pageSize in the Client’s request. |
Get My Transaction History Response
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 | 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 field should be not Array, but Object. |
transactionId | Yes | String | Unique identifier of transaction in Prime Liquidity system. |
timestamp | Yes | Datetime | Represents server timestamp when this transaction happened. Format: YYYY-MM-DDTHH:MM:SS.sssZ . |
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. |
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 his deposit and withdrawal transactions.
HTTP REQUEST
POST /get_my_funding_history
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Get My Funding History - For Main Account and all sub-accounts
Request (Client sends request to find deposit/withdrawal transactions for the main account and all sub-accounts)
{}
Response (Prime Liquidity 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": "2021-02-19T10:56:25.272Z"
},
{
"txId": 148127,
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "withdraw",
"amount": "11.34000000",
"commissionAmount": "0.14000000",
"status": "approved",
"updatedAt": "2021-02-19T10:56:17.193Z"
},
{
"txId": 148128,
"clientId": "TestClient",
"accountId": "100108_test",
"currency": "BTC",
"direction": "deposit",
"amount": "15.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:18:48.682Z"
},
{
"txId": 148129,
"clientId": "TestClient",
"accountId": "100109_test",
"currency": "BTC",
"direction": "deposit",
"amount": "55.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:17:45.399Z"
},
{
"txId": 148130,
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "deposit",
"amount": "55.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:16:41.585Z"
}
]
}
Get My Funding History - For Main Account and all Sub-accounts with Paging
Request (Client sends request to find deposit/withdrawal transactions for the main account and all sub-accounts and wants to see the first 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), Prime Liquidity responds with the first page, which includes 2 transactions)
{
"ok": "ok",
"data": [
{
"txId": 148126,
"clientId": "TestClient",
"accountId": "100107_test",
"currency": "BTC",
"direction": "withdraw",
"amount": "81.04000000",
"commissionAmount": "1.14000000",
"status": "approved",
"updatedAt": "2021-02-19T10:56:25.272Z"
},
{
"txId": 148127,
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "withdraw",
"amount": "11.34000000",
"commissionAmount": "0.14000000",
"status": "approved",
"updatedAt": "2021-02-19T10:56:17.193Z"
}
]
}
Get My Funding History - For Specified Sub-Account
Request (Client sends request to find deposit/withdrawal transactions for specified sub-account)
{
"accountId": "123"
}
Response (Prime Liquidity responds with deposit/withdrawal transactions for specified sub-account)
{
"ok": "ok",
"data": [
{
"txId": 148129,
"clientId": "TestClient",
"accountId": "123",
"currency": "BTC",
"direction": "deposit",
"amount": "55.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:17:45.399Z"
}
]
}
Get My Funding History - Deposit Transactions for Main Account and all Sub-accounts with specified Period
Request (Client sends request to find all deposit transactions for main account and all sub-accounts, which happened within specified period)
{
"direction": "deposit",
"dateFrom": 1514337745869,
"dateTo": 1614337745869
}
Response (Prime Liquidity responds that Client has only one transaction, which satisfies requested criteria)
{
"ok": "ok",
"data": [
{
"txId": 148128,
"clientId": "TestClient",
"accountId": "100108_test",
"currency": "BTC",
"direction": "deposit",
"amount": "15.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:18:48.682Z"
}
]
}
Get My Funding History - Pending External Deposit
Request (Client requests first deposit transaction since defined time)
{
"direction": "deposit",
"dateFrom": 1676561116790,
"pageSize": 1,
"pageNumber": 1
}
Response (Prime Liquidity responds that Client has pending external deposit in status "initiated", and as for now, it has 0 confirmations in the blockchain)
{
"ok": "ok",
"data": [
{
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "deposit",
"amount": "1.00000000",
"commissionAmount": "0.00000000",
"status": "initiated",
"updatedAt": "2023-02-16T20:00:00.000Z",
"txId": 12345,
"details": {
"address": "00112233445566778899aabbccddeeffgg",
"blockchain": "bitcoin",
"confirmations": 0,
"blockchainTxId": "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"
}
}
]
}
Get My Funding History - Approved External Deposit
Request (Client requests first deposit transaction since defined time)
{
"direction": "deposit",
"dateFrom": 1676561116790,
"pageSize": 1,
"pageNumber": 1
}
Response (Prime Liquidity responds that Client has external deposit which has already been approved)
{
"ok": "ok",
"data": [
{
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "deposit",
"amount": "1.20000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2023-02-16T20:00:00.000Z",
"txId": 12345,
"details": {
"address": "00112233445566778899aabbccddeeffgg",
"blockchain": "bitcoin",
"confirmations": 2,
"blockchainTxId": "12112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"
}
}
]
}
Get My Funding History - External Withdrawal
Request (Client requests first withdrawal transaction since defined time)
{
"direction": "withdrawal",
"dateFrom": 1676561116790,
"pageSize": 1,
"pageNumber": 1
}
Response (Prime Liquidity responds that Client has external withdrawal which has already been approved and was broadcasted to the blockchain)
{
"ok": "ok",
"data": [
{
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "withdraw",
"amount": "1.60000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2023-02-16T20:00:00.000Z",
"txId": 12345,
"details": {
"address": "00112233445566778899aabbccddeeffgg",
"blockchain": "bitcoin",
"blockchainTxId": "16112233445566778899aabbccddeeff00112233445566778899aabbccddeeff",
"externalWithdrawalStatus": "approved"
}
}
]
}
Get My Funding History - Incorrect Request
Request (Client sends request to find some deposit/withdrawal transactions without valid JSON object)
{
[]
}
Response (Prime Liquidity 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 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 and contains one of the allowed values, then it means Client wants to get only transactions related to specified operation type. Allowed values are: "deposit", "withdraw". If this field is missing or if this field is present but contains an empty string (""), then it means Client wants to get all deposits and withdrawals. |
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 than or equal to (>=) dateFrom. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateFrom should be less than the value in the field dateTo. |
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 than (<) dateTo. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateTo should be greater than the value in the field dateFrom. |
pageSize | No | Number | Because the result might contain too many transactions, Client should specify, which portion of the result list he wants to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request and cannot be greater than 100. If this field is missing, then the default value of 100 is used. If this field contains one of the allowed values and, simultaneously, the pageNumber field is missing, then the default pageNumber value is applied. Specifying the value in the field pageSize is mandatory if the value in the field pageNumber is also sent in the Client's request. |
pageNumber | No | Number | Because the result might contain too many transactions, Client should specify, which portion of the result list he wants 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 1. If this field is missing, then the default value of 1 is used. This value cannot be lower than 1. If any valid value is specified in this field, then it is mandatory to also send the value in the field pageSize in the Client’s request. |
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 field 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 | Datetime | Represents server timestamp when this transaction happened. Format: YYYY-MM-DDTHH:MM:SS.sssZ . |
details | Yes | Object | This object contains details of the external transactions, which satisfies request criteria. It might be empty object ({}). If this object is empty, then no additional details are available. |
details.blockchain | No | String | Blockchain name, via which requested cryptocurrency external withdrawal or deposit was initiated. |
details.address | No | String | Crypto address that will receive the funds. Please be informed that destination and memo fields are used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
details.destination | No | String | Destination address, that will receive the funds, used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
details.memo | No | String (or Integer for XRP cryptocurrency) | A special identifier used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM) of the transaction recepient. |
details.blockchainTxId | No | String | Unique identifier of the transaction in cryptocurrency network. This is optional field if transaction was already broadcasted to the cryptocurrency network. |
details.confirmations | No | Number | This field can only be present in case of external deposit, and indicates how many blocks have already passed since a transaction was added to the specific blockchain. For deposit transactions minimal confirmation number for transaction to be credited to Client’s Prime Liquidity account can be received via get_processing_info request. |
details.externalWithdrawalStatus | No | String | Transaction status of funds withdrawal from Client’s CEX.IO account to the external crypto address. Allowed values: “rejected”, “pending”, “approved”. |
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 funds between his sub-accounts or between his main account and sub-account. Prime Liquidity does not charge Client any commission for transferring funds between his accounts. Along with a response to this request, Prime Liquidity sends Account Event messages to Client if this request is successful.
HTTP REQUEST
POST /do_my_internal_transfer
API Key Permission
This method requires “Funds Internal” permission set for API Key.
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",
"clientTxId": "12342134442"
}
Response (Prime Liquidity 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",
"clientTxId": "123"
}
Response (Prime Liquidity responds to Client that internal transfer operation was successful and shows transactionId of this transfer)
{
"ok": "ok",
"data": {
"transactionId": 777
}
}
Do My Internal Transfer - Duplicate clientTxId
Request (Client requests to transfer 4 USD from sub-account "superhat" to sub-account "hallo" with clientTxId = "123" which was already used in the previous example to transfer 2 USD)
{
"fromAccountId": "superhat",
"toAccountId": "hallo",
"amount": "4",
"currency": "USD",
"clientTxId": "123"
}
Response (Prime Liquidity detects duplicate and funds are not transferred between accounts. Prime Liquidity responds to Client with transactionId of the successful transfer (first transfer with clientTxId = "123"))
{
"ok": "ok",
"data": {
"transactionId": 777
}
}
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",
"clientTxId": "12342134442"
}
Response (Prime Liquidity responds that Client has insufficient funds on his "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",
"clientTxId": "12342134442"
}
Response (Prime Liquidity responds to Client that such request is not allowed and amount should be greater than zero)
{
"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",
"clientTxId": "12342134442"
}
Response (Prime Liquidity responds to Client that such request is not allowed and mandatory parameter is missing)
{
"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",
"clientTxId": "12342134442"
}
Response (Prime Liquidity responds to Client that such request is not allowed and fromAccountId and toAccountId should be different)
{
"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",
"clientTxId": "12342134442"
}
Response (Prime Liquidity responds to Client that such request is not allowed because currency ABC is not supported)
{
"error": "Unsupported currency ABC"
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
clientTxId | No | String | Unique identifier of transfer specified by Client. If two (or more) transfers with the same clientTxId are received by the system - only first transfer will be processed, second and subsequent transfers will return transactionId of the first completed internal transfer for clientTxId. |
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 than 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. |
Currencies Info
Currencies Info method allows Client to receive the parameters for all currencies configured in Prime Liquidity as well as the deposit and withdrawal availability between Prime Liquidity and CEX.IO Wallet.
HTTP REQUEST
POST /get_currencies_info
API Key Permission
This method requires “Read” permission set for API Key.
Currencies Info Request Parameters
Currencies Info request (No parameters indicated)
Request (Client sends the request without any parameters)
{}
Response (Prime Liquidity successfully responds to the request with information about all currencies configured in Prime Liquidity system)
{
"ok": "ok",
"data": {
{
"currency": "USDT",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 8,
"walletPrecision": 6
},
{
"currency": "BTC",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 8,
"walletPrecision": 8
},
{
"currency": "SHIB",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 0,
"walletPrecision": 0
},
{
"currency": "LUNC",
"walletDeposit": false,
"walletWithdrawal": false,
"fiat": false,
"precision": 2,
"walletPrecision": null
},
{
"currency": "USD",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": true,
"precision": 8,
"walletPrecision": 2
}
}
}
Currencies Info request (Indicated 2 specific currencies)
Request (Client sends get currencies info request for 2 currencies)
{
"data": {
"currencies": ["ETH", "USD"]
}
}
Response (Prime Liquidity responds to the request with information for indicated currencies)
{
"ok": "ok",
"data": [
{
"currency": "ETH",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 8,
"walletPrecision": 6
},
{
"currency": "USD",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": true,
"precision": 8,
"walletPrecision": 2
}
]
}
Currencies Info request (Indicated unsupproted currency)
Request (Client sends get currencies info request with indicated unsupported currency)
{
"data": {
"currencies": ["CCC"]
}
}
Response (Prime Liquidity responds to the request with empty array as requested currency is not supported)
{
"ok": "ok",
"data": []
}
Currencies Info request (No currencies indicated)
Request (Client sends get currencies info request with indicated currencies parameter but without any specific currencies)
{
"data": {
"currencies": []
}
}
Response (Prime Liquidity responds to the request with error message)
{
"ok": "ok",
"data": {
"error": "Parameter currencies should be Array of Strings"
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
currencies | No | Array of Strings | List of currencies for which Client wants to receive configuration parameters. Currencies should be indicated in upper case and of string type. The list should contain only valid currency symbols. If this field is present in the request, then at least 1 currency should be indicated in an array. If this field is absent, then it means Client requests configuration parameters for all currencies. |
Currencies Info Response Parameters
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 response details. |
X | No | Object | Represents an object which describes specific currency configuration parameters in Prime Liquidity system. If there are no objects in returned array, then it means there are no currencies, which satisfy Client’s request criteria. |
X.currency | Yes | String | Currency name. |
X.walletDeposit | Yes | Boolean | Describes current availability to deposit currency X to Prime Liquidity from CEX.IO Wallet. Only true or false values are allowed herein. |
X.walletWithdrawal | Yes | Boolean | Describes current availability to withdraw currency X from Prime Liquidity to CEX.IO Wallet. Only true or false values are allowed herein. |
X.fiat | Yes | Boolean | Indicates if the currency is a fiat currency or cryptocurrency. If the value is true, then indicated currency is fiat. If the value is false, then indicated currency is cryptocurrency. |
X.precision | Yes | Number | Number of decimal places in amounts of specific currency used inside Prime Liquidity system (e.g. for internal transfers, executed amounts in orders etc.). |
X.walletPrecision | Yes | Number or null | If the value of this parameter is a number, then it describes the number of decimal places in amounts of specific currency used for transfers to or out of Prime Liquidity system (e.g. for deposits\withdrawals from\to CEX.IO Wallet or external addresses). If the value is null, then deposits and withdrawals of specific currency from\to CEX.IO Wallet are not available. |
error | No | Object | If this field is present, then request is not successful. Represents human readable error reason of why request is not successful. |
Get Processing Info
This request allows Client to receive detailed information about available options to make deposits from external wallets and withdrawals to external wallets as to each supported cryptocurrency, including cryptocurrency name and available blockchains for deposit\withdrawals. Also, as to each supported blockchain there are indicated type of cryptocurrency on indicated blockchain, current deposit\withdrawal availability, minimum amounts for deposits\withdrawals, external withdrawal fees.
Processing Information makes Client more flexible in choosing desired blockchain for receiving Deposit address and initiating external withdrawals via certain blockchain, so that Client uses more convenient way of transferring his crypto assets to or from CEX.IO Ecosystem.
HTTP REQUEST
POST /get_processing_info
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Get Processing Info Request for one specific cryptocurrency
Request (Client queries processing info for "BTC")
{
"currencies": ["BTC"]
}
Response (Prime Liquidity responds that only 'bitcoin' blockchain is supported for deposits\withdrawals of "BTC")
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005",
"depositConfirmations": 2
}
}
}
}
}
Get Processing Info Request for several cryptocurrencies
Request (Client queries processing info for "BTC" and "USDC")
{
"currencies": ["BTC","USDC"]
}
Response (Prime Liquidity responds that for deposits\withdrawals 'bitcoin' blockchain is supported for "BTC" and "ethereum", "stellar" and "tron" blockchains are supported for "USDC")
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005",
"depositConfirmations": 2
}
}
},
"USDC": {
"name": "USD Coin",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "40",
"depositConfirmations": 25
},
"stellar": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1",
"depositConfirmations": 1
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1",
"depositConfirmations": 21
}
}
}
}
}
Get Processing Info Request for specific cryptocurrencies
Request (Client queries processing info for "BTC" and "USDT")
{
"currencies": ["BTC","USDT"]
}
Response (Prime Liquidity responds that for deposits\withdrawals 'bitcoin' blockchain is supported for "BTC", while "ethereum", "tron", "solana" and "binancesmartchain" blockchains are supported for "USDT")
Note that details of the response indicate that "solana" blockchain is supported for "USDT" but deposits and withdrawals via this blockchain are disabled at the moment
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005",
"depositConfirmations": 2
}
}
},
"USDT": {
"name": "Tether",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "1",
"withdrawal": "enabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 25
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "1",
"withdrawal": "enabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 21
},
"solana": {
"type": "SPL",
"deposit": "disabled",
"minDeposit": "1",
"withdrawal": "disabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 1
},
"binancesmartchain": {
"type": "BEP20",
"deposit": "enabled",
"minDeposit": "1",
"withdrawal": "enabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 25
}
}
}
}
}
Get Processing Info - No available blockchains
Request (Client queries processing info for supported cryptocurrency "ZEC")
{
"currencies": ["ZEC"]
}
Response (Prime Liquidity responds that request was processed successfully but no blockchains are supported for "ZEC")
{
"ok": "ok",
"data": {}
}
Get Processing Info - Invalid and fiat cryptocurrency
Request (Client queries processing info for "BTC", "ETH", "XXX" and "USD")
{
"currencies": ["BTC", "ETH", "XXX", "USD"]
}
Response (Prime Liquidity responds that error occurred because unsupported currencies "XXX" and "USD" are indicated in the request)
{
"error": "Request contains unsupported currencies: XXX, USD.",
"statusCode": 422
}
Get Processing Info - Invalid value type in "currencies" array
Request (Client queries processing info with invalid values type in "currencies" field)
{
"currencies": [1,2,3]
}
Response (Prime Liquidity responds that error occurred because wrong type of value was indicated in "currencies" array and only string values are allowed)
{
"error": "Currencies array should consist of string type values.",
"statusCode": 422
}
Get Processing Info - Not an array indicated in "currencies" field
Request (Client queries processing info with indicating empty object ({}) in "currencies" field)
{
"currencies": {}
}
Response (Prime Liquidity responds that error occurred because only array is allowed in "currencies" field)
{
"error": "Currencies should be array.",
"statusCode": 422
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
currencies | No | Array | List of cryptocurrencies for which Client wants to get information about supported blockchains for deposit\withdraw, limits and commissions. Cryptocurrencies should be in upper case and of string type. The list should contain only valid cryptocurrency symbols. If this field is missing or contains an empty array ([]), then it means Client wants to get processing info for all available cryptocurrencies. |
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 response details with list of cryptocurrencies, available blockchains, blockchain limitations and external withdrawal fees. It can contain empty object ({}) if there are no available blockchains for cryptocurrencies requested by Client. |
data.YYY | Yes | String | Cryptocurrency symbol specified in Client's request. |
data.YYY.name | Yes | String | Cryptocurrency name. |
data.YYY.blockchains | Yes | Object | This object contains info about all supported blockchains to deposit\withdraw cryptocurrency YYY. |
data.YYY.blockchains.X | Yes | Object | This object contains details and limitations for deposit\withdrawal of cryptocurrency YYY via blockchain X, including data about blockchain type, current availability to deposit\withdraw, minimum deposit\withdrawal limit and external withdrawal fees. |
data.YYY.blockchains.X. type | Yes | String | Type of cryptocurrency YYY on blockchain X. |
data.YYY.blockchains.X. deposit | Yes | String | Describes current availability to deposit cryptocurrency YYY via blockchain X. Only "enabled" or "disabled" values are allowed herein. |
data.YYY.blockchains.X. minDeposit | Yes | String (which can be parsed as Float) | Minimum amount of cryptocurrency YYY which can be deposited from external wallet via blockchain X. |
data.YYY.blockchains.X. withdrawal | Yes | String | Describes current availability to withdraw cryptocurrency YYY via blockchain X. Only "enabled" or "disabled" values are allowed herein. |
data.YYY.blockchains.X. minWithdrawal | Yes | String (which can be parsed as Float) | Minimum amount of cryptocurrency YYY which can be withdrawn to external wallet via blockchain X by using do_withdrawal_funds request. |
data.YYY.blockchains.X. withdrawalFee | Yes | String (which can be parsed as Float) | Amount of withdrawal fee in cryptocurrency YYY, which which would be charged and subtracted from withdrawal amount if blockchain X is used for withdrawal. |
data.YYY.blockchains.X. depositConfirmations | Yes | Number | minimal confirmation number for transaction in the blockchain to be deposited to Client’s Prime Liquidity account. |
error | No | String | If this field is present, then request is not successful. Represents human readable error reason of why request is not successful. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Get Deposit Address
This method can be used by Client for receiving a crypto address to deposit cryptocurrency. Deposit address can be generated for main and sub-accounts.
HTTP REQUEST
POST /get_deposit_address
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Get Deposit Address Request for main account to deposit "BTC" cryptocurrency via 1 available blockchain
Client sends get_processing_info request for receiving of all available blockchains to deposit BTC
{
"currencies": ["BTC"]
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries deposit address for BTC cryptocurrency on "bitcoin" blockchain)
{
"accountId": "", // main account
"currency": "BTC", // currency "BTC"
"blockchain": "bitcoin" // required blockchain
}
Response (Prime Liquidity responds with information about crypto address to deposit BTC via "bitcoin" blockchain)
{
"ok": "ok",
"data": {
"accountId": "",
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
"currency": "BTC",
"blockchain": "bitcoin"
}
}
Get Deposit Address Request for main account to deposit "USDC" cryptocurrency via specific blockchain
Client sends get_processing_info request for receiving of all available blockchains to deposit USDC
{
"currencies": ["USDC"]
}
Prime Liquidity responds that there are 3 available blockchains to deposit USDC, namely "ethereum", "stellar" and "tron"
{
"ok": "ok",
"data": {
"USDC": {
"name": "USD Coin",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "40"
},
"stellar": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "20"
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1"
}
}
}
}
}
Request (Client queries deposit address for sub-account "superhat" for USDC cryptocurrency to further deposit it via "tron" blockchain as most profitable for Client)
{
"accountId": "superhat",
"currency": "USDC",
"blockchain": "tron"
}
Response (Prime Liquidity responds with information about crypto address to deposit USDC via "tron" blockchain on "superhat" account)
{
"ok": "ok",
"data": {
"accountId": "superhat",
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
"currency": "USDC",
"blockchain": "tron"
}
}
Get Deposit Address Request for main account to deposit "XRP" cryptocurrency
Client sends get_processing_info request for receiving of all available blockchains to deposit XRP
{
"currencies": ["XRP"]
}
Prime Liquidity responds that there is only 1 available blockchain to deposit XRP, namely "ripple"
{
"ok": "ok",
"data": {
"XRP": {
"name": "Ripple",
"blockchains": {
"ripple": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0",
"withdrawal": "enabled",
"minWithdrawal": "0.3",
"withdrawalFee": "0.25"
}
}
}
}
}
Request (Client queries deposit address for sub-account "superhat" for XRP cryptocurrency to further deposit it via "ripple" blockchain)
{
"accountId": "superhat",
"currency": "XRP",
"blockchain": "ripple"
}
Response (Prime Liquidity responds with destination and memo to deposit XRP via "ripple" blockchain)
{
"ok": "ok",
"data": {
"accountId": "superhat",
"destination": "rE1sdh25BJQ3qFwngiTBwaq3zPGGYcrjp1",
"memo": "65629",
"currency": "XRP",
"blockchain": "ripple"
}
}
Get Deposit Address - Unsupported currency
Request (Client queries deposit address)
{
"accountId": "",
"currency": "XXX",
"blockchain": "ethereum"
}
Response (Prime Liquidity responds that error occurred because unsupported currency is specified in the request)
{
"error": "Unsupported currency XXX",
"statusCode": 422
}
Get Deposit Address - Unsupported blockchain
Request (Client queries deposit address)
{
"accountId": "",
"currency": "ETC",
"blockchain": "tezos"
}
Response (Prime Liquidity responds that error occurred because unsupported currency is specified in the request)
{
"error": "Blockchain is not supported.",
"statusCode": 500
}
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, for which Client wants to get a deposit address. |
blockchain | Yes | String | Blockchain name, via which Client wants to make a deposit of requested currency. Available blockchains can be received via get_processing_info request. |
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 (e.g. XRP, XLM, ATOM). |
destination | No | String | Destination address for deposit used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
memo | No | String | A special identifier used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
currency | Yes | String | Cryptocurrency name, for which deposit address is generated. |
blockchain | Yes | String | Blockchain name, via which requested cryptocurrency can be deposited via generated address. |
error | No | String | If this field is present, then request is not successful. Represents human readable error reason of why request is not successful. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Funds Deposit from Wallet
Client can deposit funds from CEX.IO account to Prime Liquidity account.
The system avoids processing of multiple deposit requests with the same clientTxId. If multiple deposit requests with identical clientTxId are received - the system processes only the first deposit request and rejects the second and subsequent deposit requests with the same clientTxId.
HTTP REQUEST
POST /do_deposit_funds_from_wallet
API Key Permission
This method requires “Funds Wallet” permission set for API Key.
Request Parameters
Funds Deposit Request from CEX.IO account to Prime Liquidity main account
Request (Client queries deposit of BTC to main account)
{
"accountId": "",
"clientTxId": "tx-depositFromWallet-test-1631100952225",
"currency": "BTC",
"amount": "0.1"
}
Response (Prime Liquidity responds with information that transaction was approved)
{
"ok": "ok",
"data": {
"accountId": "",
"currency": "BTC",
"status": "approved"
}
}
Funds Deposit Request from CEX.IO account to Prime Liquidity sub-account
Request (Client queries deposit of XRP to sub-account)
{
"accountId": "superhat",
"clientTxId": "tx-depositFromWallet-test-1631101631321",
"currency": "XRP",
"amount": "500"
}
Response (Prime Liquidity responds with information that transaction is pending)
{
"ok": "ok",
"data": {
"accountId": "superhat",
"currency": "XRP",
"status": "pending"
}
}
Invalid Deposit Request (too low amount)
Request (Client queries deposit of invalid amount)
{
"accountId": "",
"clientTxId": "tx-depositFromWallet-test-1631101114709",
"currency": "BTC",
"amount": "0.00000002"
}
Response (Prime Liquidity responds that deposit was rejected due to low amount)
{
"error": "Too low amount to deposit 0.00000002 BTC. Minimum amount 0.00100000 BTC",
"statusCode": 500
}
Invalid Deposit Request (unsupported currency)
Request (Client queries deposit of unsupported currency)
{
"accountId": "",
"clientTxId": "tx-depositFromWallet-test-1631103998454",
"currency": "XXX",
"amount": "25"
}
Response (Prime Liquidity responds that deposit was rejected because currency is not supported)
{
"error": "Unsupported currency XXX",
"statusCode": 422
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
clientTxId | Yes | String | Transaction identifier assigned by Client. |
accountId | No | String | Account identifier, to which Client wants to deposit 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 deposit funds to the main account. |
currency | Yes | String | Cryptocurrency name. |
amount | Yes | Float (or String which can be parsed as Float) | Amount of the transaction. |
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 initiated deposit funds. Empty string ("") value in this field represents Client’s main account. |
currency | Yes | String | Cryptocurrency name. |
status | Yes | String | Deposit transaction status. Allowed values - "rejected", "pending", "approved". |
error | No | String | If this field is present, then request is not successful. Represents human readable error reason of why request is not successful. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Funds Withdrawal to Wallet
Client can withdraw funds from Prime Liquidity account to CEX.IO account.
The system avoids multiple withdrawal requests with the same clientTxId. If multiple withdrawal requests with identical clientTxId are received - the system processes only the first withdrawal request and rejects the second and subsequent withdrawal requests with the same clientTxId.
HTTP REQUEST
POST /do_withdrawal_funds_to_wallet
API Key Permission
This method requires “Funds Wallet” permission set for API Key.
Request Parameters
Funds Withdrawal Request from Prime Liquidity main account to CEX.IO account
Request (Client queries withdrawal of BTC from main account)
{
"accountId": "",
"clientTxId": "tx-withdrawToWallet-test-1630598254954",
"currency": "BTC",
"amount": "0.1"
}
Response (Prime Liquidity responds with information that transaction was approved)
{
"ok": "ok",
"data": {
"clientTxId": "tx-withdrawToWallet-test-1630598254954",
"currency": "BTC",
"status": "approved"
}
}
Funds Withdrawal Request from Prime Liquidity sub-account to CEX.IO account
Request (Client queries withdrawal of XRP from sub-account)
{
"accountId": "superhat",
"clientTxId": "tx-withdrawToWallet-test-1630598290977",
"currency": "XRP",
"amount": "200"
}
Response (Prime Liquidity responds with information that transaction is pending)
{
"ok": "ok",
"data": {
"clientTxId": "tx-withdrawToWallet-test-1630598290977",
"currency": "XRP",
"status": "pending"
}
}
Invalid Withdrawal Request (too low amount)
Request (Client queries withdrawal of invalid amount)
{
"accountId": "",
"clientTxId": "tx-withdrawToWallet-test-1630598297863",
"currency": "BTC",
"amount": "0.00000002"
}
Response (Prime Liquidity responds that withdrawal was rejected due to low amount)
{
"error": "Too low amount to withdraw 0.00000002 BTC. Minimum amount 0.00100000 BTC",
"statusCode": 500
}
Invalid Withdrawal Request (unsupported currency)
Request (Client queries withdrawal of unsupported currency)
{
"accountId": "",
"clientTxId": "tx-withdrawToWallet-test-1630598290954",
"currency": "XXX",
"amount": "10"
}
Response (Prime Liquidity responds that withdrawal was rejected because currency is not supported)
{
"error": "Unsupported currency XXX",
"statusCode": 422
}
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. |
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. Allowed values - "rejected", "pending", "approved". Please check transaction status via get_withdrawal_status method in case status "pending" is received in the response. |
error | No | String | If this field is present, then request is not successful. Represents human readable error reason of why request is not successful. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Funds Withdrawal
Client can withdraw funds from Prime Liquidity account to external crypto address.
Here is the list of errors, which indicate that the withdrawal request was rejected.
Status code | Error description |
---|---|
500 | Withdrawal is temporary unavailable |
500 | Withdrawal destination is not whitelisted |
500 | Invalid address |
500 | Mandatory parameter X is missing |
500 | Memo parameter must be numeric for ATOM |
500 | Insufficient funds on Client Main_ USDT account. |
500 | Requested amount: 0.00000001 is less than allowed. Minimum: 0.01 |
- | ExternalTransfer fundingId=12245 clientFundingId=1223372036854775807 already exists but has different parameters |
422 | Amount precision should not be greater than 6 |
422 | Blockchain is not supported |
HTTP REQUEST
POST /do_withdrawal_funds
API Key Permission
This method requires “Funds External” permission set for API Key.
Request Parameters
Funds Withdrawal Request from main account (BTC)
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
{
"currencies": ["BTC"]
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries BTC withdrawal to the crypto address via "bitcoin" blockchain)
{
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "29.87",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "BTC",
"status": "pending",
"instrument": "crypto",
"blockchain": "bitcoin"
}
}
Funds Withdrawal Request from main account (USDC)
Client sends get_processing_info request for receiving of all available blockchains to withdraw USDC
{
"currencies": ["USDC"]
}
Prime Liquidity responds with processing info with 3 available blockchains for USDC withdrawals, namely "ethereum", "stellar" and "tron"
{
"ok": "ok",
"data": {
"USDC": {
"name": "USD Coin",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "40"
},
"stellar": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "20"
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1"
}
}
}
}
}
Request (Client queries USDC withdrawal to the crypto address via "tron" blockchain)
{
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "USDC",
"amount": "200.87",
"instrument": "crypto",
"blockchain": "tron",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "USDC",
"status": "pending",
"instrument": "crypto",
"blockchain": "tron"
}
}
Funds Withdrawal Request from Client’s sub-account (XRP)
Client sends get_processing_info request for receiving of all available blockchains to withdraw XRP
{
"currencies": ["XRP"]
}
Prime Liquidity responds with processing info and only 1 available blockchain "ripple" for XRP withdrawals
{
"ok": "ok",
"data": {
"XRP": {
"name": "Ripple",
"blockchains": {
"ripple": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0",
"withdrawal": "enabled",
"minWithdrawal": "0.3",
"withdrawalFee": "0.25"
}
}
}
}
}
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",
"blockchain": "ripple",
"parameters": {
"destination": "rLHzPsX6oXkzU2qL12kHCH8G8cnZv1rBJh",
"memo": 1318266718
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "XRP",
"status": "pending",
"instrument": "crypto",
"blockchain": "ripple"
}
}
Funds Withdrawal Request - Too low amount
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
{
"currencies": ["BTC"]
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals and 0.002 BTC as minWithdrawal amount
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries withdrawal of 0.0005 BTC to the crypto address via blockchain "bitcoin")
{
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "0.0005",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because Client indicated withdrawal amount which is less than minWithdrawal amount)
{
"error": "Requested amount: 0.00050000 is less than allowed. Minimum: 0.00200000",
"statusCode": 500
}
Funds Withdrawal Request - Invalid address
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
{
"currencies": ["BTC"]
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries withdrawal of BTC to invalid crypto address)
{
"accountId": "",
"clientTxId": "1223372036854711807",
"currency": "BTC",
"amount": "0.1",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "SomeInvalidAddress"
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because Client indicated invalid address)
{
"error": "Invalid address",
"statusCode": 500
}
Funds Withdrawal Request - Unsupported blockchain
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
{
"currencies": ["BTC"]
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals
{
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries withdrawal of BTC via invalid blockchain)
{
"accountId": "",
"clientTxId": "1223372036854711807",
"currency": "BTC",
"amount": "0.1",
"instrument": "crypto",
"blockchain": "ethereum",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because Client indicated unsupported blockchain)
{
"error": "Blockchain is not supported.",
"statusCode": 500
}
Funds Withdrawal Request - Duplicated clientTxId transaction with different parameters
Request (Client queries withdrawal to the crypto address via blockchain "bitcoin")
{
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "1.87",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "BTC",
"status": "pending",
"instrument": "crypto",
"blockchain": "bitcoin"
}
}
Request (Client queries withdrawal transaction with the same clientTxId but with other amount)
{
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "0.993",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
Response (Prime Liquidity responds that transaction with the same clientTxId has been already processed and had other parameters)
{
"error": "ExternalTransfer fundingId=12245 clientFundingId=1223372036854775807 already exists but has different parameters"
}
Funds Withdrawal Request - Insufficient funds
Request (Client queries withdrawal to the crypto address via blockchain "bitcoin")
{
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "30.12",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because of insufficient funds)
{
"error": "Insufficient funds",
"statusCode": 500
}
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. |
blockchain | Yes | String | Blockchain name, via which Client wants to make an external withdrawal of requested currency. Available blockchains can be received via get_processing_info request. |
parameters. address | No | String | Crypto address for withdrawal. Please be informed that destination and memo fields are used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
parameters. destination | No | String | Destination address for withdrawal used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
parameters. memo | No | String (or Integer for XRP cryptocurrency) | A special identifier for withdrawal used for ledger cryptocurrencies (e.g. 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". |
blockchain | Yes | String | Blockchain name, via which requested cryptocurrency external withdrawal was initiated. |
error | No | String | If this field is present, then request is not successful. Represents human readable error reason of why request is not successful. |
statusCode | No | Number | If this field is present, then request is not successful. Represents numeric code of occurred error. |
Withdrawal Status
This request allows Client to find out information about cryptocurrency withdrawal.
HTTP REQUEST
POST /get_withdrawal_status
API Key Permission
This method requires “Read” permission set for API Key.
Request Parameters
Withdrawal Status Request - Pending Withdrawal Transaction
Request (Client queries status of the withdrawal transaction)
{
"clientTxId": "1476272036854775807",
"instrument": "crypto",
"blockchain": "ripple",
"currency": "XRP"
}
Response (Prime Liquidity 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",
"blockchain": "bitcoin",
"currency": "BTC"
}
Response (Prime Liquidity 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",
"blockchain": "ripple",
"currency": "XRP"
}
Response (Prime Liquidity 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 - Withdrawal Transaction that is sent to CEX.IO account (BTC)
Request (Client queries status of the withdrawal transaction)
{
"clientTxId": "tx-withdrawToWallet-test-1631203639778",
"instrument": "cexWallet",
"currency": "BTC"
}
Response (Prime Liquidity responds with status of the withdrawal transaction. Overall transaction status is "approved". The withdrawn amount should already be available on CEX.IO account)
{
"ok": "ok",
"data": {
"currency": "BTC",
"instrument": "cexWallet",
"clientTxId": "tx-withdrawToWallet-test-1631203639778",
"requestedAmount": "0.00100000",
"commissionAmount": "0.00000000",
"status": "approved",
"cexWalletTx": {
"status": "approved",
"amount": "0.00100000",
"commissionAmount": "0.00000000"
}
}
}
Withdrawal Status Request - Incorrect ClientTxId
Request (Client queries status of the withdrawal transaction)
{
"clientTxId": "1476272036854775800",
"instrument": "crypto",
"blockchain": "cosmos",
"currency": "ATOM"
}
Response (Prime Liquidity responds that withdrawal transaction with such clientTxId has not been found)
{
"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. Instrument "cexWallet" means that withdrawal should be done to CEX.IO account. Allowed values - "crypto", "cexWallet". |
currency | Yes | String | Cryptocurrency name. |
blockchain | No | String | Blockchain name, via which Client initiated withdrawal transaction of currency. This parameter is mandatory if instrument "crypto" is specified in the request. |
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. Instrument "cexWallet" means that withdrawal should be done to CEX.IO account. Allowed values - "crypto", "cexWallet". |
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 Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity to Client’s CEX.IO account. |
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 (e.g. XRP, XLM, ATOM). |
externalTx. destination | No | String | Destination address, that will receive the funds, used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
externalTx.memo | No | String | A special identifier used for ledger cryptocurrencies (e.g. 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 Prime Liquidity 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. Prime Liquidity 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 Prime Liquidity.
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 Prime Liquidity's responses, so it is possible for Client to link each response with his 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
Connection should be established using SSL.
WebSocket API Endpoint URL
https://liquidity.prime.cex.io/api/ws
Either Client or Prime Liquidity can terminate WebSocket connection at any time.
Once connected, Prime Liquidity sends “connected” message to Client.
Query Parameters
From | To | Message | Description |
---|---|---|---|
Prime Liquidity | Client | {"e":"connected"} |
By successful connection, Prime Liquidity notifies Client about it by sending him a message. |
Keep Connection Alive
To keep connection alive, Client should periodically send any valid message to Prime Liquidity. Maximum allowed period between two closest Client’s messages is 10 seconds (however, this parameter might be changed by Prime Liquidity in future). If Client exceeds this limit (meaning, Client sends less than 1 message per 10 seconds), then Prime Liquidity 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, Prime Liquidity responds with a “pong” message.
Keeping Connection Alive Example
Sequence id | From | To | Message | Description |
---|---|---|---|---|
1 | Client | Prime Liquidity | {"e":"ping"} |
Client sends “ping”. |
2 | Prime Liquidity | Client | {"e":"pong"} |
Almost immediately, Prime Liquidity responds with “pong”. |
3 | Client | Prime Liquidity | {"e":"ping"} |
Client sends next “ping” in 5 seconds. |
4 | Prime Liquidity | Client | {"e":"pong"} |
Almost immediately, Prime Liquidity responds with “pong”. |
5 | Client | Prime Liquidity | {"e":"ping"} |
Client sends next “ping” in 8 seconds. |
6 | Prime Liquidity | Client | {"e":"pong"} |
Almost immediately, Prime Liquidity responds with “pong”. |
7 | Prime Liquidity 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 | Prime Liquidity | {"e":"ping"} |
Client sends “ping”. |
2 | Prime Liquidity | Client | {"e":"pong"} |
Almost immediately, Prime Liquidity responds with “pong”. |
3 | Client | Prime Liquidity | {"e":"ping"} |
Client sends next “ping” in 5 seconds. |
4 | Prime Liquidity | Client | {"e":"pong"} |
Almost immediately, Prime Liquidity responds with “pong”. |
5 | Client does not send any messages for more than 10 seconds. | |||
6 | Prime Liquidity | Client | {"e":"disconnected"} |
Prime Liquidity notifies Client that he is about to Close the connection in a moment because the Client is idle. This message, however, is optional. |
7 | Prime Liquidity terminates the connection. |
Authentication
Once connected, Client should send authentication message to Prime Liquidity using apiKey and apiSecret provided by Prime Liquidity earlier.
Prime Liquidity will respond to Client with either ok
or error
result.
Successful Authentication Example
Response (by successful connection, Prime Liquidity notifies Client about it by sending him 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 Prime Liquidity’s current time. | Number of seconds that have elapsed since 00:00:00 UTC |
key | Yes | String | Client’s apiKey which was provided by Prime Liquidity 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 Prime Liquidity 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 is incorrect |
API key is not activated | inactivated API key |
API Key Permissions
To restrict access to certain functionality while using of API Keys there should be defined specific set of permissions for each API Key. The defined set of permissions can be edited further if necessary.
The following permission levels are available for API Keys:
Read – permission level for viewing of account related data, receiving reports, subscribing to market data etc.
Trade – permission level, which allows placing and cancelling orders on behalf of account.
Funds Internal – permission level, which allows transferring funds between accounts (between sub-accounts or main account and sub-accounts) of CEX.IO Prime Liquidity Portfolio.
Funds Wallet - permission level, which allows transferring funds from CEX.IO Prime Liquidity Portfolio accounts (main account and sub-accounts) to CEX.IO account and vice versa.
Funds External – permission level, which allows transferring funds from CEX.IO Prime Liquidity Portfolio accounts (main account and sub-accounts) to external addresses.
Required permissions as to each API method are listed in the documentation below.
Unsupported method call
Unsupported method call example
Response (by successful connection, Prime Liquidity notifies Client about it by sending him a message)
{
"e": "connected"
}
Request (Client sends a valid authentication request)
{
"e": "auth",
"auth": {
"key": "djnvod237HF934jcvxj3723",
"signature": "9732fdd0db3bbbf09941365436840f36e3a2a5d076576f87d154a69c8eab194f",
"timestamp": 1465229405
}
}
Response (Prime Liquidity 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 (Prime Liquidity responds with error)
{
"e": "some_unsupported_method",
"oid": "1523439125503_1_some_unsupported_method",
"data": {
"error": "Unsupported message type some_unsupported_method"
}
}
Response (Prime Liquidity sends
disconnected
event and closes WebSocket connection afterwards)
{
"e": "disconnected"
}
Client sends JSON messages to Prime Liquidity using WebSocket. Each message should contain e
field, which defines the message type. Client should use message types which are described in documentation. Once Client sends message type which is not described in documentation, then Prime Liquidity 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 Prime Liquidity. The number of messages that Prime Liquidity sends to Client per minute is not limited.
If request rate limit is reached then Prime Liquidity replies with error, sends disconnected
event to Client and closes WS connection afterwards. Prime Liquidity 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"} | Prime Liquidity 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"} | Prime Liquidity 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"} | Prime Liquidity 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"}} | Prime Liquidity responds with error: API rate limit reached. |
302.1 | 11:01:20.403 | Response | {"e”:”disconnected”} | Prime Liquidity 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 his main account and sub-accounts. Once any event affecting Client’s account balances happens (order placing, order execution, order cancellation, deposit, withdrawal, etc.), then Prime Liquidity 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 available balance (funds which Client can use for order placing, for withdrawal, etc.) and on hold balance (funds reserved for active orders, withdrawals in progress, etc.) 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. If Client needs to know up to date account balances he can additionally use Account Status V3 request to find it out.
Client can ignore such event if he doesn't need it, or can additionally use Account Status V3 request to find out his actual account balances.
Account Event Notification
Account Event Notifications Examples
Prime Liquidity notifies Client that withdrawal operation was requested from main account and Prime Liquidity started to process it. New available 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 as only total onHoldBalance is indicated herein.
{
"e": "account_update",
"ok": "ok",
"data":{
"clientId": "BitFok",
"accountId": "",
"currency": "USD",
"balance": "0.68000000",
"onHoldBalance": "1000.00000000",
"timestamp":1465299989915,
"action": "withdraw",
"id": "16552948"
}
}
Prime Liquidity 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",
"onHoldBalance": "850.00000000",
"timestamp": 1465300456900,
"action": "order",
"id": "2639"
}
}
Prime Liquidity notifies Client that deposit operation was requested to main account and Prime Liquidity 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",
"onHoldBalance": "0.00000000",
"timestamp": 1465235652000,
"action": "deposit",
"id": "12sQff9U13"
}
}
Prime Liquidity 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",
"onHoldBalance": "52.73000000",
"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 Client’s main 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 Prime Liquidity, not Client) that triggered account balance change. |
data.balance | Yes | String (which can be parsed as Float) | Represents a snapshot of the account available balance after the action. Note that this snapshot might be inaccurate (means that it can represent available balance 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 account available balance, Client can additionally make Account Status V3 request. |
data.onHoldBalance | Yes | String (which can be parsed as Float) | Represents a snapshot of the account on hold balance (locked in orders, locked for withdrawals etc.). Note that this snapshot might be inaccurate (means that it can represent on hold balance 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 account on hold balance, Client can additionally make Account Status V3 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.
REQUEST
get_my_trading_conditions
API Key Permission
This method requires “Read” permission set for API Key.
Get My Trading Conditions Request
Successful Get My Trading Conditions Request
Request (Client sends a request to find out his trading settings for pair “BTC-USD”)
{
"e": "get_my_trading_conditions",
"oid": "1465241265586_1_get_my_trading_conditions",
"data":{
"pairs": ["BTC-USD"]
}
}
Response (Prime Liquidity 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 is 100 BTC
"pendingPayout": "10.00000000" // Max Order Amount in currency1 for Market orders is 10 BTC
},
"maxOrderAmountCcy2": {
"default": "50000.00000000", // Max Order Amount in currency2 for orders other than Market is 50000 USD
"pendingPayout": "5000.00000000" // Max Order Amount in currency2 for Market 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 (Prime Liquidity 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 his trading settings, however the mandatory field “pairs” is missing)
{
"e": "get_my_trading_conditions",
"oid": "1465241265586_1_get_my_trading_conditions",
"data": {}
}
Response (Prime Liquidity 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 his 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 shows Client’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. |
maxOrderAmountCcy1. pendingPayout | Yes | Float | Maximum Order Amount in currency1. pendingPayout option apply to Market orders. |
maxOrderAmountCcy2. default | Yes | Float | Maximum Order Amount in currency2. default option apply to all orders other than Market. |
maxOrderAmountCcy2. pendingPayout | Yes | Float | Maximum Order Amount in currency2. pendingPayout option apply to Market 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 V3
By using Account Status V3 method, Client can find out current balance and it’s indicative equivalent in converted currency (by default “USD”), amounts locked in open (active) orders as to each sub-account and currency.
If credit line is enabled for Client, then response will also contain general credit line data such as base currency name, exposure limit, total debt amount, total balance on hold in base currency together with specific balance and balance on hold equivalents in base currency as to each currency on all Client’s sub-accounts.
If overdraft limit for specific currencies is enabled for Client, then response will also contain data as to amount of overdraft limit for each of such currencies.
It’s Client’s responsibility to track his sub-accounts available trading balance as current sub-account balance reduced by the balance amount locked in open (active) orders on sub-account. Client should also take into consideration general overdraft limits and credit line exposure limit, total debt and total balance on hold (if overdraft limit and\or credit line were configured for Client).
REQUEST
get_my_account_status_v3
API Key Permission
This method requires “Read” permission set for API Key.
Get My Account Status V3 Request
Get My Account Status V3 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_v3",
"oid": "1465340168103_1_get_my_account_status_v3",
"data": {
"accountIds": []
}
}
Response (Prime Liquidity responds that Client has main account with currencies "EUR", "USD" and "BTC" and sub-account "hallo" with currencies "EUR", "USD" and "ADA". Also, it contains balance equivalents in converted currency for each account and each currency)
{
"e": "get_my_account_status_v3",
"oid": "1465340168103_1_get_my_account_status_v3",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"EUR": {
"balance": "81268.59756471",
"balanceOnHold": "1000.00000000",
"balanceInConvertedCurrency": "91237.00374199"
},
"USD": {
"balance": "1537803.93463592",
"balanceOnHold": "1150.28899854",
"balanceInConvertedCurrency": "1537803.93463592"
},
"BTC": {
"balance": "981.03037775",
"balanceOnHold": "0.00100000",
"balanceInConvertedCurrency": "29288171.41253737"
}
},
"hallo": {
"EUR": {
"balance": "10004.99100000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "11233.60389480"
},
"USD": {
"balance": "9994.87699999",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "9994.87699999"
},
"ADA": {
"balance": "3999.10000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "1219.32559000"
}
}
}
}
}
Get My Account Status V3 for selected Sub-accounts for All Currencies
Request (Client sends a request to find out Client's accounts’ statuses for specified accounts for all currencies)
{
"e": "get_my_account_status_v3",
"oid": "1465340168104_1_get_my_account_status_v3",
"data": {
"accountIds": ["hallo", "superhat"]
}
}
Response (Prime Liquidity responds that Client has sub-account "hallo" with currencies "USD" and "ADA". Sub-account "superhat" status was requested, but 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_v3",
"oid": "1465340168104_1_get_my_account_status_v3",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"hallo": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39.79438200"
},
"ADA": {
"balance": "15.00000000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "4.57350000",
"balanceInConvertedCurrency": "4.57350000"
}
}
}
}
}
Get My Account Status v3 for All Accounts for Selected Currencies
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies)
{
"e": "get_my_account_status_v3",
"oid": "1465340168105_1_get_my_account_status_v3",
"data": {
"currencies":["USD","BTC"]
}
}
Response (Prime Liquidity responds that Client has main account and sub-account "account123", each with currencies "USD" and "BTC". Note that other currencies (like "EUR", "ETH" etc.) are not included into response, because their balances were not requested)
{
"e": "get_my_account_status_v3",
"oid": "1465340168105_1_get_my_account_status_v3",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39.79438200"
},
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"USD": {
"balance": "100.00000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "100.00000000"
},
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V3 for All Accounts for One Selected Currency
Request (Client sends request to find out his accounts’ statuses for all accounts for "BTC" currency)
{
"e": "get_my_account_status_v3",
"oid": "1465340168106_1_get_my_account_status_v3",
"data": {
"currencies": ["BTC"]
}
}
Response (Prime Liquidity responds that main account and sub-account "account123" have "BTC" balances. Note that other currencies (like "USD", "EUR", "SHIB" etc.) and other sub-accounts are not included in the response, because they were not requested or do not contain balances in requested currencies)
{
"e": "get_my_account_status_v3",
"oid": "1465340168106_1_get_my_account_status_v3",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V3 - No Account Matching Criteria
Request (Client sends request to find out his accounts’ statuses for main account and sub-account "hallo" only for "EUR" currency balance)
{
"e": "get_my_account_status_v3",
"oid": "1465340168107_1_get_my_account_status_v3",
"data": {
"currencies": ["EUR"],
"accountIds": ["", "hallo"]
}
}
Response (Prime Liquidity responds that Client has no accounts which satisfy request criteria)
{
"e": "get_my_account_status_v3",
"oid": "1465340168107_1_get_my_account_status_v3",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {}
}
}
Get My Account Status V3 for Single Account for Single Currency
Request (Client sends request to find out the main account status for USD currency)
{
"e": "get_my_account_status_v3",
"oid": "1465340168108_1_get_my_account_status_v3",
"data": {
"currencies": ["USD"],
"accountIds": [""]
}
}
Response (Prime Liquidity responds that Client has main account and includes USD balance on it. No other accounts are included, and no other currencies are included, because they were not requested for)
{
"e": "get_my_account_status_v3",
"oid": "1465340168108_1_get_my_account_status_v3",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "1537803.93463592",
"balanceOnHold": "1150.28899854",
"balanceInConvertedCurrency": "1537803.93463592"
}
}
}
}
}
Get My Account Status V3 for All Accounts for Selected Currencies with enabled Credit Line and Overdraft Limit
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies. Client has enabled Credit Lin and Overdraft Limit)
Note that Client has enabled Credit Line and Overdraft Limit for "USD" currency
{
"e": "get_my_account_status_v3",
"oid": "1465340168113_2_get_my_account_status_v3",
"data": {
"currencies":["USD","BTC"]
}
}
Response (Prime Liquidity responds that Client has balances in "USD" and "BTC" on main account and sub-accounts "hallo", "account123" and also balance in "BTC" on "someAccount2" sub-account)
Note that Client has enabled Credit Line and Overdraft Limit for "USD" currency
{
"e": "get_my_account_status_v3",
"oid": "1465340168113_2_get_my_account_status_v3",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"creditLine": {
"baseCurrency": "USD",
"exposureLimit": "1000000.00000000",
"totalDebt": "33.14403771",
"totalBalanceOnHold": "3.92144100",
"overdraftLimits": {
"USD": "450.00000000"
},
}
},
"balancesPerAccounts": {
"": {
"USD": {
"balance": "-33.14403771",
"balanceOnHold": "3.92144100",
"balanceInBaseCurrency": "-33.14403771",
"balanceInConvertedCurrency": "-33.14403771",
"balanceOnHoldInBaseCurrency": "3.92144100"
},
"BTC": {
"balance": "0.00650000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "260.30615000",
"balanceInConvertedCurrency": "260.30615000",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
},
"hallo": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceOnHoldInBaseCurrency": "0.00000000"
},
"BTC": {
"balance": "1.10000000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "43964.30458121",
"balanceInConvertedCurrency": "43964.30458121",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
},
"account123": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceOnHoldInBaseCurrency": "0.00000000"
},
"BTC": {
"balance": "0.00020000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "8.00942000",
"balanceInConvertedCurrency": "8.00942000",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
},
"someAccount2": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceInBaseCurrency": "39969.03458121",
"balanceInConvertedCurrency": "39969.03458121",
"balanceOnHoldInBaseCurrency": "0.00000000"
}
}
}
}
}
Get My Account Status v3 - Incorrect Request
Request (Client sends request, however "accountIds" field contains not an Array but a number value)
{
"e": "get_my_account_status_v3",
"oid": "1465392818634_2_get_my_account_status_v3",
"data": {
"accountIds": 3,
"currencies":["BTC"]
}
}
Response (Prime Liquidity responds about request processing error because not an array has been sent in "accountIds" field and "accountIds" array should consist of string type values)
{
"e": "get_my_account_status_v3",
"oid": "1465392818634_2_get_my_account_status_v3",
"data": {
"error": "accountIds array should consist of string type values"
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_my_account_status_v3" 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. Prime Liquidity 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 and of string type. 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 an empty array ([]), then it means Client wants to find out balances for all available currencies. |
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 of string type and should be present only once in this array. For example, ["hallo", "", "account123", "hallo"] is not allowed. If this field is missing or if it contains an empty array ([]), then it means Client wants to find out balances for all accounts. |
oid | Yes | String | Unique ID of this request. |
Get My Account Status V3 Response
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_my_account_status_v3" value allowed. |
data | Yes | Object | This object contains response details. It should contain balancesPerAccounts and convertedCurrency mandatory fields and could also contain creditLine optional field. |
data.convertedCurrency | Yes | String | The currency in which balanceInConvertedCurrency is calculated by CEX.IO Prime Liquidity. By default only "USD" value is allowed herein. |
data.creditLine | No | Object | This object contains details about Client’s credit line configuration (base currency, exposure limit, total debt, total balance on hold), overdraft limits, withdrawal overdraft limits (if at least one of these options are enabled for Client). If such options are not enabled for Client, then this field would be missing. |
data.creditLine.baseCurrency | No | String | The currency in which exposureLimit, totalDebt, totalBalanceOnHold, balanceInBaseCurrency and balanceOnHoldInBaseCurrency values are calculated by CEX.IO Prime Liquidity. |
data.creditLine.exposureLimit | No | String (which can be parsed as Float) | Credit line limit available for Client. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is defined in baseCurrency. |
data.creditLine.totalDebt | No | String (which can be parsed as Float) | Describes total amount of negative balances on all Client's accounts. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is calculated in baseCurrency. |
data.creditLine.totalBalanceOnHold | No | String (which can be parsed as Float) | Describes total amount of сurrent balances which is reserved (locked) for active orders on all Client’s accounts. This amount is cummulative and common for all Client’s accounts (main and sub-accounts) and is calculated in baseCurrency. |
data.creditLine.overdraftLimits | No | Object | This object contains details about Client’s overdraft limit configuration if such option is enabled for Client. Overdraft limit is set for specific currencies and is common for all Client’s accounts (main and sub-accounts). If overdraft limit is not enabled for Client, then this field would be missing. |
data.creditLine.overdraftLimits.ZZZ | Yes | String (which can be parsed as Float) | Overdraft limit for specific ZZZ currency, which is enabled for all Client's accounts. |
data.balancesPerAccounts | Yes | Object | This object contains details about Client's currencies' balances as to each account which satisfies request criteria. It might be empty object ("{}"), but this field should be present anyway and it should contain an object. If this field contains an empty object, then it means Client has no accounts which satisfy Client’s request criteria. |
data.balancesPerAccounts.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.balancesPerAccounts.X.YYY | No | Object | Represents an object which describes X account statuses for YYY currency. |
data.balancesPerAccounts.X.YYY. balance | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency. It includes balance which is reserved (locked) for active orders (please find this information in "balanceOnHold" field). |
data.balancesPerAccounts.X.YYY. balanceOnHold | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency which is reserved (locked) for active orders. |
data.balancesPerAccounts.X.YYY. balanceInBaseCurrency | No | String (which can be parsed as Float) | Equivalent in base currency of current YYY currency balance on Client's X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If credit line is not enabled for Client OR if current YYY currency balance on Client's X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in base currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceInConvertedCurrency | No | String (which can be parsed as Float) | Equivalent in converted currency of current YYY currency balance on Client’s X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to converted currency. If current YYY currency balance on Client’s X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in converted currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceOnHoldInBaseCurrency | No | String (which can be parsed as Float) | Equivalent in base currency of current X account balance in YYY currency which is reserved (locked) for active orders on Client’s X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If credit line is not enabled for Client, then this field would be missing. |
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 V2 (deprecated)
Using Account Status V2 request, Client can find out current balance and it’s indicative equivalent in converted currency (by default “USD”), available trading balance and amounts which are locked in open (active) orders as to each sub-account and currency.
Available trading balance is calculated as current balance plus overdraft limit (if allowed for the Client) and reduced by the balance amount locked in open (active) orders.
If credit line is enabled for Client, then response will also contain data as to the base currency name, exposure limit, total debt amount, currencies balance equivalents in base currency as to each currency on all Client’s accounts (main account and sub-accounts).
If overdraft limit for specific currency is enabled for Client, then response will also contain data as to amount of overdraft limit for such currency on all Client’s accounts (main account and sub-account), which have balance in specified currency.
REQUEST
get_my_account_status_v2
API Key Permission
This method requires “Read” permission set for API Key.
Get My Account Status V2 Request
Get My Account Status V2 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_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"data": {
"accountIds": []
}
}
Response (Prime Liquidity responds that Client has main account with currencies "USD", "ADA" and "BTC" and sub-account "hallo" with currencies "ETH" and "SHIB". Also, it contains balance equivalents in converted currency for each account and each currency)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceAvailable": "39.79438200",
"balanceInConvertedCurrency": "39.79438200"
},
"ADA": {
"balance": "20.24000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "20.24000000",
"balanceInConvertedCurrency": "16.21191616"
},
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00040000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"hallo": {
"ETH": {
"balance": "15.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "15.00000000",
"balanceInConvertedCurrency": "38962.11113119"
},
"SHIB": {
"balance": "1573107",
"balanceOnHold": "1210584",
"balanceAvailable": "362523",
"balanceInConvertedCurrency": "35.61514248"
}
}
}
}
}
Get My Account Status V2 for selected Sub-accounts for All Currencies
Request (Client sends a request to find out Client's accounts’ statuses for specified accounts for all currencies)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"data": {
"accountIds": ["hallo", "superhat"]
}
}
Response (Prime Liquidity responds that Client has sub-account "hallo" with currencies "ETH" and "SHIB". Sub-account "superhat" status was requested, but 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_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"hallo": {
"ETH": {
"balance": "15.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "15.00000000",
"balanceInConvertedCurrency": "38962.11113119"
},
"SHIB": {
"balance": "1573107",
"balanceOnHold": "1210584",
"balanceAvailable": "362523",
"balanceInConvertedCurrency": "35.61514248"
}
}
}
}
}
Get My Account Status V2 for All Accounts for Selected Currencies
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"data": {
"currencies":["USD","BTC"]
}
}
Response (Prime Liquidity responds that Client has main account and sub-account "account123", each with currencies "USD" and "BTC". Note that other currencies (like "EUR", "ETH" etc.) are not included into response, because their balances were not requested)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "39.79438200",
"balanceOnHold": "0.00000000",
"balanceAvailable": "39.79438200",
"balanceInConvertedCurrency": "39.79438200"
},
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00040000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"USD": {
"balance": "100.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "100.00000000",
"balanceInConvertedCurrency": "100.00000000"
},
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V2 for All Accounts for One Selected Currency
Request (Client sends request to find out his accounts’ statuses for all accounts for "BTC" currency)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"data": {
"currencies": ["BTC"]
}
}
Response (Prime Liquidity responds that main account and sub-account "account123" have "BTC" balances. Note that other currencies (like "USD", "EUR", "SHIB" etc.) and other sub-accounts are not included in the response, because they were not requested or do not contain balances in requested currencies)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"BTC": {
"balance": "0.00040000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00040000",
"balanceInConvertedCurrency": "15.67344000"
}
},
"account123": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.00000000",
"balanceInConvertedCurrency": "39157.90502748"
}
}
}
}
}
Get My Account Status V2 - No Account Matching Criteria
Request (Client sends request to find out his accounts’ statuses for main account and sub-account "hallo" only for "EUR" currency balance)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"data": {
"currencies": ["EUR"],
"accountIds": ["", "hallo"]
}
}
Response (Prime Liquidity responds that Client has no accounts which satisfy request criteria)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {}
}
}
Get My Account Status V2 for Single Account for Single Currency
Request (Client sends request to find out the main account status for USD currency)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"data": {
"currencies": ["USD"],
"accountIds": [""]
}
}
Response (Prime Liquidity responds that Client has main account and includes USD balance on it. No other accounts are included, and no other currencies are included, because they were not requested for)
{
"e": "get_my_account_status_v2",
"oid": "1465340168103_1_get_my_account_status_v2",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"balancesPerAccounts": {
"": {
"USD": {
"balance": "100.79438200",
"balanceOnHold": "70.00000000",
"balanceAvailable": "30.79438200",
"balanceInConvertedCurrency": "100.79438200"
}
}
}
}
}
Get My Account Status V2 for All Accounts for Selected Currencies with enabled Credit Line and Overdraft Limit
Request (Client sends request to find out his accounts’ statuses for all accounts for selected currencies. Client has enabled Credit Line and Overdraft Limit for "USD" currency)
Note that Client has enabled Credit Line and Overdraft Limit for "USD" currency
{
"e": "get_my_account_status_v2",
"oid": "1465340168113_2_get_my_account_status_v2",
"data": {
"currencies":["USD","BTC"]
}
}
Response (Prime Liquidity responds that Client has balances in "USD" and "BTC" on main account and sub-accounts "hallo", "account123" and also balance in "BTC" on "someAccount2" sub-account)
Note that Client has negative "USD" balance on main account and, consequently, used Credit Line. Also, Client has some "USD" balance locked in orders and overall 450 "USD" overdraft limit for all Client's accounts.
{
"e": "get_my_account_status_v2",
"oid": "1465340168113_2_get_my_account_status_v2",
"ok": "ok",
"data": {
"convertedCurrency": "USD",
"creditLine": {
"baseCurrency": "USD",
"exposureLimit": "999.00000000",
"totalDebt": "33.14403771"
},
"balancesPerAccounts": {
"": {
"USD": {
"balance": "-33.14403771",
"balanceOnHold": "3.92144100",
"balanceAvailable": "412.93452129",
"overdraftLimit": "450.00000000",
"balanceInBaseCurrency": "-33.14403771",
"balanceInConvertedCurrency": "-33.14403771"
},
"BTC": {
"balance": "0.00650000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00650000",
"balanceInBaseCurrency": "260.30615000",
"balanceInConvertedCurrency": "260.30615000"
}
},
"hallo": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "450.00000000",
"overdraftLimit": "450.00000000"
},
"BTC": {
"balance": "1.10000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.10000000",
"balanceInBaseCurrency": "43964.30458121",
"balanceInConvertedCurrency": "43964.30458121"
}
},
"account123": {
"USD": {
"balance": "0.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "450.00000000",
"overdraftLimit": "450.00000000"
},
"BTC": {
"balance": "0.00020000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "0.00020000",
"balanceInBaseCurrency": "8.00942000",
"balanceInConvertedCurrency": "8.00942000"
}
},
"someAccount2": {
"BTC": {
"balance": "1.00000000",
"balanceOnHold": "0.00000000",
"balanceAvailable": "1.00000000",
"balanceInBaseCurrency": "39969.03458121",
"balanceInConvertedCurrency": "39969.03458121"
}
}
}
}
}
Get My Account Status V2 - Incorrect Request
Request (Client sends request, however "accountIds" field contains not an Array but a number value)
{
"e": "get_my_account_status_v2",
"oid": "1465392818634_2_get_my_account_status_v2",
"data": {
"accountIds": 3,
"currencies":["BTC"]
}
}
Response (Prime Liquidity responds about request processing error because not an array has been sent in "accountIds" field and "accountIds" array should consist of string type values)
{
"e": "get_my_account_status_v2",
"oid": "1465392818634_2_get_my_account_status_v2",
"data": {
"error": "accountIds array should consist of string type values"
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_my_account_status_v2" 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. Prime Liquidity 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 and of string type. 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 an empty array ([]), then it means Client wants to find out balances for all available currencies. |
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 of string type and should be present only once in this array. For example, ["hallo", "", "account123", "hallo"] is not allowed. If this field is missing or if it contains an empty array ([]), then it means Client wants to find out 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_v2" value allowed. |
data | Yes | Object | This object contains response details. It should contain balancesPerAccounts and convertedCurrency mandatory fields and could also contain creditLine optional field (if credit line is enabled for Client). |
data.convertedCurrency | Yes | String | The currency in which balanceInConvertedCurrency is calculated by CEX.IO Prime Liquidity. By default only "USD" value is allowed herein. |
data.creditLine | No | Object | This object contains details about Client's credit line configuration (if enabled for Client), including information about the base currency, exposure limit and total debt. If credit line is not enabled for Client, then this field would be missing. |
data.creditLine.baseCurrency | Yes | String | The currency in which exposureLimit, totalDebt and balanceInBaseCurrency values are calculated by CEX.IO Prime Liquidity. |
data.creditLine.exposureLimit | Yes | String (which can be parsed as Float) | Credit line limit available for Client. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is defined in baseCurrency. |
data.creditLine.totalDebt | Yes | String (which can be parsed as Float) | Describes total amount of negative balances on all Client's accounts. This amount is cummulative and common for all Client's accounts (main and sub-accounts) and is calculated in baseCurrency. |
data.balancesPerAccounts | Yes | Object | This object contains details about Client's currencies' balances as to each account which satisfies request criteria. It might be empty object ("{}"), but this field should be present anyway and it should contain an object. If this field contains an empty object, then it means Client has no accounts which satisfy Client’s request criteria. |
data.balancesPerAccounts.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.balancesPerAccounts.X.YYY | No | Object | Represents an object which describes X account statuses for YYY currency. |
data.balancesPerAccounts.X.YYY. balance | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency. It includes balance which is reserved (locked) for active orders (please find this information in "balanceOnHold" field). |
data.balancesPerAccounts.X.YYY. balanceOnHold | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency which is reserved (locked) for active orders. |
data.balancesPerAccounts.X.YYY. balanceAvailable | Yes | String (which can be parsed as Float) | Current X account balance in YYY currency which is available for trading. It is calculated as current X account balance in YYY currency plus overdraft limit for YYY currency (if enabled for the Client) and reduced by the X account balance amount in YYY currency, which is locked in open (active) orders. |
data.balancesPerAccounts.X.YYY. overdraftLimit | No | String (which can be parsed as Float) | Overdraft limit for YYY currency, which is enabled for all Client's accounts. Cverdraft limit is set for specific YYY currency and is common for all Client's accounts (main and sub-accounts), but is shown in each account of the response which has balances in YYY currency. If overdraft limit is not set for YYY currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceInBaseCurrency | No | String (which can be parsed as Float) | Equivalent in base currency of current YYY currency balance on Client's X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If credit line is not enabled for Client OR if current YYY currency balance on Client's X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in base currency, then this field would be missing. |
data.balancesPerAccounts.X.YYY. balanceInConvertedCurrency | No | String (which can be parsed as Float) | Equivalent in converted currency of current YYY currency balance on Client's X account. This amount is calculated according to CEX.IO Prime Liquidity indicative exchange rate of YYY currency to base currency. If current YYY currency balance on Client's X account is zero OR if CEX.IO Prime Liquidity failed to calculate such equivalent in converted currency, then this field would be missing. |
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. |
Wallet Balance
This request allows Client to receive his CEX.IO Wallet balances, which can be useful for Client to check his current Wallet balances while depositing\withdrawing funds between Prime Liquidity and Wallet accounts.
REQUEST
get_my_wallet_balance
API Key Permission
This method requires “Read” permission set for API Key.
Wallet Balance Request
Get My Wallet Balance - Successful request
Request (Client sends request to receive his Wallet account balances)
{
"e": "get_my_wallet_balance",
"oid": "1521724219900_1_get_my_wallet_balance",
"data": {}
}
Response (CEX.IO Prime Liquidity responds with Client's current balances in BTC, ETH, USD, EUR on Wallet account)
{
"e": "get_my_wallet_balance",
"oid": "1521724219900_1_get_my_wallet_balance",
"ok": "ok",
"data": {
"BTC": {
"balance": "9.72101000"
},
"ETH": {
"balance": "10.000000"
},
"USD": {
"balance": "23567.02"
},
"EUR": {
"balance": "728.99"
}
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_my_wallet_balance" value is allowed here. |
oid | Yes | String | Unique ID of this request. |
data | Yes | Object | This object contains request details. Empty object should be sent to get Client's CEX.IO Wallet account balances. |
Wallet Balance Response Parameters
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_my_wallet_balance" value is allowed here. |
oid | Yes | String | Unique ID of Client’s request, for which this message is in response to. |
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 response details. |
XXX | Yes | Object | Represents an object which describes CEX.IO Wallet account status for XXX currency. |
XXX.balance | Yes | String (which can be parsed as Float) | Current CEX.IO Wallet account balance in XXX currency. |
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. |
Orders
This request allows Client to find out info about his orders.
REQUEST
get_my_orders
API Key Permission
This method requires “Read” permission set for API Key.
Get My Orders Request
Get My Orders - All Open Orders
Request (Client sends request to find all his open orders for all pairs and all accounts)
{
"e": "get_my_orders",
"oid": "1465405014762_1_get_my_orders",
"data": {}
}
Response (Prime Liquidity 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 his 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), Prime Liquidity 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 his open orders for "BTC-EUR" pair)
{
"e": "get_my_orders",
"oid": "1465405014762_1_get_my_orders",
"data": {
"pair": "BTC-EUR"
}
}
Response (Prime Liquidity 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 his 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 (Prime Liquidity 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 received by server 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,
"serverCreateTimestampFrom": 1465229489578,
"serverCreateTimestampTo": 1465289589579
}
}
Response (Prime Liquidity 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 his archived orders)
{
"e": "get_my_orders",
"oid": "1465405014762_1_get_my_orders",
"data": {
"archived": true,
"side": "SELL",
"serverCreateTimestampFrom": 1516699048964,
"serverCreateTimestampTo": 1516699987501
}
}
Response (supposed that Client has 3 archived orders (like in previous example), Prime Liquidity responds to Client that he has 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 sends a request, but doesn't specify mandatory "data" field)
{
"e": "get_my_orders",
"oid": "1465409645363_1_get_my_orders"
}
Response (Prime Liquidity responds that error occurred. Note: "data" field hold an 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 sends 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 (Prime Liquidity 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 a number)
{
"e": "get_my_orders",
"oid": "1465478161261_1_get_my_orders",
"data": {
"archived": 0
}
}
Response (Prime Liquidity 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 his single order by orderId)
{
"e": "get_my_orders",
"oid": "1465405014762_1_get_my_orders",
"data": {
"orderId": 18
}
}
Response (Prime Liquidity 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 his single order by clientOrderId)
{
"e": "get_my_orders",
"oid": "1465405014762_1_get_my_orders",
"data": {
"clientOrderId": "1465299852968-0"
}
}
Response (Prime Liquidity 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 Market Buy Cash Order with includeFeeInAmount option used
Request (Client sends request to find his Market Buy Cash Order by clientOrderId)
{
"e": "get_my_orders",
"oid": "1674051322611_1_get_my_orders",
"data": {
"clientOrderId": "IncludeFee_order_112123in"
}
}
Response (Prime Liquidity responds with status of this order)
{
"e": "get_my_orders",
"oid": "1674051322611_1_get_my_orders",
"ok": "ok",
"data": [
{
"orderId": "979524",
"clientOrderId": "IncludeFee_order_112123in",
"clientId": "IT_DEMO",
"accountId": null,
"status": "FILLED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"orderType": "Market",
"timeInForce": null,
"comment": null,
"rejectCode": null,
"rejectReason": null,
"initialOnHoldAmountCcy1": null,
"initialOnHoldAmountCcy2": "20.00000000",
"executedAmountCcy1": "0.00091316",
"executedAmountCcy2": "19.80198020",
"requestedAmountCcy1": null,
"requestedAmountCcy2": "19.80198020",
"originalAmountCcy2": "20.00000000",
"feeAmount": "0.19801980",
"feeCurrency": "USD",
"price": null,
"averagePrice": "21685.1",
"statusIsFinal": true,
"clientCreateTimestamp": 1674051322611,
"serverCreateTimestamp": 1674051325798,
"lastUpdateTimestamp": 1674051329147,
"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 his 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, Prime Liquidity ignores all other parameters in "data" field. |
orderId | No | Number | Order identifier assigned by Prime Liquidity (OrderID(37) field in Execution Report(8) message in FIX API). If both fields "orderId" and "clientOrderId" are present, then Prime Liquidity 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, Prime Liquidity 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 his 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 an empty string (""), or null, then it means Client wants to find his 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 his orders. |
accountIds | No | Array | List of account identifiers, for which Client wants to find his 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 his orders for all accounts. |
serverCreate TimestampFrom | No | Number | UTC timestamp in milliseconds. Represents the earliest server timestamp when order is received. In the result set orders’ serverCreateTimestamp should be greater than or equal to (>=) serverCreateTimestampFrom. Period indicated by serverCreateTimestampFrom and serverCreateTimestampTo values can not be greater than 365 days. This parameter is mandatory if Client queries info about archived orders. |
serverCreate TimestampTo | No | Number | UTC timestamp in milliseconds. Represents the latest server timestamp when order is received. In the result set orders’ serverCreateTimestamp should be less than (<) serverCreateTimestampTo. Period indicated by serverCreateTimestampFrom and serverCreateTimestampTo values can not be greater than 365 days. If this field is missing than current date is set by default. |
sortOrder | No | String | Sort order of the result set. The result array is sorted by serverCreateTimestamp. "ASC" - ascending order, "DESC" - descending order. If this field is missing then the default sort order is "DESC". |
pageSize | No | Number | Because the result might contain too many orders, Client should specify which portion of the result list he wants 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 he wants 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 is allowed here. |
data | Yes | Array or Object | This object contains list of orders which satisfy request criteria. It might be an 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 Prime Liquidity (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 orders. |
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 currency2) |
requestedAmountCcy2 | Yes | String (which can be parsed as Float) | By default, 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). If both requestedAmountCcy2 and originalAmountCcy2 fields are present in the response, this field represents amount in currency2, which was calculated by Prime Liquidity system to be executed for execution of Client's Market Buy order with indicated amount in currency2 and enabled includeFeeInAmount option. |
originalAmountCcy2 | No | String (which can be parsed as Float) | If this field is present, it means Client has requested information about Market Buy order with amountCcy2 and enabled includeFeeInAmount option. In this case, the value in this field represents order amount in currency2, which was originall specified by Client in amountCcy2 field at placing of order. The value in this field should equal the sum of values specified in executedAmountCcy2 and feeAmount fields if the order was fully executed. |
initialOnHoldAmountCcy1 | Yes | String (which can be parsed as Float) | Represents amount in currency1 which was hold from Client balance by Prime Liquidity before order execution. If this value is null, then it means that amount in currency1 was not hold from Client's account for this order. |
initialOnHoldAmountCcy2 | Yes | String (which can be parsed as Float) | Represents amount in currency2 which was hold from Client balance by Prime Liquidity before order execution. If this value is null, then it means that amount in currency2 was not hold from Client's account for this order. |
feeAmount | Yes | String (which can be parsed as Float) | Represents order commission amount, 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 orders 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 was 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 new orders via WebSocket API by using Do My New Order Request. Along with a response to this request, Prime Liquidity sends Account Event and Execution Report messages to Client if the request is successful.
Response message indicates the last up-to-date status of order which is available in the system at the moment of sending the response.
If the Client did not receive a Response message to Do My New Order Request - the Client can query current status of the order by using Get My Orders Request with clientOrderId parameter.
When sending a request for new order, it is highly recommended to use clientOrderId parameter which corresponds to the specific new order request on the client's side. Prime Liquidity protects multiple placing of orders with the same clientOrderId for a reasonable period of time.
If more than one new orders with identical clientOrderId and other order parameters are identified - Prime Liquidity places only the first order and returns the status of such order to the Client in response to the second and subsequent new order requests with the same parameters. If orders with identical clientOrderId but with different other order parameters are identified - Prime Liquidity processes only the first order and rejects the second and subsequent new order requests with the same clientOrderID but with different other order parameters. Nevertheless, if Client creates more than one orders with same clientOrderId in a significant period of time, order with same clientOrderId can be accepted by the system. It's Client's responsibility to control unique indication of clientOrderIds.
REQUEST
do_my_new_order
API Key Permission
This method requires “Trade” permission set for API Key.
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 7,500)
{
"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 (Prime Liquidity sends acknowledgement message with a current status of order)
{
"e": "do_my_new_order",
"oid": "1521711134776_1_do_my_new_order",
"ok": "ok",
"data": {
"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 (Prime Liquidity 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",
"onHoldBalance": "0.01000000",
"timestamp": 1521708409281,
"action": "order",
"id": "17059"
}
}
Response (Prime Liquidity sends Execution Report event for the new order. The first Execution Report contains initial state: executed amounts are both 0, no fee has 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 (Prime Liquidity sends Account Event notification. As a result of selling 0.1 BTC Client 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",
"onHoldBalance": "0.00000000",
"timestamp": 1521711136458,
"action": "order",
"id": "17062"
}
}
Response (Prime Liquidity 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",
"onHoldBalance": "00.00000000",
"timestamp": 1521711136727,
"action": "order",
"id": "17062"
}
}
Response (Prime Liquidity 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). feeAmount 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",
"lastAmountCcy1": "0.01000000",
"lastAmountCcy2": "170.63000000",
"feeAmount": "0.60063000",
"feeCurrency": "USD"
}
}
Do My New Order - place Limit BUY order
Request (Client requests to place a Limit order to buy 0.01 BTC for USD at price 18,500)
{
"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,
"comment": "v_overdraft_test"
}
}
Response (Prime Liquidity sends acknowledgement message with a current status of order)
{
"e": "do_my_new_order",
"oid": "1521713494191_1_do_my_new_order",
"ok": "ok",
"data": {
"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 (Prime Liquidity sends Account Event notification. Before order execution starts, Prime Liquidity 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 the amount was subtracted, the balance is 9161.57071930 USD)
{
"e": "account_update",
"ok": "ok",
"data": {
"clientId": "IT_DEMO",
"accountId": "",
"currency": "USD",
"balance": "9161.57071930",
"onHoldBalance": "185.46250000",
"timestamp": 1521713494503,
"action": "order",
"id": "17065"
}
}
Response (Prime Liquidity sends Execution Report for the new order. The first Execution Report contains initial state: executed amounts are both 0, no fee has 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 (Prime Liquidity 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",
"onHoldBalance": "0.00000000",
"timestamp": 1521713495376,
"action": "order",
"id": "17065"
}
}
Response (Prime Liquidity sends Account Event notification after order has 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",
"onHoldBalance": "0.00000000",
"timestamp": 1521713495615,
"action": "order",
"id": "17065"
}
}
Response (Prime Liquidity sends final execution report. It has status FILLED, executed amount in currency 1 is equal to requested amount in currency 1. Average price is less than was requested for BUY order (therefore limit order was executed immediately). feeAmount 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",
"lastAmountCcy1": "0.01000000",
"lastAmountCcy2": "173.04000000",
"feeAmount": "0.61304000",
"feeCurrency": "USD"
}
}
Do My New Order - place Market BUY order
Request (Client requests to place a Market order to buy 10 BTC for USD)
{
"e": "do_my_new_order",
"data": {
"accountId": "someAccount01",
"clientOrderId": "manual_1614173000191",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"timestamp": 1614173000191,
"orderType": "Market",
"amountCcy1": 10
},
"oid": "16141730009391_do_my_new_order"
}
Response (Prime Liquidity sends acknowledgement message with a status of order. The order has been rejected due to insufficient funds on Client’s account)
{
"e": "do_my_new_order",
"oid": "16141730009391_do_my_new_order",
"ok": "ok",
"data": {
"clientId": "IT_DEMO",
"orderId": "338306",
"clientOrderId": "manual_1614173000191",
"accountId": "someAccount01",
"status": "REJECTED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "10.00000000",
"requestedAmountCcy2": null,
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Rejected",
"executionId": "1614012430993_103_295",
"transactTime": null,
"expireTime": null,
"effectiveTime": null,
"averagePrice": null,
"feeAmount": null,
"feeCurrency": null,
"orderRejectReason": "{\"code\":403,\"reason\":\"Insufficient funds\"}",
"rejectCode":403,
"rejectReason":"Insufficient funds"
}
}
Do My New Order - place Market BUY order
Request (Client requests to place a Market order to buy 10 BTC for USD)
{
"e": "do_my_new_order",
"data": {
"accountId": "someAccount01",
"clientOrderId": "manual_1614173000191",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"timestamp": 1614173000191,
"orderType": "Market",
"amountCcy1": 10
},
"oid": "16141730009391_do_my_new_order"
}
Response (Prime Liquidity sends acknowledgement message with a status of order. The order has been rejected due to the exceeded limit of active (open) orders)
{
"e": "do_my_new_order",
"oid": "16141730009391_do_my_new_order",
"ok": "ok",
"data": {
"clientId": "IT_DEMO",
"orderId": "338306",
"clientOrderId": "manual_1614173000191",
"accountId": "someAccount01",
"status": "REJECTED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "10.00000000",
"requestedAmountCcy2": null,
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Rejected",
"executionId": "1614012430993_103_295",
"transactTime": null,
"expireTime": null,
"effectiveTime": null,
"averagePrice": null,
"feeAmount": null,
"feeCurrency": null,
"orderRejectReason": "{\"code\":437,\"reason\":\"Too many active orders\"}",
"rejectCode":437,
"rejectReason":"Too many active orders"
}
}
Do My New Order - place Market BUY order with includeFeeInAmount option
Request (Client requests to place a Market order to BUY BTC for 20 USD and wants to include fee in the requested amount of order in currency2)
{
"e": "do_my_new_order",
"ok": "ok",
"oid": "1674051322611_do_my_new_order",
"data": {
"accountId": "",
"clientOrderId": "IncludeFee_order_1",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"timestamp": 1674051322611,
"orderType": "Market",
"amountCcy1": "20",
"includeFeeInAmount": true
}
}
Response (Prime Liquidity sends Execution Report message with a current status of order "New". The message contains information about the amount in currency2 which was originally requested by Client to be executed (originalAmountCcy2 field) and amount of currency2 calculated by the system to be executed (executedAmountCcy2 field) in order to fulfil requested includeFeeInAmount option)
{
"e": "executionReport",
"ok": "ok",
"data": {
"messageType": "executionReport",
"clientId": "IT_DEMO",
"orderId": "979524",
"clientOrderId": "IncludeFee_order_1",
"accountId": null,
"status": "NEW",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": null,
"requestedAmountCcy2": "19.80198020",
"originalAmountCcy2": "20.00000000",
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "New",
"executionId": "1673607318675_101_2858",
"transactTime": "2023-01-18T14:15:25.964Z",
"expireTime": null,
"effectiveTime": null,
"averagePrice": null,
"feeAmount": "0.00000000",
"feeCurrency": "USD",
"clientCreateTimestamp": 1674051322611,
"serverCreateTimestamp": 1674051325798,
"lastUpdateTimestamp": 1674051325933
}
}
Response (Prime Liquidity sends Account Event notification. As a result of buying BTC upon execution of order 979524 Client’s main account BTC balance was updated and now equals 0.00387895 BTC)
{
"e": "account_update",
"ok": "ok",
"data": {
"clientId": "IT_DEMO",
"accountId": "",
"currency": "BTC",
"balance": "0.00387895",
"onHoldBalance": "0.00000000",
"timestamp": 1674051329065,
"action": "order",
"id": "979524"
}
}
Response (Prime Liquidity sends Account Event notification. As a result of spending USD upon execution of order 979524 Client main account USD balance was updated and now equals 80.00000000 USD)
{
"e": "account_update",
"ok": "ok",
"data": {
"clientId": "IT_DEMO",
"accountId": "",
"currency": "USD",
"balance": "80.00000000",
"onHoldBalance": "0.00000000",
"timestamp": 1674051329065,
"action": "order",
"id": "979524"
}
}
Response (Prime Liquidity sends Execution Report event for the order upon occurred trade event. Execution Report indicates that market order has been fully executed, the amount requested by Client to be executed is indicated in originalAmountCcy2 field, executed amount of currency2 is indicated executedAmountCcy2 field. The sum of executedAmountCcy2 (19.80198020 USD) and feeAmount (0.19801980 USD) equals originalAmountCcy2 requested by Client (20.00000000))
{
"e": "executionReport",
"ok": "ok",
"data": {
"messageType": "executionReport",
"clientId": "IT_DEMO",
"orderId": "979524",
"clientOrderId": "IncludeFee_order_1",
"accountId": null,
"status": "FILLED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00091316",
"executedAmountCcy2": "19.80198020",
"requestedAmountCcy1": null,
"requestedAmountCcy2": "19.80198020",
"originalAmountCcy2": "20.00000000",
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Trade",
"executionId": "1673607318675_101_2859",
"transactTime": "2023-01-18T14:15:29.178Z",
"expireTime": null,
"effectiveTime": null,
"averagePrice": "21685.2",
"lastQuantity": "19.80198020",
"lastPrice": "21685.2",
"feeAmount": "0.19801980",
"lastAmountCcy1": "0.00091316",
"lastAmountCcy2": "19.80198020",
"feeCurrency": "USD",
"clientCreateTimestamp": 1674051322611,
"serverCreateTimestamp": 1674051325798,
"lastUpdateTimestamp": 1674051329147
}
}
Response (Prime Liquidity sends final status of market order in response to Client's New Order request)
{
"e": "do_my_new_order",
"ok": "ok",
"oid": "16740513255713_do_my_new_order",
"data": {
"messageType": "executionReport",
"clientId": "IT_DEMO",
"orderId": "979524",
"clientOrderId": "IncludeFee_order_1",
"accountId": null,
"status": "FILLED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00091316",
"executedAmountCcy2": "19.80198020",
"requestedAmountCcy1": null,
"requestedAmountCcy2": "19.80198020",
"originalAmountCcy2": "20.00000000",
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Trade",
"executionId": "1673607318675_101_2859",
"transactTime": "2023-01-18T14:15:29.178Z",
"expireTime": null,
"effectiveTime": null,
"averagePrice": "21685.2",
"lastQuantity": "19.80198020",
"lastPrice": "21685.2",
"lastAmountCcy1": "0.00091316",
"lastAmountCcy2": "19.80198020",
"feeAmount": "0.19801980",
"feeCurrency": "USD",
"clientCreateTimestamp": 1674051322611,
"serverCreateTimestamp": 1674051325798,
"lastUpdateTimestamp": 1674051329147
}
}
Do My New Order - Pending Market Order
Request (Client requests to place a Market order)
{
"e": "do_my_new_order",
"ok": "ok",
"oid": "16736102497642_do_my_new_order",
"data": {
"clientOrderId": "12345678920",
"currency1": "ADA",
"currency2": "USD",
"side": "BUY",
"timestamp": 1673610249763,
"orderType": "Market",
"amountCcy1": "10"
}
}
Response (Prime Liquidity sends acknowledgement message with a current status of order. As the order has not been fully filled yet, Prime Liquidity returns current status of order with OrderStatus value in executionType field)
{
"e": "do_my_new_order",
"ok": "ok",
"oid": "16736102497642_do_my_new_order",
"data": {
"messageType": "executionReport",
"clientId": "someClient01",
"orderId": "977197",
"clientOrderId": "12345678920",
"accountId": null,
"status": "NEW",
"currency1": "ADA",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "10.00000000",
"requestedAmountCcy2": null,
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "OrderStatus",
"executionId": 0,
"transactTime": "2023-01-13T11:44:25.240Z",
"expireTime": null,
"effectiveTime": null,
"averagePrice": null,
"feeAmount": "0.00000000",
"feeCurrency": "USD",
"clientCreateTimestamp": 1673610249763,
"serverCreateTimestamp": 1673610250135,
"lastUpdateTimestamp": 1673610250311
}
}
Response (In some period of time Prime Liquidity sends Account Event notification as trade occurred. As a result of buying ADA upon execution of order 977197 Client main account ADA balance was updated and now equals 113.12345678 ADA)
{
"e": "account_update",
"ok": "ok",
"data": {
"clientId": "someClient01",
"accountId": "",
"currency": "ADA",
"balance": "113.12345678",
"onHoldBalance": "0.00000000",
"timestamp": 1673610250411,
"action": "order",
"id": "977197"
}
}
Response (Prime Liquidity sends Account Event notification. As a result of spending USD upon execution of order 977197 Client main account USD balance was updated and now equals 1567.23987468 USD)
{
"e": "account_update",
"ok": "ok",
"data": {
"clientId": "someClient01",
"accountId": "",
"currency": "USD",
"balance": "1567.23987468",
"onHoldBalance": "0.00000000",
"timestamp": 1673610250415,
"action": "order",
"id": "977197"
}
}
Response (In some time trade occurred and Prime Liquidity sends Execution Report event, which indicates that market order has been filled)
{
"e": "executionReport",
"ok": "ok",
"data": {
"messageType": "executionReport",
"clientId": "someClient01",
"orderId": "977197",
"clientOrderId": "12345678920",
"accountId": null,
"status": "FILLED",
"currency1": "ADA",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "10.00000000",
"executedAmountCcy2": "3.33608745",
"requestedAmountCcy1": "10.00000000",
"requestedAmountCcy2": null,
"orderType": "Market",
"timeInForce": null,
"comment": null,
"executionType": "Trade",
"executionId": "1673607322492_100_38",
"transactTime": "2023-01-13T11:46:01.535Z",
"expireTime": null,
"effectiveTime": null,
"averagePrice": "0.333609",
"lastQuantity": "10.00000000",
"lastPrice": "0.333608",
"lastAmountCcy1": "10.00000000",
"lastAmountCcy2": "3.33608745",
"feeAmount": "0.03336088",
"feeCurrency": "USD",
"clientCreateTimestamp": 1673610249763,
"serverCreateTimestamp": 1673610250135,
"lastUpdateTimestamp": 1673610361504
}
}
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",
"comment": "v_overdraft_test"
}
}
Response (Prime Liquidity 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 is allowed here. |
oid | Yes | String | Unique ID of this request. |
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). |
accountId | No | String | Client’s sub-account ID. If the value is an 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 | Number | UTC timestamp in milliseconds, represents client-side order creation time (field TransactTime(60) in New Order Single(D) message in FIX API). By default, timestamp should be within 30000 ms timeframe with server time, otherwise, order will be rejected. Please be informed that default timeframe value 30000 ms can be changed for the Client by request. |
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 orders. |
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 currency2 (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 | No | String (parseable as Float) | Represents order price (corresponds to Price(44) field in New Order Single(D) message in FIX API). Please omit this field for orders, where price cannot be requested, for example, Market orders or Stop orders. |
expireTime | No | 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 (StopPx in FIX API) for Stop and StopLimit orders types. |
includeFeeInAmount | No | Boolean | This field can be applied only for Market Buy orders with indicated amountCcy2. Represents an instruction by Client to CEX.IO Prime Liquidity to include feeAmount for order execution in amountCcy2 specified by Client. If the value is "true", then Prime Liquidity will execute order in a way that the sum of executedAmountCcy2 and feeAmount should equal amountCcy2 requested by Client. If this parameter is missing or the value is "false", then Prime Liquidity will execute order in a way that executedAmountCcy2 should equal amountCcy2 requested by Client and feeAmount for order execution value will be charged additionally to executedAmountCcy2. |
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 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. |
clientId | Yes | String | Client CompId. |
accountId | Yes | String | Client’s sub-account ID who created the order. If the value is an empty string (""), then the order was created by Client’s main account. |
orderId | Yes | String | Order identifier assigned by Prime Liquidity (OrderID(37) field in Execution Report(8) message in FIX API). "NONE" value can be returned if order is rejected due to validation errors: failed minOrderAmountCcy, maxOrderAmountCcy, lotSizeCcy, max active orders checks. |
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 orders. |
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. |
executionType | YES | String | Describes the type of order execution event, due to which executionReport is being sent to Client. Allowed values are “PendingNew”, “New”, “Trade”, “PendingCancel” , “Canceled”, “Rejected”, “OrderStatus”. |
orderRejectReason | No | String | Text field describing rejection reason. Often (but not always) it 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. |
rejectCode | No | Number | Numeric error code. |
rejectReason | No | String | Text field indicating 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) | By default, 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). If both requestedAmountCcy2 and originalAmountCcy2 fields are present in the response, it means Client has requested to place Market Buy order with amount in currency2 with enabled includeFeeInAmount option and the value in this field represents amount in currency2, which was calculated by Prime Liquidity system and is expected to be executed so that the sum of executedAmountCcy2 and feeAmount equals amount in currency2 requested by the Client (indicated in originalAmountCcy2 field). |
originalAmountCcy2 | No | String (which can be parsed as Float) | If this field is present, it means Client has requested to place Market Buy order with amountCcy2 and enabled includeFeeInAmount option. In this case, the value in this field represents order amount in currency2, which was specified by Client in amountCcy2 field. Upon full order execution the value in this field should equal the sum of values specified in executedAmountCcy2 and feeAmount fields. |
feeAmount | Yes | String (which can be parsed as Float) | Represents order commission amount, 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 orders, 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. |
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 Prime Liquidity, 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. Prime Liquidity 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 is allowed here. |
messageType | Yes | String | Describes the type of this message, only "executionReport" value is allowed here. |
clientId | Yes | String | Client's CompId. |
accountId | Yes | String | Client’s sub-account ID who created the order. If the value is an empty string (""), then the order was created by Client’s main account. |
orderId | Yes | String | Order identifier assigned by Prime Liquidity (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 orders. |
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. |
executionType | Yes | String | Describes the type of order execution event, due to which executionReport is being sent to Client. Allowed values are “PendingNew”, “New”, “Trade”, “PendingCancel” , “Canceled”, “Rejected”, “OrderStatus”. |
orderRejectReason | No | String | Text field describing rejection reason. Often (but not always) it 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) | By default, 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). If both requestedAmountCcy2 and originalAmountCcy2 fields are present in the response, it means Client has requested to place Market Buy order with amount in currency2 with enabled includeFeeInAmount option and the value in this field represents amount in currency2, which was calculated by Prime Liquidity system and is expected to be executed so that the sum of executedAmountCcy2 and feeAmount equals amount in currency2 requested by the Client (indicated in originalAmountCcy2 field). |
originalAmountCcy2 | No | String (which can be parsed as Float) | If this field is present, it means Client has requested to place Market Buy order with amountCcy2 and enabled includeFeeInAmount option. In this case, the value in this field represents order amount in currency2, which was specified by Client in amountCcy2 field. Upon full order execution the value in this field should equal the sum of values specified in executedAmountCcy2 and feeAmount fields. |
lastAmountCcy1 | No | String (which can be parsed as Float) | Represents last trade executed amount in currency1. This field should be present if executionType is "Trade". This field should be missing if executionType is not "Trade". |
lastAmountCcy2 | No | String (which can be parsed as Float) | Represents last trade executed amount in currency2. This field should be present if executionType is "Trade". This field should be missing if executionType is not "Trade". |
feeAmount | Yes | String (which can be parsed as Float) | Represents order commission amount, 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 orders, 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, Prime Liquidity sends Account Event and Execution Report messages to Client if this request is successful. Also, if request to cancel an order is declined, Prime Liquidity sends Order Cancellation Rejection message.
REQUEST
do_cancel_my_order
API Key Permission
This method requires “Trade” permission set for API Key.
Cancel My Order Request
Do Cancel My Order - successful cancellation of Limit SELL BTC order by clientOrderId
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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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",
"onHoldBalance": "0.00000000",
"timestamp": 1521719535842,
"action": "order",
"id": "17066"
}
}
Response (Prime Liquidity 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 - successful cancellation of Limit BUY BTC order by orderId
Request (Client requests to cancel order, to which Prime Liquidity assigned orderId equal to 123456789)
{
"e": "do_cancel_my_order",
"oid": "1521719532818_2_do_cancel_my_order",
"data": {
"orderId": 123456789,
"cancelRequestId": "cancel_1521719532818",
"timestamp": 1521719535311
}
}
Response (Prime Liquidity sends acknowledgement message confirming that the cancellation request is accepted)
{
"e": "do_cancel_my_order",
"oid": "1521719532818_2_do_cancel_my_order",
"ok": "ok",
"data": {}
}
Response (Prime Liquidity 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": "123456789",
"clientOrderId": "cancel_1521719532818",
"OrigClOrdID": "1521719532818",
"accountId": null,
"status": "PENDING_CANCEL",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "0.00010000",
"requestedAmountCcy2": null,
"orderType": "Limit",
"timeInForce": "GTC",
"comment": "cancel_order_test",
"executionType": "PendingCancel",
"executionId": "1521616998878_2_7",
"transactTime": null,
"expireTime": null,
"effectiveTime": null,
"price": "12500.00",
"averagePrice": null,
"feeAmount": "0.00000000",
"feeCurrency": "USD"
}
}
Response (Prime Liquidity 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": "USD",
"balance": "13459.85",
"onHoldBalance": "0.00000000",
"timestamp": 1521719535843,
"action": "order",
"id": "123456789"
}
}
Response (Prime Liquidity 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": "123456789",
"clientOrderId": "cancel_1521719532818",
"OrigClOrdID": "1521719532818",
"accountId": null,
"status": "CANCELLED",
"currency1": "BTC",
"currency2": "USD",
"side": "BUY",
"executedAmountCcy1": "0.00000000",
"executedAmountCcy2": "0.00000000",
"requestedAmountCcy1": "0.00010000",
"requestedAmountCcy2": null,
"orderType": "Limit",
"timeInForce": "GTC",
"comment": "cancel_order_test",
"executionType": "Canceled",
"executionId": "1521616998879_2_8",
"transactTime": null,
"expireTime": null,
"effectiveTime": null,
"price": "12500.00",
"averagePrice": null,
"feeAmount": "0.00000000",
"feeCurrency": "USD"
}
}
Do Cancel My Order - incorrect request with missing "orderId" and "clientOrderId" parameters
Request (Client requests to cancel order but doesn't indicate either "orderId" or "clientOrderId" parameters)
{
"e": "do_cancel_my_order",
"oid": "1521719532835_do_cancel_my_order",
"data": {
"cancelRequestId": "cancel_1521719532834",
"timestamp": 1521719535322
}
}
Response (Prime Liquidity responds that either "clientOrderId" or "orderId" should be specified)
{
"e": "do_cancel_my_order",
"oid": "1521719532836_do_cancel_my_order",
"data": {
"error": "ClientOrderId or orderId should be specified"
}
}
Do Cancel My Order - incorrect request with both "orderId" and "clientOrderId" parameters
Request (Client requests to cancel order but indicates both "orderId" and "clientOrderId" parameters)
{
"e": "do_cancel_my_order",
"oid": "1521719532836_do_cancel_my_order",
"data": {
"clientOrderId": "1521719532817",
"orderId": 123456789,
"cancelRequestId": "cancel_1521719532899",
"timestamp": 1521719535349
}
}
Response (Prime Liquidity responds that either "clientOrderId" or "orderId" should be specified - not both of them)
{
"e": "do_cancel_my_order",
"oid": "1521719532836_do_cancel_my_order",
"data": {
"error": "Only one of the fields ClientOrderId or orderId should be specified, not both"
}
}
Do Cancel My Order - invalid cancellation request
Request (Client requests to cancel order with clientOrderId equal to "omg_not_an_order_order" (that has been 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 (Prime Liquidity 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 (Prime Liquidity 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. |
orderId | No | Number | Order identifier assigned by Prime Liquidity (OrderID(37) field in Execution Report(8) message in FIX API). If this field is present and contains valid value, then it means Client wants to cancel specific order with orderId, which was assigned by Prime Liquidity. If "orderId" field is present, then "clientOrderId" should be absent. Either "orderId" or "clientOrderId" should be indicated in request anyway. |
clientOrderId | No | String | Order identifier assigned by Client when the order was created. If this field is present and contains valid value, then it means Client wants to cancel specific order with clientOrderId indicated by Client at order placement. If "clientOrderId" field is present, then "orderId" field should be absent. Either "clientOrderId" or "orderId" should be indicated in request anyway. |
cancelRequestId | Yes | String | Cancel request identifier assigned by Client. |
timestamp | Yes | Number | 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, Prime Liquidity 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's 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 Prime Liquidity (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 Prime Liquidity will start cancellation process for all open orders and send corresponding Account Event and Execution Report messages to the Client.
REQUEST
do_cancel_all_orders
API Key Permission
This method requires “Trade” permission set for API Key.
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 (Prime Liquidity sends acknowledgement message confirming the list of Client’s opened orders which system is trying to cancel. There are 2 open orders in this case)
{
"e": "do_cancel_all_orders",
"oid": "1575459976724_1_do_cancel_all_orders",
"ok": "ok",
"data": {
"clientOrderIds": ["1575459943138","1575459942041"]
}
}
Response (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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.16922000",
"onHoldBalance": "0.00100000",
"timestamp": 1575459977538,
"action": "order",
"id": "2284074"
}
}
Response (Prime Liquidity 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 (Prime Liquidity 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",
"onHoldBalance": "0.00000000",
"timestamp": 1575459977542,
"action": "order",
"id": "2284073"
}
}
Response (Prime Liquidity 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 open orders
Request (Client requests to cancel all opened orders)
{
"e": "do_cancel_all_orders",
"oid": "1521711134776_1_do_cancel_all_orders",
"data": {}
}
Response (Prime Liquidity sends acknowledgement message confirming there are no Client’s open 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 an 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 an 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 Prime Liquidity, orders cancellation starts. Orders cancellation consists of certain events such as: order is pending cancellation, order is cancelled, order cancellation is rejected. Prime Liquidity sends Execution Reports to inform Client about these events. Please refer to execution report specification described on FIX section.
Market Data
Client can receive market data by sending Market Data Request via WebSocket. Along with a response to this request, Prime Liquidity sends Market Data Snapshot, Market Data Incremental Refresh or Market Data Request Reject messages to Client.
By default, only 1 active subscription per pair at one time is allowed. If your API integration requires more than one subscription, please contact your account manager.
If Client has active market data subscriptions and WS session is terminated, then all active subscriptions that were created in this WS connection are cancelled. Please note - it can take up to 1 minute for server to find that WS connection is disconnected in cases, when WS connection is not shut down gracefully.
REQUEST
md_subscribe
API Key Permission
This method requires “Read” permission set for API Key.
Market Data Request
Market Data request with depth
Request (Client subscribes to market data with required depth he wants to see)
{
"e":"md_subscribe",
"data": {
"pair":"BTC-USD",
"depth":2
},
"oid":"16147857398591_md_subscribe"
}
Response (Prime Liquidity sends acknowledgement message confirming successful market data subscription)
{
"e":"md_subscribe",
"oid":"16147857398591_md_subscribe",
"data": {
"mdReqId":"1614768745069_383"
},
"ok":"ok"
}
Response (Prime Liquidity sends initial market data snapshot message)
{
"e":"marketDataSnapshot",
"data": {
"messageType":"marketDataSnapshot",
"clientId":"TestClient",
"sessionId":"102",
"mdReqId":"1614768745069_383",
"mdSeqId":0,
"timestamp":1614785740028,
"currency1":"BTC",
"currency2":"USD",
"bids": [
["50709.3","0.14768004"],
["50705.3","0.02949369"]],
"asks": [
["50830.5","0.0281276"],
["50839.1","1"]]
},
"ok":"ok"
}
Response (Prime Liquidity sends market data incremental refresh message)
{
"e":"marketDataIncrementalRefresh",
"data": {
"messageType":"incrementalRefresh",
"mdReqId":"1614768745069_383",
"mdSeqId":1,
"clientId":"TestClient",
"sessionId":"102",
"timestamp":1614785740071,
"currency1":"BTC",
"currency2":"USD",
"bids":[
["50709.3",0],
["50705.3",0],
["50703.9","2.03576392"],
["50701.7","0.04781172"]],
"asks":[
["50828.5","1"],
["50839.1",0]]
},
"ok":"ok"
}
Example of marketDataRequestReject message when Client attempts to subscribe twice for the same pair
Response (Prime Liquidity responds that only 1 active WS subscription per pair is allowed)
{
"e":"marketDataRequestReject",
"data": {
"messageType":"marketDataRequestReject",
"clientId":"TestClient",
"sessionId":"100",
"mdReqId":"1614768767461_15698",
"mdRejectReason":"duplicate",
"comment":"{\"code\":406,\"reason\":\"Only 1 active ws subscriptions per pair allowed but found 1 for TestClient BTC-USD\"}"
},
"ok":"ok"
}
Market Data Request with incorrect depth
Request (Client subscribes to market data with incorrect depth value)
{
"e":"md_subscribe",
"data": {
"pair":"ETH-EUR",
"depth":-1
},
"oid":"16147857421624_md_subscribe"
}
Response (Prime Liquidity responds that such request is not allowed. Parameter depth should be greater or equal than zero)
{
"e":"md_subscribe",
"oid":"16147857421624_md_subscribe",
"data": {
"error":"parameter depth should be greater or equal than zero"
}
}
Market Data Request with unsupported currency pair
Request (Client subscribes to market data for currency pair which is unsupported for Client)
{
"e":"md_subscribe",
"data": {
"pair":"LTC-BTC"
},
"oid":"16147857432295_md_subscribe"
}
Response (Prime Liquidity responds that such request is not allowed. Currency pair is not supported in Client's profile)
{
"e":"md_subscribe",
"oid":"16147857432295_md_subscribe",
"data": {
"error":"Currency pair LTC-BTC is not supported in client profile"
}
}
Market Data unsubscribe request
Request (Client sends a request to unsubscribe from active subscription)
{
"e": "md_unsubscribe",
"data": {
"pair":"BTC-USD"
},
"oid":"16148615001972_md_unsubscribe"
}
Response (Prime Liquidity sends acknowledgement message confirming unsubscription from market data)
{
"e":"md_unsubscribe",
"oid":"16148615001972_md_unsubscribe",
"data": {
"mdReqId":"1614768767461_2127"
},
"ok":"ok"
}
Market Data unsubscribe request with incorrect currency pair
Request (Client sends a request to unsubscribe from market data with incorrect currency pair)
{
"e":"md_unsubscribe",
"data": {
"pair":"BTC-CCC"
},
"oid":"161486170412911_md_unsubscribe"
}
Response (Prime Liquidity sends error message that incorrect currency pair is sent in the request)
{
"e":"md_unsubscribe",
"oid":"161486170412911_md_unsubscribe",
"data": {
"error":"Currency pair BTC-CCC is not supported in client profile"
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "md_subscribe" value is allowed here. |
oid | Yes | String | Unique ID of this request. |
pair | Yes | String | Tradable symbol or currency pair. For example, "BTC-USD". |
depth | No | Number | Depth of the market data Client wants to see. The allowed values are: 0 - Full Book (max allowed number of price levels of the Book); 1 - Top of Book (one best price level of the Book); N - Reports best (N best price levels of the Book). Depth value should be greater or equal than 0. If this field is not defined then the default depth value would be returned. |
Market Data Response
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "md_subscribe" 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. |
mdReqId | Yes | String | Unique ID of the market data request. |
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. |
Market Data Update Messages
After successful subscription server will send marketDataSnapshot message, which contains full order book for that moment.
Next messages are marketDataIncrementalRefresh messages, which should be applied to initial market data snapshot incrementally on the Client’s side to keep Market Data snapshot up to date. Each Incremental Refresh item should be applied to existing Snapshot at specific price level.
As long as the Client is subscribed to Market Data, the server sends marketDataSnapshot every minute to minimize risk of incorrect applying of incremental refresh on Client’s side. To keep Market Data up to date the Client should replace the previous marketDataSnapshot with the newest one and continue to apply next messages over this new snapshot.
All Market Data update messages have parameter mdSeqId. When subscription is started, this parameter usually equals to 0 (but Client should expect any number) and increments on each further message.
For example, if Market Dara Snapshot Message, received by the Client, has mdSeqId with value 100, then the first Incremental Refresh Message will have mdSeqId = 100+1 = 101.
If one or a few Market Data update messages were not received by the Client, it is required to resubscribe to Market Data for receiving a new actual snapshot in order to keep Market Data up to date.
Also, Client can receive message with mdSeqId=0 after being successfully subscribed and receiving some Market Data update messages. Such situation happens when Prime Liquidity’s internal system is restarted and MD subscription is automatically resubscribed for the Client. In this case first message (with mdSeqId=0) will be marketDataSnapshot which means that it is required to replace previous snapshot with a newest one (with mdSeqId=0).
Market Data Snapshot Message
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message, only "marketDataSnapshot" value is allowed here. |
messageType | Yes | String | Describes the type of this message, only "marketDataSnapshot" value is allowed here. |
clientId | Yes | String | Client's CompId. |
sessionId | Yes | String | Unique ID of WebSocket session. |
mdReqId | Yes | String | Unique ID of the market data request. |
mdSeqId | Yes | Number | Unique ID of the market data update message. This parameter is usually equal to 0 (but can be any other number) when subscription is started and then is being incremented on each further message. |
timestamp | Yes | Number | UTC timestamp in milliseconds. Represents server timestamp of market data update. |
currency1 | Yes | String | Represents first currency in currency pair. |
currency2 | Yes | String | Represents second currency in currency pair. |
bids | Yes | Array | This array contains a list of bids of the order book. The first value of an array element indicates price level of the market data entry, the second value of an array element indicates amount of the market data entry. The value in this field can be an empty array in case of no bids are available in the order book. |
asks | Yes | Array | This array contains a list of asks of the order book. The first value of an array element indicates price level of the market data entry, the second value of an array element indicates amount of the market data entry. The value in this field can be an empty array in case of no asks are available in the order book. |
ok | Yes | String | "ok" value represents that event notification is successfully generated. |
Market Data Incremental Refresh Message
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message, only "marketDataIncrementalRefresh" value is allowed here. |
messageType | Yes | String | Describes the type of this message, only "marketDataIncrementalRefresh" value is allowed here. |
clientId | Yes | String | Client's CompId. |
sessionId | Yes | String | Unique ID of WebSocket session. |
mdReqId | Yes | String | Unique ID of the market data request. |
mdSeqId | Yes | Number | Unique ID of the market data incremental update message.The first marketDataIncrementalRefresh message after receiving the first snapshot should have the value in this field incremented by 1 from mdSeqId in the snapshot and the following marketDataIncrementalRefresh messages contain the values which are incremented on each further message. |
timestamp | Yes | Number | UTC timestamp in milliseconds. Represents server timestamp of market data update. |
currency1 | Yes | String | Represents first currency in currency pair. |
currency2 | Yes | String | Represents second currency in currency pair. |
bids | Yes | Array | This array contains a list of bids of the order book. The first value of an array element indicates price level of the market data entry, the second value of an array element indicates amount of the market data entry. If the second value of an array element indicates amount of the market data entry as 0, then it means that bids at price level of the market data entry indicated in the first value of array element are no longer available. |
asks | Yes | Array | This array contains a list of asks of the order book. The first value of an array element indicates price level of the market data entry, the second value of an array element indicates amount of the market data entry. If the second value of an array element indicates amount of the market data entry as 0, then it means that asks at price level of the market data entry indicated in the first value of array element are no longer available. |
ok | Yes | String | "ok" value represents that event notification is successfully generated. |
Market Data Request Reject Message
Prime Liquidity sends Market Data Request Reject message in case of any internal error happens during market data subscription. Client will not further receive market data updates after receiving of such Market Data Request Reject message.
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message, only "marketDataRequestReject" value is allowed here. |
messageType | Yes | String | Describes the type of this message, only "marketDataRequestReject" value is allowed here. |
clientId | Yes | String | Client's CompId. |
sessionId | Yes | String | Unique ID of WebSocket session. |
mdReqId | Yes | String | Unique ID of the market data request. |
mdRejectReason | Yes | String | Reason of the rejection of a Market Data Request. |
comment | Yes | String | Text field describing rejection reason. Often (but not always) it 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. |
ok | Yes | String | "ok" value represents that event notification is successfully generated. |
Market Data Unsubscribe
It's highly recommended to unsubscribe from market data when it is no longer needed.
REQUEST
md_unsubscribe
API Key Permission
This method requires “Read” permission set for API Key.
Market Data Unsubscribe Request
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "md_unsubscribe" value is allowed here. |
oid | Yes | String | Unique ID of this request. |
pair | No | String | Tradable symbol or currency pair for which market data should be unsubscribed. For example "BTC-USD". |
allSessions | No | Boolean | If this field is present and if its value is true, it means that Client wants to unsubscribe from all active WS subscriptions. It is useful to force cleanup of any active subscriptions on Client's restart to avoid cases when more than one active subscriptions exist. |
Market Data Unsubscribe Response
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "md_unsubscribe" 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. |
mdReqId | Yes | String | Unique ID of the market data request. |
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 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.
Order book contains 2 sides: bid and ask. Get Exchange Rate request allows to perform rate estimation on both sides of the order book. There are 4 possible cases for rate estimation:
When Client sends BUY BTC-USD Get Exchange Rate request and specifies amount X and currency USD that means that he wants to buy BTC for X USD. In this case ask side of the order book will be used to perform the measurement.
When Client sends BUY BTC-USD Get Exchange Rate request and specifies amount Y and currency BTC that means that he wants to buy Y BTC for USD. In this case ask side of the order book will be used to perform the measurement.
When Client sends SELL BTC-USD Get Exchange Rate request and specifies amount X and currency USD that means that he wants to sell BTC to X USD. In this case bid side of the order book will be used to perform the measurement.
When Client sends SELL BTC-USD Get Exchange Rate request and specifies amount Y and currency BTC that means that he wants to sell Y BTC to USD. In this case bid side of the order book will be used to perform the measurement.
REQUEST
get_exchange_rate
API Key Permission
This method requires “Read” permission set for API Key.
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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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.
REQUEST
get_current_rates
API Key Permission
This method requires “Read” permission set for API Key.
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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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 (Prime Liquidity 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 an 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 no market data is available in Bid part of the order book. |
bestAsk | No | String | Best ask price for specific pair. It could be "null" in case no market data is available in Ask part of the 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 his financial transactions (deposits, withdrawals, internal transfers, commissions or trades).
REQUEST
get_my_transaction_history
API Key Permission
This method requires “Read” permission set for API Key.
Get My Transaction History Request
Get My Transaction History - For Main Account with specified period
Request (Client sends request to find transactions of all types for the main account with specified period and sort the results in ascending order)
{
"e":"get_my_transaction_history",
"oid":"1465501899597_1_get_my_transaction_history",
"data":{
"accountId": "",
"type": "",
"dateFrom": 1613101662720,
"dateTo": 1614336230587,
"sortOrder": "ASC"
}
}
Response
{
"e": "get_my_transaction_history",
"oid": "1465501899597_1_get_my_transaction_history",
"ok": "ok",
"data": [
{ "transactionId": "7831622",
"timestamp": "2021-02-12T09:44:35.078Z",
"accountId": "",
"type": "trade",
"amount": "0.00200000",
"details": "Finalization Trade orderId='335805' for DEMO_USER",
"currency": "BTC"
},
{ "transactionId": "7831619",
"timestamp": "2021-02-12T09:44:35.078Z",
"accountId": "",
"type": "trade",
"amount": "-33.40944038",
"details": "Finalization Trade orderId='335805' for DEMO_USER",
"currency": "USD"
},
{ "transactionId": "7831618",
"timestamp": "2021-02-12T09:44:35.090Z",
"accountId": "",
"type": "commission",
"amount": "-0.16704721",
"details": "Commission for orderId='335805' for DEMO_USER",
"currency": "USD"
}
]
}
Get My Transaction History - For Main Account with Paging
Request (Client sends request to find transactions of all types for the main account and wants to see the second page expecting the result set is chunked to pages size 3 (not more than 3 transactions per page))
{
"e":"get_my_transaction_history",
"oid":"1465501899597_1_get_my_transaction_history",
"data":{
"accountId": "",
"type": "",
"pageSize": 3,
"pageNumber": 2,
"sortOrder": "DESC"
}
}
Response
{
"e": "get_my_transaction_history",
"oid": "1465501899597_1_get_my_transaction_history",
"ok": "ok",
"data": [
{ "transactionId": "7831618",
"timestamp": "2021-02-24T16:36:23.271Z",
"accountId":"",
"type": "commission",
"amount": "-1242.90844594",
"details": "Commission for orderId='338348' for DEMO_USER",
"currency": "USD"
},
{ "transactionId": "7831613",
"timestamp": "2021-02-24T16:36:23.259Z",
"accountId": "",
"type": "trade",
"amount": "-1.56398259",
"details": "Finalization Trade orderId='338348' for DEMO_USER",
"currency": "BTC"
},
{ "transactionId": "7831609",
"timestamp": "2021-02-24T16:36:23.259Z",
"accountId": "",
"type": "trade",
"amount": "77753.71512521",
"details": "Finalization Trade orderId='338348' for DEMO_USER",
"currency": "USD"
}
]
}
Get My Transaction History - Deposit Transactions for Main Account
Request (Client sends request to find all deposit transactions for main account)
{
"e":"get_my_transaction_history",
"oid":"1465501899597_1_get_my_transaction_history",
"data":{
"accountId": "",
"type": "deposit"
}
}
Response
{
"e": "get_my_transaction_history",
"oid": "1465501899597_1_get_my_transaction_history",
"ok": "ok",
"data": [
{
"transactionId": "7834322",
"timestamp": "2021-02-19T10:56:16.255Z",
"accountId": "",
"type": "deposit",
"amount": "0.05000000",
"details": "Deposit fundingId=57693 clientId=DEMO_USER walletTxId=136047928",
"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 "type" parameter
Request (Client sends request with incorrect "type" parameter)
{
"e":"get_my_transaction_history",
"oid":"1465501899597_1_get_my_transaction_history",
"data":{
"accountId": "",
"type": "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 (Client sends request with pageSize which is over max allowed limit 100)
{
"e":"get_my_transaction_history",
"oid":"1465501899597_1_get_my_transaction_history",
"data":{
"accountId": "",
"type": "",
"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 - Incorrect Request
Request (Client sends request to find his 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. |
oid | Yes | String | Unique ID of this request. |
data | Yes | Object | This object contains request details. It might be an 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 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. |
type | No | String | If this field is present and contains one of the allowed values, 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 or if this field is present but contains an empty string (""), 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 than or equal to (>=) dateFrom. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateFrom should be less than the value in the field dateTo. |
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 than (<) dateTo. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateTo should be greater than the value in the field dateFrom. |
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 he wants to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request and cannot be greater than 100. If this field is missing, then the default value of 100 is used. If this field contains one of the allowed values and, simultaneously, the pageNumber field is missing, then the default pageNumber value is applied. Specifying the value in the field pageSize is mandatory if the value in the field pageNumber is also sent in the Client's request. |
pageNumber | No | Number | Because the result might contain too many transactions, Client should specify, which portion of the result list he wants 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 1. If this field is missing, then the default value of 1 is used. This value cannot be lower than 1. If any valid value is specified in this field, then it is mandatory to also send the value in the field pageSize in the Client’s 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. |
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. |
oid | Yes | String | Unique ID of Client’s request, for which this message is in response to. |
data | Yes | Array or Object | This object contains list of transactions, which satisfies request criteria. It might be an 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. |
transactionId | Yes | String | Unique identifier of transaction in Prime Liquidity system. |
timestamp | Yes | Datetime | Represents server timestamp when this transaction happened. Format: YYYY-MM-DDTHH:MM:SS.sssZ . |
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. |
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. |
Funding History
This request allows Client to find his deposit and withdrawal transactions.
REQUEST
get_my_funding_history
API Key Permission
This method requires “Read” permission set for API Key.
Get My Funding History Request
Get My Funding History - For Main Account and all sub-accounts
Request (Client sends request to find 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 (Prime Liquidity 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": "2021-02-19T10:56:25.272Z"
},
{
"txId": 148127,
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "withdraw",
"amount": "11.34000000",
"commissionAmount": "0.14000000",
"status": "approved",
"updatedAt": "2021-02-19T10:56:17.193Z"
},
{
"txId": 148128,
"clientId": "TestClient",
"accountId": "100108_test",
"currency": "BTC",
"direction": "deposit",
"amount": "15.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:18:48.682Z"
},
{
"txId": 148129,
"clientId": "TestClient",
"accountId": "100109_test",
"currency": "BTC",
"direction": "deposit",
"amount": "55.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:17:45.399Z"
},
{
"txId": 148130,
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "deposit",
"amount": "55.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-16T13:16:41.585Z"
}
]
}
Get My Funding History - For Main Account and all Sub-accounts with Paging
Request (Client sends request to find deposit/withdrawal transactions for the main account and all sub-accounts and wants to see the first 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), Prime Liquidity responds with the first 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": "2021-02-19T10:56:25.272Z"
},
{
"txId": 148129,
"clientId": "TestClient",
"accountId": "100109_test",
"currency": "BTC",
"direction": "deposit",
"amount": "55.34000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2021-02-19T10:56:17.193Z"
}
]
}
Get My Funding History - For Specified Sub-Account
Request (Client sends request to find deposit/withdrawal transactions for specified sub-account)
{
"e": "get_my_funding_history",
"oid": "1465501899597_1_get_my_funding_history",
"data": {
"accountId": "100109_test"
}
}
Response (Prime Liquidity 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": "2021-02-14T15:09:12.557Z"
}
]
}
Get My Funding History - Deposit Transactions for Main Account and all Sub-accounts with specified Period
Request (Client sends request to find all deposit transactions for main account and all sub-accounts, which happened within specified period)
{
"e": "get_my_funding_history",
"oid": "1465501899597_1_get_my_funding_history",
"data": {
"direction": "deposit",
"dateFrom": 1514337745869,
"dateTo": 1614337745869
}
}
Response (Prime Liquidity responds that Client has only one transaction, which satisfies requested 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": "2021-02-19T10:56:17.193Z"
}
]
}
Get My Funding History - Pending External Deposit
Request (Client requests first deposit transaction since defined time)
{
"e": "get_my_funding_history",
"oid": "1465501899597_2_get_my_funding_history",
"data": {
"direction": "deposit",
"dateFrom": 1514337745869,
"dateTo": 1614337745869
}
}
Response (Prime Liquidity responds that Client has pending external deposit in status "initiated", and as for now, it has 0 confirmations in the blockchain)
{
"e":"get_my_funding_history",
"oid":"1465501899597_2_get_my_funding_history",
"ok": "ok",
"data": [
{
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "deposit",
"amount": "1.00000000",
"commissionAmount": "0.00000000",
"status": "initiated",
"updatedAt": "2023-02-16T20:00:00.000Z",
"txId": 12345,
"details": {
"address": "00112233445566778899aabbccddeeffgg",
"blockchain": "bitcoin",
"confirmations": 0,
"blockchainTxId": "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"
}
}
]
}
Get My Funding History - Approved External Deposit
Request (Client requests first deposit transaction since defined time)
{
"e": "get_my_funding_history",
"oid": "1465567380491_3_get_my_funding_history",
"data": {
"direction": "deposit",
"dateFrom": 1676561116790,
"pageSize": 1,
"pageNumber": 1
}
}
Response (Prime Liquidity responds that Client has external deposit which has already been approved)
{
"e":"get_my_funding_history",
"oid":"1465567380491_3_get_my_funding_history",
"ok": "ok",
"data": [
{
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "deposit",
"amount": "1.20000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2023-02-16T20:00:00.000Z",
"txId": 12345,
"details": {
"address": "00112233445566778899aabbccddeeffgg",
"blockchain": "bitcoin",
"confirmations": 3,
"blockchainTxId": "12112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"
}
}
]
}
Get My Funding History - External Withdrawal
Request (Client requests first withdrawal transaction since defined time)
{
"e":"get_my_funding_history",
"oid":"1465567380491_4_get_my_funding_history",
"data": {
"direction": "withdraw",
"dateFrom": 1676561116790,
"pageSize": 1,
"pageNumber": 1
}
}
Response (Prime Liquidity responds that Client has external withdrawal which has already been approved and was broadcasted to the blockchain)
{
"e":"get_my_funding_history",
"oid":"1465567380491_4_get_my_funding_history",
"ok": "ok",
"data": [
{
"clientId": "TestClient",
"accountId": "",
"currency": "BTC",
"direction": "withdraw",
"amount": "1.60000000",
"commissionAmount": "0.00000000",
"status": "approved",
"updatedAt": "2023-02-16T20:00:00.000Z",
"txId": 12345,
"details": {
"address": "00112233445566778899aabbccddeeffgg",
"blockchain": "bitcoin",
"blockchainTxId": "16112233445566778899aabbccddeeff00112233445566778899aabbccddeeff",
"externalWithdrawalStatus": "approved"
}
}
]
}
Get My Funding History - 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 (Prime Liquidity 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 an 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 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 and contains one of the allowed values, then it means Client wants to get only transactions related to specified operation type. Allowed values are: "deposit", "withdraw". If this field is missing or if this field is present but contains an empty string (""), then it means Client wants to get all deposits and withdrawals. |
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 than or equal to (>=) dateFrom. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateFrom should be less than the value in the field dateTo. |
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 than (<) dateTo. If the request contains values in both fields dateFrom and dateTo, then the value in the field dateTo should be greater than the value in the field dateFrom. |
pageSize | No | Number | Because the result might contain too many transactions, Client should specify, which portion of the result list he wants to get as a response to this request. This parameter limits the maximum number of transactions in the result for this request and cannot be greater than 100. If this field is missing, then the default value of 100 is used. If this field contains one of the allowed values and, simultaneously, the pageNumber field is missing, then the default pageNumber value is applied. Specifying the value in the field pageSize is mandatory if the value in the field pageNumber is also sent in the Client's request. |
pageNumber | No | Number | Because the result might contain too many transactions, Client should specify, which portion of the result list he wants 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 1. If this field is missing, then the default value of 1 is used. This value cannot be lower than 1. If any valid value is specified in this field, then it is mandatory to also send the value in the field pageSize in the Client’s request. |
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 an 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 field 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 | Datetime | Represents server timestamp when this transaction happened. Format: YYYY-MM-DDTHH:MM:SS.sssZ . |
details | Yes | Object | This object contains details of the external transactions, which satisfies request criteria. It might be empty object ({}). If this object is empty, then no additional details are available. |
details.blockchain | No | String | Blockchain name, via which requested cryptocurrency external withdrawal or deposit was initiated. |
details.address | No | String | Crypto address that will receive the funds. Please be informed that destination and memo fields are used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
details.destination | No | String | Destination address, that will receive the funds, used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
details.memo | No | String (or Integer for XRP cryptocurrency) | A special identifier used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM) of the transaction recepient. |
details.blockchainTxId | No | String | Unique identifier of the transaction in cryptocurrency network. This is optional field if transaction was already broadcasted to the cryptocurrency network. |
details.confirmations | No | Number | This field can only be present in case of external deposit, and indicates how many blocks have already passed since a transaction was added to the specific blockchain. For deposit transactions minimal confirmation number for transaction to be deposited to Client’s Prime Liquidity account can be received via get_processing_info request. |
details.externalWithdrawalStatus | No | String | Transaction status of funds withdrawal from Client’s CEX.IO account to the external crypto address. Allowed values: “rejected”, “pending”, “approved”. |
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 his sub-accounts or between his main account and sub-account. Prime Liquidity does not charge Client any commission for transferring funds between his accounts. Along with a response to this request, Prime Liquidity sends Account Event messages to Client if this request is successful.
REQUEST
do_my_internal_transfer
API Key Permission
This method requires “Funds Internal” permission set for API Key.
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",
"clientTxId": "12342134442"
}
}
Response (Prime Liquidity 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, Prime Liquidity 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",
"onHoldBalance": "0.00000000",
"timestamp": 1465557609146,
"action": "internalTransfer",
"id": 667
}
}
Response (Because successful internal transfer modifies Client’s "superhat" sub-account, Prime Liquidity 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",
"onHoldBalance": "0.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",
"clientTxId": "123"
}
}
Response (Prime Liquidity 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",
"onHoldBalance": "0.00000000",
"timestamp": 1465569413260,
"action": "internalTransfer",
"id": 672
}
}
Response (Prime Liquidity 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": 777
}
}
Response (Prime Liquidity 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",
"onHoldBalance": "0.00000000",
"timestamp": 1456839391786,
"action": "internalTransfer",
"id": 673
}
}
Do My Internal Transfer - Duplicate clientTxId
Request (Client requests to transfer 4 USD from sub-account "superhat" to sub-account "hallo" with clientTxId = "123" which was already used in the previous example to transfer 2 USD)
{
"e": "do_my_internal_transfer",
"oid": "1465572149539_1_do_my_internal_transfer",
"data": {
"fromAccountId": "superhat",
"toAccountId": "hallo",
"amount": "4",
"currency": "USD",
"clientTxId": "123"
}
}
Response (Prime Liquidity sends Account Event notification event before the response. "superhat" balance is already 18 USD after previous transfer)
{
"e": "account_update",
"ok": "ok",
"data": {
"clientId": "BitFok",
"accountId": "superhat",
"currency": "USD",
"balance": "18.00000000",
"onHoldBalance": "0.00000000",
"timestamp": 1465569413260,
"action": "internalTransfer",
"possibleResend": true,
"id": 672
}
}
Response (Prime Liquidity detects duplicate and funds are not transferred between accounts. Prime Liquidity responds to Client with transactionId of the successful transfer (first transfer with clientTxId = "123"))
{
"e": "do_my_internal_transfer",
"oid": "1465572149539_1_do_my_internal_transfer",
"ok": "ok",
"data": {
"transactionId": 777
}
}
Response (Prime Liquidity sends Account Event notification event before the response. "hallo" balance is already 2 USD)
{
"e": "account_update",
"ok": "ok",
"data": {
"clientId": "BitFok",
"accountId": "hallo",
"currency": "USD",
"balance": "2.00000000",
"onHoldBalance": "0.00000000",
"timestamp": 1456839391786,
"action": "internalTransfer",
"possibleResend": true,
"id": 673
}
}
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 (Prime Liquidity responds that Client has insufficient funds on his "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 (Prime Liquidity responds to Client that such request is not allowed and amount should be greater than zero)
{
"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 (Prime Liquidity responds to Client that such request is not allowed because mandatory parameter fromAccountId was not specified)
{
"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 values
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 (Prime Liquidity responds to Client that such request is not allowed and fromAccountId and toAccountId values should be different)
{
"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 - Invalid 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 (Prime Liquidity 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. |
clientTxId | No | String | Unique identifier of transfer specified by Client. If two (or more) transfers with the same clientTxId are received by the system - only first transfer will be processed, second and subsequent transfers will return transactionId of the first completed internal transfer for clientTxId. |
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 than zero. |
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. |
Currencies Info
Currencies Info method allows Client to receive the parameters for all currencies configured in Prime Liquidity as well as the deposit and withdrawal availability between Prime Liquidity and CEX.IO Wallet.
REQUEST
get_currencies_info
API Key Permission
This method requires “Read” permission set for API Key.
Currencies Info Request Parameters
Currencies Info request (No parameters indicated)
Request (Client sends the request without any parameters)
{
"e":"get_currencies_info",
"oid":"16760424783869_get_currencies_info",
"data": {}
}
Response (Prime Liquidity successfully responds to the request with information about all currencies configured in Prime Liquidity system)
{
"e":"get_currencies_info",
"oid":"16760424783869_get_currencies_info",
"ok": "ok",
"data": [
{
"currency": "USDT",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 8,
"walletPrecision": 6
},
{
"currency": "BTC",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 8,
"walletPrecision": 8
},
{
"currency": "SHIB",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 0,
"walletPrecision": 0
},
{
"currency": "LUNC",
"walletDeposit": false,
"walletWithdrawal": false,
"fiat": false,
"precision": 2,
"walletPrecision": null
},
{
"currency": "USD",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": true,
"precision": 8,
"walletPrecision": 2
}
]
}
Currencies Info request (Indicated 2 specific currencies)
Request (Client sends get currencies info request for 2 currencies)
{
"e":"get_currencies_info",
"oid":"16760436274869_get_currencies_info",
"data": {
"currencies": ["ETH", "USD"]
}
}
Response (Prime Liquidity responds to the request with information for indicated currencies)
{
"e": "get_currencies_info",
"oid": "16760436274869_get_currencies_info",
"ok": "ok",
"data": [
{
"currency": "ETH",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": false,
"precision": 8,
"walletPrecision": 6
},
{
"currency": "USD",
"walletDeposit": true,
"walletWithdrawal": true,
"fiat": true,
"precision": 8,
"walletPrecision": 2
}
]
}
Currencies Info request (Indicated unsupproted currency)
Request (Client sends get currencies info request with indicated unsupported currency)
{
"e": "get_currencies_info",
"oid": "16760492853069_get_currencies_info",
"data": {
"currencies": ["CCC"]
}
}
Response (Prime Liquidity responds to the request with empty array as requested currency is not supported)
{
"e": "get_currencies_info",
"oid": "16760492853069_get_currencies_info",
"ok": "ok",
"data": []
}
Get Currencies Info request (No currencies indicated)
Request (Client sends get currencies info request with indicated currencies parameter but without any specific currencies)
{
"e": "get_currencies_info",
"oid": "16890492853072_get_currencies_info",
"data": {
"currencies": []
}
}
Response (Prime Liquidity responds to the request with error message)
{
"e": "get_currencies_info",
"oid": "16890492853072_get_currencies_info",
"ok": "ok",
"data": {
"error": "Parameter currencies should be Array of Strings"
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_currencies_info" value is allowed here. |
oid | Yes | String | Unique ID of this request. |
data | Yes | Object | This object contains request details. |
currencies | No | Array of Strings | List of currencies for which Client wants to receive configuration parameters. Currencies should be indicated in upper case and of string type. The list should contain only valid currency symbols. If this field is present in the request, then at least 1 currency should be indicated in an array. If this field is absent, then it means Client requests configuration parameters for all currencies. |
Currencies Info Response Parameters
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_currencies_info" value is allowed here. |
oid | Yes | String | Unique ID of Client’s request, for which this message is in response to. |
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 response details. |
X | No | Object | Represents an object which describes specific currency configuration parameters in Prime Liquidity system. If there are no objects in returned array, then it means there are no currencies, which satisfy Client’s request criteria. |
X.currency | Yes | String | Currency name. |
X.walletDeposit | Yes | Boolean | Describes current availability to deposit currency X to Prime Liquidity from CEX.IO Wallet. Only true or false values are allowed herein. |
X.walletWithdrawal | Yes | Boolean | Describes current availability to withdraw currency X from Prime Liquidity to CEX.IO Wallet. Only true or false values are allowed herein. |
X.fiat | Yes | Boolean | Indicates if the currency is a fiat currency or cryptocurrency. If the value is true, then indicated currency is fiat. If the value is false, then indicated currency is cryptocurrency. |
X.precision | Yes | Number | Number of decimal places in amounts of specific currency used inside Prime Liquidity system (e.g. for internal transfers, executed amounts in orders etc.). |
X.walletPrecision | Yes | Number or null | If the value of this parameter is a number, then it describes the number of decimal places in amounts of specific currency used for transfers to or out of Prime Liquidity system (e.g. for deposits\withdrawals from\to CEX.IO Wallet or external addresses). If the value is null, then deposits and withdrawals of specific currency from\to CEX.IO Wallet are not available. |
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 Processing Info
This request allows Client to receive detailed information about available options to make deposits from external wallets and withdrawals to external wallets as to each supported cryptocurrency, including cryptocurrency name and available blockchains for deposit\withdrawals. Also, as to each supported blockchain there are indicated type of cryptocurrency on indicated blockchain, current deposit\withdrawal availability, minimum amounts for deposits\withdrawals, external withdrawal fees.
Processing Information makes Client more flexible in choosing desired blockchain for receiving Deposit address and initiating external withdrawals via certain blockchain, so that Client uses more convenient way of transferring his crypto assets to or from CEX.IO Ecosystem.
REQUEST
get_processing_info
API Key Permission
This method requires “Read” permission set for API Key.
Get Processing Info Request
Get Processing Info Request for one specific cryptocurrency
Request (Client queries processing info for "BTC")
{
"e": "get_processing_info",
"oid": "1521724219900_1_get_processing_info",
"data": {
"currencies": ["BTC"]
}
}
Response (Prime Liquidity responds that only 'bitcoin' blockchain is supported for deposits\withdrawals of "BTC")
{
"e": "get_processing_info",
"oid": "1521724219900_1_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005",
"depositConfirmations": 2
}
}
}
}
}
Get Processing Info Request for several cryptocurrencies
Request (Client queries processing info for "BTC" and "USDC")
{
"e": "get_processing_info",
"oid": "1521724219900_2_get_processing_info",
"data": {
"currencies": ["BTC","USDC"]
}
}
Response (Prime Liquidity responds that for deposits\withdrawals 'bitcoin' blockchain is supported for "BTC" and "ethereum", "stellar" and "tron" blockchains are supported for "USDC")
{
"e": "get_processing_info",
"oid": "1521724219900_2_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005",
"depositConfirmations": 2
}
}
},
"USDC": {
"name": "USD Coin",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "40",
"depositConfirmations": 25
},
"stellar": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1",
"depositConfirmations": 1
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1",
"depositConfirmations": 21
}
}
}
}
}
Get Processing Info Request for specific cryptocurrencies
Request (Client queries processing info for "BTC" and "USDT")
{
"e": "get_processing_info",
"oid": "1521724219900_3_get_processing_info",
"data": {
"currencies": ["BTC","USDT"]
}
}
Response (Prime Liquidity responds that for deposits\withdrawals 'bitcoin' blockchain is supported for "BTC", while "ethereum", "tron", "solana" and "binancesmartchain" blockchains are supported for "USDT")
Note that details of the response indicate that "solana" blockchain is supported for "USDT" but deposits and withdrawals via this blockchain are disabled at the moment
{
"e": "get_processing_info",
"oid": "1521724219900_3_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005",
"depositConfirmations": 2
}
}
},
"USDT": {
"name": "Tether",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "1",
"withdrawal": "enabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 25
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "1",
"withdrawal": "enabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 21
},
"solana": {
"type": "SPL",
"deposit": "disabled",
"minDeposit": "1",
"withdrawal": "disabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 1
},
"binancesmartchain": {
"type": "BEP20",
"deposit": "enabled",
"minDeposit": "1",
"withdrawal": "enabled",
"minWithdrawal": "1",
"withdrawalFee": "1",
"depositConfirmations": 25
}
}
}
}
}
Get Processing Info - No available blockchains
Request (Client queries processing info for supported cryptocurrency "ZEC")
{
"e": "get_processing_info",
"oid": "1521724219900_4_get_processing_info",
"data": {
"currencies": ["ZEC"]
}
}
Response (Prime Liquidity responds that request was processed successfully but no blockchains are supported for "ZEC")
{
"e": "get_processing_info",
"oid": "1521724219900_4_get_processing_info",
"ok": "ok",
"data": {}
}
Get Processing Info - Invalid and fiat cryptocurrency
Request (Client queries processing info for "BTC", "ETH", "XXX" and "USD")
{
"e": "get_processing_info",
"oid": "1521724219900_5_get_processing_info",
"data": {
"currencies": ["BTC", "ETH", "XXX", "USD"]
}
}
Response (Prime Liquidity responds that error occurred because unsupported currencies "XXX" and "USD" are indicated in the request)
{
"e": "get_processing_info",
"oid": "1521724219900_5_get_processing_info",
"data": {
"error": "Request contains unsupported currencies: XXX, USD."
}
}
Get Processing Info - Invalid value type in "currencies" array
Request (Client queries processing info with invalid values type in "currencies" field)
{
"e": "get_processing_info",
"oid": "1521724219900_6_get_processing_info",
"data": {
"currencies": [1,2,3]
}
}
Response (Prime Liquidity responds that error occurred because wrong type of value was indicated in "currencies" array and only string values are allowed)
{
"e": "get_processing_info",
"oid": "1521724219900_6_get_processing_info",
"data": {
"error": "Currencies array should consist of string type values."
}
}
Get Processing Info - Not an array indicated in "currencies" field
Request (Client queries processing info with indicating empty object ({}) in "currencies" field)
{
"e": "get_processing_info",
"oid": "1521724219900_7_get_processing_info",
"data": {
"currencies": {}
}
}
Response (Prime Liquidity responds that error occurred because only array is allowed in "currencies" field)
{
"e": "get_processing_info",
"oid": "1521724219900_7_get_processing_info",
"data": {
"error": "Currencies should be array."
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_processing_info" value is allowed here. |
oid | Yes | String | Unique ID of this request. |
currencies | No | Array | List of cryptocurrencies for which Client wants to get information about supported blockchains for deposit\withdraw, limits and commissions. Cryptocurrencies should be in upper case and of string type. The list should contain only valid cryptocurrency symbols. If this field is missing or contains an empty array ([]), then it means Client wants to get processing info for all available cryptocurrencies. |
Get Processing Info Response
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "get_processing_info" 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 response details with list of cryptocurrencies, available blockchains, blockchain limitations and external withdrawal fees. It can contain empty object ({}) if there are no available blockchains for cryptocurrencies requested by Client. |
data.YYY | Yes | String | Cryptocurrency symbol specified in Client's request. |
data.YYY.name | Yes | String | Cryptocurrency name. |
data.YYY.blockchains | Yes | Object | This object contains info about all supported blockchains to deposit\withdraw cryptocurrency YYY. |
data.YYY.blockchains.X | Yes | Object | This object contains details and limitations for deposit\withdrawal of cryptocurrency YYY via blockchain X, including data about blockchain type, current availability to deposit\withdraw, minimum deposit\withdrawal limit and external withdrawal fees. |
data.YYY.blockchains.X. type | Yes | String | Type of cryptocurrency YYY on blockchain X. |
data.YYY.blockchains.X. deposit | Yes | String | Describes current availability to deposit cryptocurrency YYY via blockchain X. Only "enabled" or "disabled" values are allowed herein. |
data.YYY.blockchains.X. minDeposit | Yes | String (which can be parsed as Float) | Minimum amount of cryptocurrency YYY which can be deposited from external wallet via blockchain X. |
data.YYY.blockchains.X. withdrawal | Yes | String | Describes current availability to withdraw cryptocurrency YYY via blockchain X. Only "enabled" or "disabled" values are allowed herein. |
data.YYY.blockchains.X. minWithdrawal | Yes | String (which can be parsed as Float) | Minimum amount of cryptocurrency YYY which can be withdrawn to external wallet via blockchain X by using do_withdrawal_funds request. |
data.YYY.blockchains.X. withdrawalFee | Yes | String (which can be parsed as Float) | Amount of withdrawal fee in cryptocurrency YYY, which which would be charged and subtracted from withdrawal amount if blockchain X is used for withdrawal. |
data.YYY.blockchains.X. depositConfirmations | Yes | Number | minimal confirmation number for transaction in the blockchain to be deposited to Client’s Prime Liquidity account. |
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
This method can be used by Client for receiving a crypto address to deposit cryptocurrency. Deposit address can be generated for main and sub-accounts.
REQUEST
get_deposit_address
API Key Permission
This method requires “Read” permission set for API Key.
Get Deposit Address Request
Get Deposit Address Request for main account to deposit "BTC" cryptocurrency via 1 available blockchain
Client sends get_processing_info request for receiving of all available blockchains to deposit BTC
{
"e": "get_processing_info",
"oid": "1521724219999_1_get_processing_info",
"data": {
"currencies": ["BTC"]
}
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC
{
"e": "get_processing_info",
"oid": "1521724219999_1_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries deposit address for BTC cryptocurrency on "bitcoin" blockchain)
{
"e": "get_deposit_address",
"oid": "1521724219900_1_get_deposit_address",
"data": {
"accountId": "", // main account
"currency": "BTC", // currency "BTC"
"blockchain": "bitcoin" // required blockchain
}
}
Response (Prime Liquidity responds with information about crypto address to deposit BTC via "bitcoin" blockchain)
{
"e": "get_deposit_address",
"oid": "1521724219900_1_get_deposit_address",
"ok": "ok",
"data": {
"accountId": "",
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
"currency": "BTC",
"blockchain": "bitcoin"
}
}
Get Deposit Address Request for main account to deposit "USDC" cryptocurrency via specific blockchain
Client sends get_processing_info request for receiving of all available blockchains to deposit USDC
{
"e": "get_processing_info",
"oid": "1521724219999_2_get_processing_info",
"data": {
"currencies": ["USDC"]
}
}
Prime Liquidity responds that there are 3 available blockchains to deposit USDC, namely "ethereum", "stellar" and "tron"
{
"e": "get_processing_info",
"oid": "1521724219999_2_get_processing_info",
"ok": "ok",
"data": {
"USDC": {
"name": "USD Coin",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "40"
},
"stellar": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "20"
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1"
}
}
}
}
}
Request (Client queries deposit address for sub-account "superhat" for USDC cryptocurrency to further deposit it via "tron" blockchain as most profitable for Client)
{
"e": "get_deposit_address",
"oid": "1521724219999_2_get_deposit_address",
"data": {
"accountId": "superhat", // subaccount "superhat"
"currency": "USDC", // currency "USDC"
"blockchain": "tron"
}
}
Response (Prime Liquidity responds with information about crypto address to deposit USDC via "tron" blockchain on "superhat" account)
{
"e": "get_deposit_address",
"oid": "1521724219999_2_get_deposit_address",
"ok": "ok",
"data": {
"accountId": "superhat",
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj",
"currency": "USDC",
"blockchain": "tron"
}
}
Get Deposit Address Request for main account to deposit "XRP" cryptocurrency
Client sends get_processing_info request for receiving of all available blockchains to deposit XRP
{
"e": "get_processing_info",
"oid": "1521724219999_3_get_processing_info",
"data": {
"currencies": ["XRP"]
}
}
Prime Liquidity responds that there is only 1 available blockchain to deposit XRP, namely "ripple"
{
"e": "get_processing_info",
"oid": "1521724219999_3_get_processing_info",
"ok": "ok",
"data": {
"XRP": {
"name": "Ripple",
"blockchains": {
"ripple": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0",
"withdrawal": "enabled",
"minWithdrawal": "0.3",
"withdrawalFee": "0.25"
}
}
}
}
}
Request (Client queries deposit address for sub-account "superhat" for XRP cryptocurrency to further deposit it via "ripple" blockchain)
{
"e": "get_deposit_address",
"oid": "1521724219933_3_get_deposit_address",
"data": {
"accountId": "superhat", // subaccount "superhat"
"currency": "XRP", // currency "XRP"
"blockchain": "ripple"
}
}
Response (Prime Liquidity responds with destination and memo to deposit XRP via "ripple" blockchain)
{
"e": "get_deposit_address",
"oid": "1521724219933_3_get_deposit_address",
"ok": "ok",
"data": {
"accountId": "superhat",
"destination": "rE1sdh25BJQ3qFwngiTBwaq3zPGGYcrjp1",
"memo": "65629",
"currency": "XRP",
"blockchain": "ripple"
}
}
Get Deposit Address - Unsupported currency
Request (Client queries deposit address)
{
"e": "get_deposit_address",
"oid": "1521724219999_4_get_deposit_address",
"data": {
"accountId": "",
"currency": "XXX",
"blockchain": "ethereum"
}
}
Response (Prime Liquidity responds that error occurred because unsupported currency is specified in the request)
{
"e": "get_deposit_address",
"oid": "1521724219999_4_get_deposit_address",
"data": {
"error": "Unsupported currency XXX"
}
}
Get Deposit Address - Unsupported blockchain
Request (Client queries deposit address)
{
"e": "get_deposit_address",
"oid": "1521724219999_5_get_deposit_address",
"data": {
"accountId": "",
"currency": "ETC",
"blockchain": "tezos"
}
}
Response (Prime Liquidity responds that error occurred because unsupported currency is specified in the request)
{
"e": "get_deposit_address",
"oid": "1521724219999_5_get_deposit_address",
"data": {
"error": "Blockchain is not supported."
}
}
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 ("") value in this field represents Client’s main account. |
currency | Yes | String | Cryptocurrency name, for which Client wants to get a deposit address. |
blockchain | Yes | String | Blockchain name, via which Client wants to make a deposit of requested currency. Available blockchains can be received via get_processing_info request. |
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. |
oid | Yes | String | Unique ID of this Client’s request, for which this message is in response to. |
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 response details with generated cryptocurrency address. |
data.accountId | Yes | String | Account identifier, to which Client wants to make a deposit. |
data.address | No | String | Crypto address for deposit. Please be informed that destination and memo fields are used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
data.destination | No | String | Destination address for deposit used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
data.memo | No | String | A special identifier used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
data.currency | Yes | String | Cryptocurrency name, for which deposit address is generated. |
data.blockchain | Yes | String | Blockchain name, via which requested cryptocurrency can be deposited via generated address. |
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. |
Funds Deposit from Wallet
Client can deposit funds from CEX.IO account to Prime Liquidity account.
The system avoids processing of multiple deposit requests with the same clientTxId. If multiple deposit requests with identical clientTxId are received - the system processes only the first deposit request and rejects the second and subsequent deposit requests with the same clientTxId.
REQUEST
do_deposit_funds_from_wallet
API Key Permission
This method requires “Funds Wallet” permission set for API Key.
Request Parameters
Funds Deposit Request from CEX.IO account to Prime Liquidity main account
Request (Client queries deposit of BTC to main account)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631100952225_deposit_from_wallet",
"data": {
"accountId": "",
"clientTxId": "tx-depositFromWallet-test-1631100952225",
"currency": "BTC",
"amount": "0.1"
}
}
Response (Prime Liquidity responds with information that transaction was approved)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631100952225_deposit_from_wallet",
"ok": "ok",
"data": {
"accountId": "",
"currency": "BTC",
"status": "approved"
}
}
Funds Deposit Request from CEX.IO account to Prime Liquidity sub-account
Request (Client queries deposit of XRP to sub-account)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631101631321_deposit_from_wallet",
"data": {
"accountId": "superhat",
"clientTxId": "depositFromWallet-test-1631101631321",
"currency": "XRP",
"amount": "500"
}
}
Response (Prime Liquidity responds with information that transaction is pending)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631101631321_deposit_from_wallet",
"ok": "ok",
"data": {
"accountId": "superhat",
"currency": "XRP",
"status": "pending"
}
}
Invalid Deposit Request (too low amount)
Request (Client queries deposit of invalid amount)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631101114709_deposit_from_wallet",
"data": {
"accountId": "",
"clientTxId": "depositFromWallet-test-1631101114709",
"currency": "BTC",
"amount": "0.00000002"
}
}
Response (Prime Liquidity responds that deposit was rejected due to low amount)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631101114709_deposit_from_wallet",
"data": {
"error": "Too low amount to deposit 0.00000002 BTC. Minimum amount 0.00100000 BTC"
}
}
Invalid Deposit Request (unsupported currency)
Request (Client queries deposit of unsupported currency)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631103998454_deposit_from_wallet",
"data": {
"accountId": "",
"clientTxId": "depositFromWallet-test-1631103998454",
"currency": "XXX",
"amount": "25"
}
}
Response (Prime Liquidity responds that deposit was rejected because currency is not supported)
{
"e": "do_deposit_funds_from_wallet",
"oid": "1631103998454_deposit_from_wallet",
"data": {
"error": "Unsupported currency XXX"
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "do_deposit_funds_from_wallet" 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, to which Client wants to deposit 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 deposit funds to the main account. |
currency | Yes | String | Cryptocurrency name. |
amount | Yes | Float (or String which can be parsed as Float) | Amount of the transaction. |
Response Content
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "do_deposit_funds_from_wallet" 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 initiated deposit funds. Empty string ("") value in this field represents Client’s main account. |
currency | Yes | String | Cryptocurrency name. |
status | Yes | String | Deposit transaction status. Allowed values - "rejected", "pending", "approved". |
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 to Wallet
Client can withdraw funds from Prime Liquidity account to CEX.IO account.
The system avoids multiple withdrawal requests with the same clientTxId. If multiple withdrawal requests with identical clientTxId are received - the system processes only the first withdrawal request and rejects the second and subsequent withdrawal requests with the same clientTxId.
REQUEST
do_withdrawal_funds_to_wallet
API Key Permission
This method requires “Funds Wallet” permission set for API Key.
Request Parameters
Funds Withdrawal Request from Prime Liquidity main account to CEX.IO account
Request (Client queries withdrawal of BTC from main account)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598254954_withdraw_to_wallet",
"data": {
"accountId": "",
"clientTxId": "withdrawToWallet-test-1630598254954",
"currency": "BTC",
"amount": "0.1"
}
}
Response (Prime Liquidity responds with information that transaction was approved)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598254954_withdraw_to_wallet",
"ok": "ok",
"data": {
"clientTxId": "withdrawToWallet-test-1630598254954",
"currency": "BTC",
"status": "approved"
}
}
Funds Withdrawal Request from Prime Liquidity sub-account to CEX.IO account
Request (Client queries withdrawal of XRP from sub-account)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598290977_withdraw_to_wallet",
"data": {
"accountId": "superhat",
"clientTxId": "withdrawToWallet-test-1630598290977",
"currency": "XRP",
"amount": "200"
}
}
Response (Prime Liquidity responds with information that transaction is pending)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598290977_withdraw_to_wallet",
"ok": "ok",
"data": {
"clientTxId": "withdrawToWallet-test-1630598290977",
"currency": "XRP",
"status": "pending"
}
}
Invalid Withdrawal Request (too low amount)
Request (Client queries withdrawal of invalid amount)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598297863_withdraw_to_wallet",
"data": {
"accountId": "",
"clientTxId": "withdrawToWallet-test-1630598297863",
"currency": "BTC",
"amount": "0.00000002"
}
}
Response (Prime Liquidity responds that withdrawal was rejected due to low amount)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598297863_withdraw_to_wallet",
"data": {
"error": "Too low amount to withdraw 0.00000002 BTC. Minimum amount 0.00100000 BTC"
}
}
Invalid Withdrawal Request (unsupported currency)
Request (Client queries withdrawal of unsupported currency)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598290954_withdraw_to_wallet",
"data": {
"accountId": "",
"clientTxId": "withdrawToWallet-test-1630598290954",
"currency": "XXX",
"amount": "10"
}
}
Response (Prime Liquidity responds that withdrawal was rejected because currency is not supported)
{
"e": "do_withdrawal_funds_to_wallet",
"oid": "1630598290954_withdraw_to_wallet",
"data": {
"error": "Unsupported currency XXX"
}
}
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "do_withdrawal_funds_to_wallet" 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. |
Response Content
Field Name | Mandatory | Format | Description |
---|---|---|---|
e | Yes | String | Describes the type of this message. Only "do_withdrawal_funds_to_wallet" 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. |
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 Prime Liquidity account to external crypto address.
Here is the list of errors, which indicate that the withdrawal request was rejected.
Error description |
---|
Withdrawal is temporary unavailable |
Withdrawal destination is not whitelisted |
Invalid address |
Mandatory parameter X is missing |
Memo parameter must be numeric for ATOM |
Insufficient funds on Client Main_ USDT account. |
Requested amount: 0.00000001 is less than allowed. Minimum: 0.01 |
ExternalTransfer fundingId=12245 clientFundingId=1223372036854775807 already exists but has different parameters |
Amount precision should not be greater than 6 |
Blockchain is not supported |
REQUEST
do_withdrawal_funds
API Key Permission
This method requires “Funds External” permission set for API Key.
Funds Withdrawal Request
Funds Withdrawal Request from main account (BTC)
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
{
"e": "get_processing_info",
"oid": "1521724219999_1_get_processing_info",
"data": {
"currencies": ["BTC"]
}
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals
{
"e": "get_processing_info",
"oid": "1521724219999_1_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries BTC withdrawal to the crypto address via "bitcoin" blockchain)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_1_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "29.87",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_1_do_withdrawal_funds",
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "BTC",
"status": "pending",
"instrument": "crypto",
"blockchain": "bitcoin"
}
}
Funds Withdrawal Request from main account (USDC)
Client sends get_processing_info request for receiving of all available blockchains to withdraw USDC
{
"e": "get_processing_info",
"oid": "1521724219999_2_get_processing_info",
"data": {
"currencies": ["USDC"]
}
}
Prime Liquidity responds with processing info with 3 available blockchains for USDC withdrawals, namely "ethereum", "stellar" and "tron"
{
"e": "get_processing_info",
"oid": "1521724219999_2_get_processing_info",
"ok": "ok",
"data": {
"USDC": {
"name": "USD Coin",
"blockchains": {
"ethereum": {
"type": "ERC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "40"
},
"stellar": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "20"
},
"tron": {
"type": "TRC20",
"deposit": "enabled",
"minDeposit": "5",
"withdrawal": "enabled",
"minWithdrawal": "50",
"withdrawalFee": "1"
}
}
}
}
}
Request (Client queries USDC withdrawal to the crypto address via "tron" blockchain)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_2_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "USDC",
"amount": "200.87",
"instrument": "crypto",
"blockchain": "tron",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_2_do_withdrawal_funds",
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "USDC",
"status": "pending",
"instrument": "crypto",
"blockchain": "tron"
}
}
Funds Withdrawal Request from Client’s sub-account (XRP)
Client sends get_processing_info request for receiving of all available blockchains to withdraw XRP
{
"e": "get_processing_info",
"oid": "1521724219999_3_get_processing_info",
"data": {
"currencies": ["XRP"]
}
}
Prime Liquidity responds with processing info and only 1 available blockchain "ripple" for XRP withdrawals
{
"e": "get_processing_info",
"oid": "1521724219999_3_get_processing_info",
"ok": "ok",
"data": {
"XRP": {
"name": "Ripple",
"blockchains": {
"ripple": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0",
"withdrawal": "enabled",
"minWithdrawal": "0.3",
"withdrawalFee": "0.25"
}
}
}
}
}
Request (Client queries withdrawal with destination and memo parameters (memo parameter for XRP must be of type integer))
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_3_do_withdrawal_funds",
"data": {
"accountId": "superhat",
"clientTxId": "1223372036854775807",
"currency": "XRP",
"amount": "29.87",
"instrument": "crypto",
"blockchain": "ripple",
"parameters": {
"destination": "rLHzPsX6oXkzU2qL12kHCH8G8cnZv1rBJh",
"memo": 1318266718
}
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_3_do_withdrawal_funds",
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "XRP",
"status": "pending",
"instrument": "crypto",
"blockchain": "ripple"
}
}
Funds Withdrawal Request - Too low amount
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
json { "e": "get_processing_info", "oid": "1521724219999_4_get_processing_info", "data": { "currencies": ["BTC"] } }
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals and 0.002 BTC as minWithdrawal amount
{
"e": "get_processing_info",
"oid": "1521724219999_4_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries withdrawal of 0.0005 BTC to the crypto address via blockchain "bitcoin")
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_4_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "0.0005",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because Client indicated withdrawal amount which is less than minWithdrawal amount)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_4_do_withdrawal_funds",
"data": {
"error": "Requested amount: 0.00050000 is less than allowed. Minimum: 0.00200000"
}
}
Funds Withdrawal Request - Invalid address
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
{
"e": "get_processing_info",
"oid": "1521724219999_5_get_processing_info",
"data": {
"currencies": ["BTC"]
}
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals
{
"e": "get_processing_info",
"oid": "1521724219999_5_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries withdrawal of BTC to invalid crypto address)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_5_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "0.1",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "SomeInvalidAddress"
}
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because Client indicated invalid address)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_5_do_withdrawal_funds",
"data": {
"error": "Invalid address"
}
}
Funds Withdrawal Request - Unsupported blockchain
Client sends get_processing_info request for receiving of all available blockchains to withdraw BTC
{
"e": "get_processing_info",
"oid": "1521724219999_6_get_processing_info",
"data": {
"currencies": ["BTC"]
}
}
Prime Liquidity responds with processing info with only one available "bitcoin" blockchain for BTC withdrawals
{
"e": "get_processing_info",
"oid": "1521724219999_6_get_processing_info",
"ok": "ok",
"data": {
"BTC": {
"name": "Bitcoin",
"blockchains": {
"bitcoin": {
"type": "coin",
"deposit": "enabled",
"minDeposit": "0.0001",
"withdrawal": "enabled",
"minWithdrawal": "0.002",
"withdrawalFee": "0.0005"
}
}
}
}
}
Request (Client queries withdrawal of BTC via invalid blockchain)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_6_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "0.1",
"instrument": "crypto",
"blockchain": "ethereum",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because Client indicated unsupported blockchain)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_6_do_withdrawal_funds",
"data": {
"error": "Blockchain is not supported."
}
}
Funds Withdrawal Request - Duplicated clientTxId transaction with different parameters
Request (Client queries withdrawal to the crypto address via blockchain "bitcoin")
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_7_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "1.87",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
}
Response (Prime Liquidity responds with information about withdrawal transaction)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_7_do_withdrawal_funds",
"ok": "ok",
"data": {
"clientTxId": "1223372036854775807",
"currency": "BTC",
"status": "pending",
"instrument": "crypto",
"blockchain": "bitcoin"
}
}
Request (Client queries withdrawal transaction with the same clientTxId but with other amount)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_8_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "0.993",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
}
Response (Prime Liquidity responds that transaction with the same clientTxId has been already processed and had other parameters)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_8_do_withdrawal_funds",
"data": {
"error": "ExternalTransfer fundingId=12245 clientFundingId=1223372036854775807 already exists but has different parameters"
}
}
Funds Withdrawal Request - Insufficient funds
Request (Client queries withdrawal to the crypto address via blockchain "bitcoin")
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_9_do_withdrawal_funds",
"data": {
"accountId": "",
"clientTxId": "1223372036854775807",
"currency": "BTC",
"amount": "30.12",
"instrument": "crypto",
"blockchain": "bitcoin",
"parameters": {
"address": "n2saq73aDTu42bRgEHd8gd4to1gCzHxrdj"
}
}
}
Response (Prime Liquidity responds that withdrawal transaction is not created because of insufficient funds)
{
"e": "do_withdrawal_funds",
"oid": "1521724219999_9_do_withdrawal_funds",
"data": {
"error": "Insufficient funds"
}
}
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. |
blockchain | Yes | String | Blockchain name, via which Client wants to make an external withdrawal of requested currency. Available blockchains can be received via get_processing_info request. |
parameters. address | No | String | Crypto address for withdrawal. Please be informed that destination and memo fields are used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
parameters. destination | No | String | Destination address for withdrawal used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
parameters. memo | No | String (or Integer for XRP cryptocurrency) | A special identifier for withdrawal used for ledger cryptocurrencies (e.g. 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. |
oid | Yes | String | Unique ID of this Client’s request, for which this message is in response to. |
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. |
blockchain | Yes | String | Blockchain name, via which requested cryptocurrency external withdrawal was initiated. |
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. |
Withdrawal Status
This request allows Client to find out information about cryptocurrency withdrawal.
REQUEST
get_withdrawal_status
API Key Permission
This method requires “Read” permission set for API Key.
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",
"blockchain": "ripple",
"currency": "XRP"
}
}
Response (Prime Liquidity 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",
"blockchain": "bitcoin",
"currency": "BTC"
}
}
Response (Prime Liquidity 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",
"blockchain": "ripple",
"currency": "XRP"
}
}
Response (Prime Liquidity 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 - Withdrawal transaction that is sent to CEX.IO account (BTC)
Request (Client queries status of the withdrawal transaction)
{
"e": "get_withdrawal_status",
"oid": "1631203639778_1_get_withdrawal_status",
"data": {
"clientTxId": "withdraw-test-1631203639778",
"instrument": "cexWallet",
"currency": "BTC"
}
}
Response (Prime Liquidity responds with status of the withdrawal transaction. Overall transaction status is "approved". The withdrawn amount should already be available on CEX.IO account)
{
"e": "get_withdrawal_status",
"oid": "1631203639778_1_get_withdrawal_status",
"ok": "ok",
"data": {
"currency": "BTC",
"instrument": "cexWallet",
"clientTxId": "withdraw-test-1631203639778",
"requestedAmount": "0.00100000",
"commissionAmount": "0.00000000",
"status": "approved",
"cexWalletTx": {
"status": "approved",
"amount": "0.00100000",
"commissionAmount": "0.00000000"
}
}
}
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",
"blockchain": "cosmos",
"currency": "ATOM"
}
}
Response (Prime Liquidity 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",
"blockchain": "bitcoin",
"currency": "BTC"
}
}
Response (Prime Liquidity 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. Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain. Instrument "cexWallet" means that withdrawal should be done to CEX.IO account. Allowed values - "crypto", "cexWallet". |
currency | Yes | String | Cryptocurrency name. |
blockchain | No | String | Blockchain name, via which Client initiated withdrawal transaction of currency. This parameter is mandatory if instrument "crypto" is specified in the request. |
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. Instrument "crypto" means that withdrawal should be done to the crypto address via blockchain. Instrument "cexWallet" means that withdrawal should be done to CEX.IO account. Allowed values - "crypto", "cexWallet". |
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 Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity to Client’s CEX.IO account. |
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 (e.g. XRP, XLM, ATOM). |
externalTx. destination | No | String | Destination address, that will receive the funds, used for ledger cryptocurrencies (e.g. XRP, XLM, ATOM). |
externalTx.memo | No | String | A special identifier used for ledger cryptocurrencies (e.g. 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 Prime Liquidity 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 Prime Liquidity 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.
- There is a field MDEntryID(278) in MDEntries(268) repeating group in Market Data Snapshot/Full Refresh (W) message. If Client prefers not to use this non-standard field then Prime Liquidity may omit this field. See details in Market Data section below (Market Data Snapshot/Full Refresh (W) message).
Session Level messages and connection:
- Prime Liquidity has preliminary created FIX sessions for each Client, which remains active for a long time (might be weeks or months, depending on terms).
- Prime Liquidity is waiting for Client's connection, so that in terms of FIX, Client is Initiator and Prime Liquidity is Acceptor.
- 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.
- Client and Prime Liquidity periodically send each other Heartbeat(0) messages. Prime Liquidity expects Heartbeat(0) message every 30 seconds.
- Client should send Logon(A) message as a first message after connection.
- Either Client or Prime Liquidity can request resetting sequence numbers in Logon(A) message specifying ResetSeqNumFlag(141) flag. Client should mandatory indicate ResetSeqNumFlag (141) with default value “Y“ (Yes) at any Logon(A) message, including every re-login.
- Either Client or Prime Liquidity 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.
- In Logon(A) message Client should specify Username(553) and Password(554) fields.
- Connection is SSL encrypted. Prime Liquidity expects an SSL connection over TCP to the hostname or IP address and TCP port number Client is assigned.
Application Level messages:
- Each message from Client should contain SenderCompID(49) - Client identifier and TargetCompID(56) - Prime Liquidity identifier. As a SenderCompID(49) Client should indicate his specific FIX Credentials Session Name. As a TargetCompID(56) only PROD_AGGREGATOR value should be indicated as a Prime Liquidity identifier.
- 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).
- Client can include additional fields in all messages which are not required by Prime Liquidity and which are not restricted by FIX 4.4 requirements, however Prime Liquidity will ignore such fields.
- Prime Liquidity 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.
- In case of an error on Prime Liquidity side, Prime Liquidity 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.
- Sequence number in this session is not automatically reset on each connection. However, either Prime Liquidity or Client can request resetting sequence numbers in Logon(A) message at logon time by setting ResetSeqNumFlag(141) flag. Client should mandatory indicate ResetSeqNumFlag (141) with default value “Y“ (Yes) at any Logon(A) message, including every re-login.
- If either Prime Liquidity 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.
- Sequence number in this session is automatically reset on each connection. However, either Prime Liquidity or Client can additionally request resetting sequence numbers in Logon(A) message at logon time by setting ResetSeqNumFlag(141) flag. Client should mandatory indicate ResetSeqNumFlag (141) with default value “Y“ (Yes) at any Logon(A) message, including every re-login.
- If Prime Liquidity receives Logon(A) message from Client it automatically cancels all Client’s active market data subscriptions.
- If either Prime Liquidity or Client terminates session by sending Logout(5) message, it automatically cancels all Client’s active market data subscriptions.
- If Prime Liquidity 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 Prime Liquidity can create more sessions.
Order Creation
Client can place order by sending New Order Single (D) message in TRD session to Prime Liquidity.
When sending a request for new order, it is highly recommended to use Client Order ID parameter (ClOrdID) that corresponds to the specific new order request on the client’s side. If the Client did not receive an execution report for such order - the Client can request current status of the order by using Order Status Request (H) with Client Order ID parameter or retry new order request with the same ClOrdId.
Prime Liquidity avoids multiple placing the orders with the same Client Order ID. If more than one new orders with identical Client Order ID are identified - Prime Liquidity processes only the first order, all subsequent requests with duplicate Client Order ID will not be executed.
Tag | Name | Description |
---|---|---|
35 | MsgType | Must be "D" (New Order Single) |
1 | Account | Optional. Any string, instructs Prime Liquidity which Client’s Sub account to use. Prime Liquidity will use Client's main account if this field is missing. |
11 | ClOrdID | Unique ID of the order assigned by Client |
55 | Symbol | Tradeable 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. By default, TransactTime should be within 30000 ms timeframe with server time, otherwise, order will be rejected with the corresponding error. Please be informed that default timeframe value 30000 ms can be changed for the Client by request. 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 Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity. 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 Prime Liquidity 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) |
6 | Good Till Date (GTD) |
Order Execution
Prime Liquidity 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:
- Confirm the receipt of an order.
- Confirm changes to an existing order (i.e. accept cancel request).
- Relay order status information.
- Relay fill information on open orders.
- Confirm order rejection.
Tag | Name | Description |
---|---|---|
35 | MsgType | Must be "8" (Execution Report). |
37 | OrderID | Unique order identifier assigned by Prime Liquidity. OrderID(37) field could contain "NONE value when OrdRejReason(103) is Unknown Order(5) or when order is rejected due to validation errors: failed minOrderAmountCcy, maxOrderAmountCcy, lotSizeCcy, max active orders checks. |
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 in 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 Prime Liquidity 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 Prime Liquidity. |
55 | Symbol | Tradeable 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 Prime Liquidity 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 Prime Liquidity, however Prime Liquidity hasn’t completed (or started) amount holding procedure and placing procedure yet. |
C | Expired | It means that ExpireTime(126) moment has come and Prime Liquidity has cancelled the order. |
8 | Rejected | It means that Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity, however Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity, however Prime Liquidity 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 Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity 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. Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity 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, Prime Liquidity shows the current state of the processing order. |
New order with PossResend
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity 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. Prime Liquidity 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 Prime Liquidity received this message for the first time. So, Prime Liquidity processes and places this order like a new order. |
Stop Limit Order - triggering and successful placing
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity notifies Client that it received the order. Also, this message means that Prime Liquidity has successfully locked enough funds from Client’s account to start processing this order as a Limit order when market price reaches indicated stopPx price. |
3 | Assume some time has passed and the market price falls to level 200. |
4 | Prime Liquidity notifies Client that his StopLimit order becomes SELL Limit 250 order because market price reached requested level 200. |
Stop Limit Order - rejected creation
Seq id | Client msg | Prime Liquidity 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 | Rejected | Rejected | 250 | 200 | 0 | 100 | 0 | 100 | 0 |
Comments for the above example
Seq id | Comment |
---|---|
1 | SELL Stop 100 BTC for 250 price when the market price surpasses 200 price level. |
2 | Prime Liquidity notifies Client that his order is rejected because of insufficient balance - Client has less than 100 BTC on his BTC account. |
Order with EffectiveTime - triggering and successful placing
Seq id | Client Message | Prime Liquidity 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 | Prime Liquidity notifies Client that it received the order, however Prime Liquidity hasn’t start holding amount procedure yet, and will start it once EffectiveTime moment comes. |
3 | Assume some time has passed and EffectiveTime moment came. |
4 | Prime Liquidity notifies Client that his order is placed (order becomes valid) because EffectiveTime moment has come. Also, this message means that Prime Liquidity has successfully held enough money from Client’s account to start processing this order. |
Order with EffectiveTime - triggering and not successful placing
Seq id | Client Message | Prime Liquidity 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 | Prime Liquidity notifies Client that it received the order, however Prime Liquidity hasn’t start holding amount procedure yet, and will start it once EffectiveTime moment comes. |
3 | Assume some time has passed and EffectiveTime moment came. |
4 | Prime Liquidity 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 Prime Liquidity. Prime Liquidity 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 Prime Liquidity. 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 Prime Liquidity will use OrderID(37) and will ignore OrigClOrdID(41) value. |
37 | OrderID | Unique ID of the order (assigned by Prime Liquidity) 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 Prime Liquidity will use OrderID(37) and will ignore OrigClOrdID(41) value. |
55 | Symbol | Tradeable symbol or currency pair. For example, "BTC/USD". This field is required by FIX 4.4 specification but for now Prime Liquidity 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 Prime Liquidity 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), Prime Liquidity 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 Prime Liquidity), 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 Prime Liquidity. |
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 Prime Liquidity.
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. Tradeable 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 Prime Liquidity). |
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 Prime Liquidity 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. Tradeable 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 | Prime Liquidity 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 | Prime Liquidity placed the order. |
3 | Client requests to cancel the order. |
4 | Prime Liquidity confirms to Client that cancellation request is received and cancellation procedure is started. |
5 | Prime Liquidity confirms to Client that order is canceled. |
Cancellation of placed order
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity reports to Client that order is placed. |
4 | Prime Liquidity confirms to Client that cancellation request is received and cancellation procedure is started. |
5 | Prime Liquidity confirms to Client that order is canceled. |
Cancellation of non-placed order
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity confirms to Client that cancellation request is received and cancellation procedure is started. |
4 | Prime Liquidity reports to Client that order is placed. Order was placed before the cancellation request is processed. |
5 | Prime Liquidity confirms to Client that order is canceled. |
Cancellation of partially-filled order
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity confirms to Client that cancellation request is received and cancellation procedure is started. Also, Prime Liquidity 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 | Prime Liquidity 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, Prime Liquidity shows the current state of the processing order. |
Cancellation of filled order
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity reports to Client that cancellation attempt was not successful, because the order is already filled. |
Cancelling of non-existing order
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity placed the order. |
3 | Client requests to cancel the order which does not exists. |
4 | Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity placed the order. |
3 | Client requests to cancel the order. |
4 | Prime Liquidity confirms to Client that cancellation request is received and cancellation procedure is started. |
5 | Another request from Client to cancel the same order. |
6 | Prime Liquidity reports to Client that order is already being cancelled. |
Cancelling the order which is already being cancelled
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity placed the order. |
3 | SELL Limit 100 BTC at price 300. |
4 | Prime Liquidity placed the order. |
5 | Client requests to cancel all orders. |
6 | Prime Liquidity confirms to Client that OrderMassCancelRequest is received by sending a Report message. |
7 | Prime Liquidity confirms to Client that cancellation request is received and cancellation procedure is started. |
8 | Prime Liquidity 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 | Prime Liquidity confirms to Client that order is canceled. |
Order Expiration
Seq id | Client msg | Prime Liquidity 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 fills ExpireTime(126) field, which means Client wants this order to be cancelled after this moment if order is not in final state. |
2 | Prime Liquidity reports to Client that order is placed. |
3 | Order remains open and ExpireTime moment has come. Client expects Prime Liquidity to automatically start expiration procedure for this order. |
4 | Prime Liquidity notifies Client that expire time has come and expiration procedure is started. Also, Prime Liquidity reports the moment when expiration procedure was started, which usually happens few seconds after ExpireTime. Similar to Cancel Request, Prime Liquidity reports ClOrdId as text in format "EXPIRED_AT_"+expirationTime. |
5 | Prime Liquidity confirms to Client that order is expired. Also, Prime Liquidity 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 Prime Liquidity in TRD session:
- Order Status Request (H) to find out the status of one order.
- Order Mass Status Request (AF) to find out the statuses of all active orders matching criteria specified by Client.
In response to such requests, Prime Liquidity 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 Prime Liquidity. If OrderID(37) field is present, then Prime Liquidity will use OrderID(37) and will ignore ClOrdID(11) value. |
55 | Symbol | Tradeable symbol or currency pair. For example, "BTC/USD". This field is required by FIX 4.4 specification, but for now Prime Liquidity 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 Prime Liquidity 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, Prime Liquidity returns orders matching this field. |
55 | Symbol | Optional. Tradeable symbol or currency pair. For example, "BTC/USD". If this field is present, Prime Liquidity returns orders matching this field. |
54 | Side | Optional. Must be 1 to buy or 2 to sell. If this field is present, Prime Liquidity returns orders matching this field. |
Order Monitoring Examples
Requesting status of executing order
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity placed the order. |
3 | Client requests order status. |
4 | Prime Liquidity responds to Client’s status request and shows current order status. |
5 | Trade happened. Partial execution 20 BTC. |
6 | Client requests order status. |
7 | Prime Liquidity responds to Client’s status request and shows current order status. |
8 | Trade happened. Full execution 80 BTC. |
9 | Client requests order status. |
10 | Prime Liquidity responds to Client’s status request and shows current actual order status. |
Requesting status of non-existing order
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity placed the order. |
3 | Client requests status of the order which does not exist. |
4 | Prime Liquidity responds to Client’s status request and shows that such order does not exist. |
Requesting mass status with criteria
Seq id | Client msg | Prime Liquidity 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 | Prime Liquidity placed the order 14. |
3 | BUY Limit 100 BTC using "cowboy" account. |
4 | Partial execution for order 14. |
5 | Prime Liquidity rejects order 15 because of insufficient USD balance on "cowboy" account. |
6 | SELL Limit 150 BTC using "cowboy" account. |
7 | Prime Liquidity 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 | Prime Liquidity 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 | Prime Liquidity placed the order 14. |
3 | BUY Limit 100 BTC using "cowboy" account. |
4 | Prime Liquidity rejects order 15 because of insufficient USD balance on "cowboy" account. |
5 | SELL Limit 150 BTC using "cowboy" account. |
6 | Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity. 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 his orders. See “Order Commission” section for more details. If Client creates market data subscription, then Prime Liquidity 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 Prime Liquidity), 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.
Prime Liquidity 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's 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 Prime Liquidity to Client every minute to minimize risk of incorrect applying of incremental refresh on Client's side.
Duplicate subscriptions.
The expected Client’s behavior regarding MD subscriptions is:
- Client should know all MDReqIDs of all his active subscriptions.
- Before new subscription creation Client should ensure than it’s MDReqID is unique among currently active subscriptions.
- Client can reinitialize existing subscription and trigger Market Data - Snapshot/Full Refresh(W) message from Prime Liquidity by making a subscription request with the exactly same parameters as the existing subscription.
- 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.
- If Client wants to create new subscription which overlaps with existing subscriptions then Client should cancel such existing subscriptions first.
- 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.
- 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.
It's recommended to reinitialize MD FIX session (do logout and login) in case of any inconsistencies on Client's 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.
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, Prime Liquidity 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 Prime Liquidity 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 Prime Liquidity. Prime Liquidity 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 Prime Liquidity. Prime Liquidity 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 Prime Liquidity would reject this request and provide Client with ID of such subscription. If SubscriptionRequestType(263) is Unsubscribe(2) then MDEntryType is ignored by Prime Liquidity. Prime Liquidity 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. Tradeable 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 Prime Liquidity sends Market Data Snapshot (W) message to Client on each market data change event. |
1 | Incremental Refresh | It means that Prime Liquidity 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. |
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 | Tradeable 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 Prime Liquidity 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. |
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. Tradeable 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. |
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 he 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 Prime Liquidity 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, Prime Liquidity 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 |
Prime Liquidity shows 2 best Offers and 2 best Bids which are observed currently on the market. So, Prime Liquidity 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 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 |
Prime Liquidity sends initial snapshot (W) with 2 best Bids which are currently observed on the market.
Then market data changed:
- bid at price level 345.2517 is no longer available.
- bid at price 344.0000 should be added to the book on the Client's side because it became second bid value from the top of the book.
Then market data changed:
- available bid BTC amount decreases at price level 345.2412.
- bid at price level 344.0000 is no longer available.
- 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 Prime Liquidity. Prime Liquidity 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 |
Prime Liquidity cancels MdSubscription with MDReqID = 3134 and stops sending market data updates to Client upon 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 Prime Liquidity. 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 |
Prime Liquidity 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 Prime Liquidity 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 |
Prime Liquidity sends initial snapshot (W) with 2 best Bids which are currently observed on the market.
Then market data changed:
- bid at price level 345.2517 is no longer available.
- bid at price 344.0000 added to snapshot because it became second bid value from the top of the book.
Then market data changed:
- 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 |
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 |
Prime Liquidity 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 |
Market Data Request (V) | 313 | Snapshot | BTC/USD | 1 | 2 | 2 | Offer |
Prime Liquidity will reinitialize subscription with MDReqID = 313 (Depth=10) and continue sending updates for subscription with MDReqID = 313 (Depth=10).