Introduction
The Crypto Facilities platform provides a number of Application Programming Interfaces (APIs) through HTTP and Websockets (WS).
The HTTP API provides secure access to your Crypto Facilities account to perform actions such as:
- request current or historical price information
- check your account balance and PnL
- your margin parameters and estimated liquidation thresholds
- place or cancel orders (individually or in batch)
- see your open orders
- open positions or trade history
- request a digital asset withdrawal
These "endpoints" are explained in the HTTP API section.
The WebSocket API provides real-time data channels to the Crypto Facilities platform which eliminates the need to periodically send requests for frequently changing information. The WebSocket API section explains how to create "subscriptions" to these data channels.
Some of the endpoints allow performing sensitive tasks, such as initiating a digital asset withdrawal. To access these endpoints securely, the API uses encryption techniques developed by the National Security Agency. This section describes how to encrypt your communication with the API when accessing these endpoints.
The API can be implemented using any programming language you like (e.g. C, C++, Java or PHP), as long as it is capable of managing HTTP requests. We strongly suggest you look at the code examples listed in sample implementations.
Conventions and definitions
Server Time
The server time is in Coordinated Universal Time (UTC).
Unique Identifiers
Unique Identifier Example
c18f0c17-9971-40e6-8e5b-10df05d422f0
The system constructs unique identifiers according to the Universally Unique Identifier standard.
Dates and Times
Dates and Times Examples
2016-02-26T12:09:38.830Z
2016-02-26T12:09:38Z
The API requires dates and time arguments in the ISO8601 datetime format and returns all dates and times in the same format.
The syntax of this format is <yyyy>-<mm>-<dd>T<HH>:<MM>:<SS>.<sss>Z where <yyyy> is the year, <mm> is the month, <dd> is the day, <HH> is the hour, <MM> is the minute, <SS> is the second and <sss> is the millisecond.
When provided as an argument, <sss> is optional.
Z denotes that the datetime is in UTC.
Symbols
The system identifies cash accounts, margin accounts, futures contracts and indices through ticker symbols. Please refer to the platform documentation for details on the ticker symbol syntax. The following shows some sample ticker symbols.
| Example Symbols | Description |
|---|---|
xbt |
Bitcoin |
xrp |
Ripple XRP |
fi_xbtusd |
Bitcoin-Dollar Futures Margin Account |
fi_xrpusd |
Ripple-Dollar Futures Margin Account |
fi_xbtusd_180615 |
Bitcoin-Dollar Futures, maturing at 16:00 London time on 15 June 2018 |
fi_xrpusd_180615 |
Ripple-Dollar Futures, maturing at 16:00 London time on 15 June 2018 |
fi_xrpxbt_180615 |
Ripple-Bitcoin Futures, maturing at 16:00 London time on 15 June 2018 |
in_xbtusd |
Bitcoin-Dollar Real-Time Index |
rr_xbtusd |
Bitcoin-Dollar Reference Rate |
in_xrpusd |
Ripple-Dollar Real-Time Index |
Order of Arguments
Example
When calling the tickers endpoint, the structure for
rr_xbtusdwill not contain the keyssuspended,lastSize,vol24h,bid,bidSize,ask,askSizeandmarkPrice. This is becauserr_xbtusdis an index such that these keys do not apply.
{
"symbol": "rr_xbtusd",
"last": 4225,
"lastTime": "2016-02-25T11:05:21.000Z",
"open24h": 4179,
"high24h": 4264,
"low24h": 4177
}
When calling endpoints with required arguments, all arguments must be provided in the order they are listed (see section HTTP API resources).
Generate API keys
Your
api_key(Public key) example:
rRra59qKQs3y1egAgSaG0RJlBcbq97wTUXSxXxPdhRZdv7z9ijZRWgrf
Your
api_secret(Private key) example:
rttp4AzwRfYEdQ7R7X8Z/04Y4TZPa97pqCypi3xXxAqftygftnI6H9yGV+OcUOOJeFtZkr8mVwbAndU3Kz4Q+eG
In order to use the API, you need to generate a pair of unique API keys:
Limits
Up to 50 keys can be created with distinct nonces.
API Testing Environment
To allow clients to test their API implementation, we have API functionality in our futures demo environment publicly available that is completely separate from the production environment and does not require existing account credentials.
In order to get started, just navigate to:
https://conformance.cryptofacilities.com
Click the Sign Up button and an e-mail and password combination will be generated for you by the platform.
Review the Demo Environment Terms & Conditions and Kraken Privacy Policy before accepting.
Note the credentials so that you may re-use them if desired.
Once these steps are completed, select 'Complete Sign-Up' to create your Demo account
Once you have signed up, you can generate API keys for the purpose of testing.
The WebSocket and HTTP API code on this environment is identical to the live production code in terms of the feeds/endpoints and the response structure.
You may also use the Github repository which has libraries coded for multiple common programming languages.
The only difference between the demo API behaviour and that of the live production environment is that the base URL is not cryptofacilities.com but instead conformance.cryptofacilities.com.
Examples
Example: subscribe to WebSocket ticker feeds by sending:
{
"event": "subscribe",
"feed": "ticker",
"product_ids": [
"PI_XBTUSD",
"FI_ETHUSD_210625"
]
}
On the demo, for the WebSocket API you would subscribe to:
wss://conformance.cryptofacilities.com/ws/v1
All the feeds are identical to those documented above.
For a similar exercise via the HTTP API you would request:
https://conformance.cryptofacilities.com/derivatives/api/v3/tickers
Please note that when you have successfully tested in the demo environment, the base URL in the live production platform environment works with
API URLs
To access the HTTP API's endpoints, HTTP calls need to be sent to endpoints under:
https://www.cryptofacilities.com/derivatives/api/v3/https://www.cryptofacilities.com/api/history/v2/https://www.cryptofacilities.com/api/charts/v1/
To subscribe to a WebSocket feed, establish a WebSocket connection to:
wss://www.cryptofacilities.com/ws/v1
Note: The direct access URLs for IP whitelisting are different, see IP whitelisting below.
Crypto Facilities IP whitelisting for direct access
API/programmatic traders can connect directly to the exchange server to improve latency and performance by whitelisting up to 15 IP addresses.
The servers to connect through whitelisted addresses are as follows:
https://api.cryptofacilities.comwss://api.cryptofacilities.com
Crypto Facilities reserves the right to remove any IP addresses from the whitelist at any time and for any reason.
HTTP API
HTTP API Introduction
Authentication
Authentication example
Inclusion of HTTP headers in Java where
apiKey,nonce, andauthentare determined as described in this section. For full working examples in different programming languages, see Sample Implementations.
String url = "https://www.cryptofacilities.com/derivatives/api/v3/sendorder";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
...
con.setRequestProperty("APIKey", apiKey);
con.setRequestProperty("Nonce", nonce);
con.setRequestProperty("Authent", authent);
Calls to endpoints requiring authentication must include the following HTTP headers: APIKey and Authent.
A third header, Nonce, may also be included (this is optional).
| Header name | Value | |
|---|---|---|
| APIKey | Public api key (not the secret!) | required |
| Authent | Authentication string | required |
| Nonce | A unique incrementing nonce | optional |
Some HTTP endpoints allow performing sensitive operations such as placing orders or requesting a
digital asset withdrawal. These private endpoints can therefore be called only through encrypted
requests, and an authentication string (Authent) must be included in each such request. Authent is computed from the following inputs:
PostData
postData is a & concatenation in the form <argument>=<value> and is specific to each HTTP endpoint.
Example: To operate the endpoint orderbook you choose the argument symbol with value fi_xbtusd_180615. postData is then given by symbol=fi_xbtusd_180615.
Update: Authentication Flow for v3 endpoints: As of 20th February 2024, to align with best practices and ensure a higher security standard, we are updating the authentication flow for /derivatives/* endpoints. (details below)
PostData Generation Changes:
- Before release: Users were required to hash query string parameters before url-encoding for Authent generation, e.g., greeting=hello world.
- After release: The authentication process will now require hashing the full, url-encoded URI component as it appears in the request, e.g., greeting=hello%20world.
This update is particularly relevant for the batchorder endpoint, which accepts a JSON body in its query parameters.
Backward Compatibility and Future Plans: For the time being, this change is backward compatible. The API will accept both Authent generation methods described above. However, we aim to phase out the old method (hashing decoded query string parameters) in the future to maintain the highest security standards. We will provide ample notice ahead of this change and strongly encourage all users to transition to the new method as soon as possible to ensure seamless service continuity.
Nonce
Nonce is a continuously incrementing integer parameter. A good nonce is your system time in
milliseconds (in string format). Our system tolerates nonces that are out of order for a brief period of time.
Nonce is not required.
Example: 1415957147987
Many authentication issues are related with incorrect Nonce. A new pair of api keys will automatically reset the nonce and resolve these issues.
Endpoint Path
endpointPath This is the URL extension of the endpoint.
If an endpointPath starts with "/derivatives" it should not be included when Authent is being computed.
Example: /api/v3/orderbook
API Secret
The api_secret is obtained as described under generate-api-keys.
Example: rttp4AzwRfYEdQ7R7X8Z/04Y4TZPa97pqCypi3xXxAqftygftnI6H9yGV+OcUOOJeFtZkr8mVwbAndU3Kz4Q+eG
Authent
Based on these inputs, Authent needs to be computed as follows:
- Concatenate
postData+Nonce+endpointPath - Hash the result of step 1 with the SHA-256 algorithm
- Base64-decode your
api_secret - Use the result of step 3 to hash the result of the step 2 with the HMAC-SHA-512 algorithm
- Base64-encode the result of step 4
Request Limits
Example
The following shows the return of call of the
sendorderendpoint where the API limit has been exceeded.
{
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z",
"error": "apiLimitExceeded"
}
Request limits are determined from cost associated with each API call and rate limiting budgets depend on which path the endpoint uses. Public endpoints do not have a cost and therefore do not count against any rate limiting budget.
For /derivatives endpoints, clients can spend up to 500 every 10 seconds.
The below table displays the cost associated with each API call for /derivatives endpoints:
| Endpoint | Cost |
|---|---|
| sendorder | 10 |
| editorder | 10 |
| cancelorder | 10 |
| batchorder | 9 + size of batch |
| accounts | 2 |
| openpositions | 2 |
| fills (without lastFillTime specified) | 2 |
| fills (with lastFillTime specified) | 25 |
| cancelallorders | 25 |
| cancelallordersafter | 25 |
| withdrawaltospotwallet | 100 |
| openorders | 2 |
| orders/status | 1 |
| unwindqueue | 200 |
| GET leveragepreferences | 2 |
| PUT leveragepreferences | 10 |
| GET pnlpreferences | 2 |
| PUT pnlpreferences | 10 |
| assignmentprogram/readandagree | 10 |
| assignmentprogram/current | 50 |
| assignmentprogram/delete | 50 |
| assignmentprogram/history | 50 |
| assignmentprogram/add | 100 |
| transfer | 10 |
| transfer/subaccount | 10 |
| subaccount/{subaccountUid}/trading-enabled | 2 |
| self-trade-strategy | 2 |
On the Batch Order endpoint, the cost is 9 + size of the batch of the requests. For example, a batch of 10 order requests, (send, edit, and or cancel) sent through the Batch Order endpoint would cost 19.
If the API limit is exceeded, the API will return error equal to apiLimitExceeded.
For /history endpoints, clients have a pool of up to 100 tokens that continually replenishes at a rate of 100 every 10 minutes.
The below table displays the cost associated with each API call for /history endpoints. The accountlog rate limit cost varies on the optional 'count' parameter (default count is 500):
| Endpoint | Cost |
|---|---|
| historicalorders | 1 |
| historicaltriggers | 1 |
| historicalexecutions | 1 |
| accounglogcsv | 6 |
| accountlog (count: 1 - 25) | 1 |
| accountlog (count: 26 - 50) | 2 |
| accountlog (count: 51 - 1000) | 3 |
| accountlog (count: 1001 - 5000) | 6 |
| accountlog (count: 5001 - 100000) | 10 |
Calls and Returns
Calls
Calls to endpoints that do not change the state of the server should be submitted with request type GET and with request parameters submitted in the URL.
Calls to endpoints that do change the state of the server should be submitted with request type POST or PUT and with request parameters submitted in the request body.
Returns
Example response of a successful call to the
sendorderendpoint.
{
"result": "success",
"serverTime": "2016-02-25T09:45:53.818Z",
"sendStatus": {
"receivedTime": "2016-02-25T09:45:53.601Z",
"status": "placed",
"order_id": "c18f0c17-9971-40e6-8e5b10df05d422f0"
}
}
The API's returns are in JSON format. If the call was successful, the return includes the requested information or feedback on the requested action.
If a call was successful, the result key in the root structure will have the value success.
Example response of a successful call to the
sendorderendpoint where the desired operation was not performed.
{
"result":"success",
"serverTime":"2016-02-25T09:45:53.818Z",
"sendStatus":{
"receivedTime":"2016-02-25T09:45:53.601Z",
"status":"insufficientAvailableFunds"
}
}
Note that if a call comes back with result equal to success, this merely means that the request has been received and assessed successfully.
It does not necessarily mean that the desired operation has been performed.
Details on the operation's status are returned in a status key, where applicable.
Trading (v3) API
Public API for Mars including primary trade endpoints.
Account Information
Get wallets
GET
https://www.cryptofacilities.com/derivatives/api/v3/accounts
This endpoint returns key information relating to all your accounts which may either be cash accounts or margin accounts. This includes digital asset balances, instrument balances, margin requirements, margin trigger estimates and auxiliary information such as available funds, PnL of open positions and portfolio value.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response: success
GET /accountscode 200application/json
{
"accounts": {
"cash": {
"balances": {
"xbt": 141.31756797,
"xrp": 52465.1254
},
"type": "cashAccount"
},
"fi_xbtusd": {
"auxiliary": {
"af": 100.73891563,
"pnl": 12.42134766,
"pv": 153.73891563
},
"balances": {
"FI_XBTUSD_171215": 50000,
"FI_XBTUSD_180615": -15000,
"xbt": 141.31756797,
"xrp": 0
},
"currency": "xbt",
"marginRequirements": {
"im": 52.8,
"lt": 39.6,
"mm": 23.76,
"tt": 15.84
},
"triggerEstimates": {
"im": 3110,
"lt": 2890,
"mm": 3000,
"tt": 2830
},
"type": "marginAccount"
},
"flex": {
"availableMargin": 34122.66,
"balanceValue": 34995.52,
"collateralValue": 34122.66,
"currencies": {
"EUR": {
"available": 4540.5837374453,
"collateral": 4886.906656949836,
"quantity": 4540.5837374453,
"value": 4999.137289089901
},
"USD": {
"available": 5000,
"collateral": 5000,
"quantity": 5000,
"value": 5000
},
"XBT": {
"available": 0.1185308247,
"collateral": 4886.49976674881,
"quantity": 0.1185308247,
"value": 4998.721054420551
}
},
"initialMargin": 0,
"initialMarginWithOrders": 0,
"maintenanceMargin": 0,
"marginEquity": 34122.66,
"pnl": 0,
"portfolioValue": 34995.52,
"totalUnrealized": 0,
"totalUnrealizedAsMargin": 0,
"type": "multiCollateralMarginAccount",
"unrealizedFunding": 0
}
},
"result": "success",
"serverTime": "2016-02-25T09:45:53.818Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"accounts": {
"cash": {
"balances": {
"<field>": 0.0
},
"type": "cashAccount"
}
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
accountsoptional |
A structure containing structures with account-related information for all margin and cash accounts. | Account |
Account
Account example
(Some parts of this example are auto-generated)
{
"cash": {
"balances": {
"<field>": 0.0
},
"type": "cashAccount"
}
}
Information for all margin and cash accounts
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cashoptional |
CashAccount | |
| <other> | Dynamic properties | MarginAccount |
CashAccount
CashAccount example
(Some parts of this example are auto-generated)
{
"balances": {
"<field>": 0.0
},
"type": "cashAccount"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
balancesoptional |
A structure containing account balances. | CashAccountBalances |
typeoptional |
The type of the account (always cashAccount) | String value: "cashAccount" |
CashAccountBalances
CashAccountBalances example
(Some parts of this example are auto-generated)
{
"<field>": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
| <field> | Dynamic properties | Number |
MarginAccount
MarginAccount example
(Some parts of this example are auto-generated)
{
"auxiliary": {
"af": 0.0,
"funding": 0.0,
"pnl": 0.0,
"pv": 0.0,
"usd": 0.0
},
"balances": {
"<field>": 0.0
},
"currency": "string",
"marginRequirements": {
"im": 0.0,
"lt": 0.0,
"mm": 0.0,
"tt": 0.0
},
"triggerEstimates": {
"im": 0.0,
"lt": 0.0,
"mm": 0.0,
"tt": 0.0
},
"type": "marginAccount"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
auxiliaryoptional |
A structure containing auxiliary account information. | Auxiliary |
balancesoptional |
A structure containing account balances. | MarginAccountBalances |
currencyoptional |
The currency of the account. All figures shown in auxiliary and marginRequirements are in this currency. | Null or String |
marginRequirementsoptional |
A structure containing the account's margin requirements. | MarginRequirements |
triggerEstimatesoptional |
A structure containing the account's margin trigger estimates. | MarginRequirements |
typeoptional |
The type of the account (always marginAccount) | String value: "marginAccount" |
Auxiliary
Auxiliary example
(Some parts of this example are auto-generated)
{
"af": 0.0,
"funding": 0.0,
"pnl": 0.0,
"pv": 0.0,
"usd": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
afoptional |
The available funds of the account, in currency. | Number |
fundingoptional |
Number | |
pnloptional |
The PnL of current open positions of the account, in currency. | Number |
pvoptional |
The portfolio value of the account, in currency. | Number |
usdoptional |
Number |
MarginAccountBalances
MarginAccountBalances example
(Some parts of this example are auto-generated)
{
"<field>": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
| <field> | Dynamic properties | Number |
MarginRequirements
MarginRequirements example
(Some parts of this example are auto-generated)
{
"im": 0.0,
"lt": 0.0,
"mm": 0.0,
"tt": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
imoptional |
The initial margin requirement of the account. | Number |
ltoptional |
The liquidation threshold of the account. | Number |
mmoptional |
The maintenance margin requirement of the account. | Number |
ttoptional |
The termination threshold of the account | Number |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get open positions
GET
https://www.cryptofacilities.com/derivatives/api/v3/openpositions
This endpoint returns the size and average entry price of all open positions in Futures contracts. This includes Futures contracts that have matured but have not yet been settled.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response: failure
GET /openpositionscode 200application/json
{
"error": "apiLimitExceeded",
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z"
}
Example response: success
GET /openpositionscode 200application/json
{
"openPositions": [
{
"fillTime": "2020-07-22T14:39:12.376Z",
"price": 9392.749993345933,
"side": "short",
"size": 10000,
"symbol": "PI_XBTUSD",
"unrealizedFunding": 0.00001045432180096817
},
{
"fillTime": "2020-07-22T14:39:12.376Z",
"price": 9399.749966754434,
"side": "long",
"size": 20000,
"symbol": "FI_XBTUSD_201225"
},
{
"fillTime": "2022-04-20T19:15:25.438Z",
"maxFixedLeverage": 5,
"pnlCurrency": "BTC",
"price": 570,
"side": "long",
"size": 1,
"symbol": "PF_DEFIUSD",
"unrealizedFunding": -0.0073428045972263895
}
],
"result": "success",
"serverTime": "2020-07-22T14:39:12.376Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"openPositions": [
{
"fillTime": "string",
"price": 0.0,
"side": "long",
"size": 0.0,
"symbol": "string",
"unrealizedFunding": 0.0
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
openPositionsoptional |
A list containing structures with information on open positions. The list is sorted descending by fillTime. |
Array array items: [OpenPositionJson] |
OpenPositionJson
OpenPositionJson example
(Some parts of this example are auto-generated)
{
"fillTime": "string",
"price": 0.0,
"side": "long",
"size": 0.0,
"symbol": "string",
"unrealizedFunding": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
fillTimeoptional |
The date and time the position was entered into (Deprecated field, fills endpoint for fill time is recommended). | String |
priceoptional |
The average price at which the position was entered into. | Number format: double |
sideoptional |
The direction of the position. | String enum: "long", "short" |
sizeoptional |
The size of the position. | Number format: double |
symboloptional |
The symbol of the Futures. | String |
unrealizedFundingoptional |
Unrealised funding on the position. | Null or Number format: double |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get position percentile of unwind queue
GET
https://www.cryptofacilities.com/derivatives/api/v3/unwindqueue
This endpoint returns the percentile of the open position in case of unwinding.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response: success
GET /unwindqueuecode 200application/json
{
"queue": [
{
"percentile": 100,
"symbol": "PF_GMTUSD"
},
{
"percentile": 20,
"symbol": "FI_ETHUSD_220624"
},
{
"percentile": 80,
"symbol": "PF_UNIUSD"
}
],
"result": "success",
"serverTime": "2022-06-13T18:01:18.695Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"queue": [
{
"percentile": 0.0,
"symbol": "string"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
queueoptional |
A list containing structures with information on open positions' percentile rank in the unwind/termination queue. | Array array items: [UnwindQueueJson] |
UnwindQueueJson
UnwindQueueJson example
(Some parts of this example are auto-generated)
{
"percentile": 0.0,
"symbol": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
percentileoptional |
The percentile rank of which the trader's position is in the unwind queue (20, 40, 80, or 100). | Number |
symboloptional |
The symbol of the futures to which the order refers. | String |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Assignment Program
Adds an assignment program preference
POST
https://www.cryptofacilities.com/derivatives/api/v3/assignmentprogram/add
This endpoint adds an assignment program preference
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
acceptLong |
query | Accept to take long positions | Boolean |
acceptShort |
query | Accept to take short positions | Boolean |
contractType |
query | Type of contract for the assignment program preference. Options can be found in the 'accounts' structure in the Get Wallets /accounts response | String |
enabled |
query | enabled assignment | Boolean |
timeFrame |
query | When is the program preference valid | String |
maxPositionoptional |
query | The maximum position | Number |
maxSizeoptional |
query | The maximum size for an assignment | Number |
Response - application/json
Example response
(Some parts of this example are auto-generated)POST /assignmentprogram/addcode 200application/json
{
"id": 0.0,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"id": 0.0,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
idoptional |
Number | ||
participantoptional |
AssignmentParticipantJson |
AssignmentParticipantJson
AssignmentParticipantJson example
{
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
acceptLongoptional |
Boolean |
acceptShortoptional |
Boolean |
contractoptional |
Null or String |
contractTypeoptional |
String |
enabledoptional |
Boolean |
maxPositionoptional |
Null or Number format: double |
maxSizeoptional |
Null or Number format: double |
timeFrameoptional |
String enum: "all", "weekdays", "weekends" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Lists current assignment programs
GET
https://www.cryptofacilities.com/derivatives/api/v3/assignmentprogram/current
This endpoint returns information on currently active assignment programs
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /assignmentprogram/currentcode 200application/json
{
"participants": [
{
"id": 0.0,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
]
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"participants": [
{
"id": 0.0,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
participantsoptional |
Array array items: [AssignmentParticipantDetails] |
AssignmentParticipantDetails
AssignmentParticipantDetails example
(Some parts of this example are auto-generated)
{
"id": 0.0,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
idoptional |
Number |
participantoptional |
AssignmentParticipantJson |
AssignmentParticipantJson
AssignmentParticipantJson example
{
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
acceptLongoptional |
Boolean |
acceptShortoptional |
Boolean |
contractoptional |
Null or String |
contractTypeoptional |
String |
enabledoptional |
Boolean |
maxPositionoptional |
Null or Number format: double |
maxSizeoptional |
Null or Number format: double |
timeFrameoptional |
String enum: "all", "weekdays", "weekends" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
deletes an assignment program preference
POST
https://www.cryptofacilities.com/derivatives/api/v3/assignmentprogram/delete
This endpoint deletes an assignment program preference
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
id |
query | Id of program to delete | Number |
Response - application/json
Example response
(Some parts of this example are auto-generated)POST /assignmentprogram/deletecode 200application/json
{
"id": 0.0,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"id": 0.0,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
idoptional |
Number | ||
participantoptional |
AssignmentParticipantJson |
AssignmentParticipantJson
AssignmentParticipantJson example
{
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
acceptLongoptional |
Boolean |
acceptShortoptional |
Boolean |
contractoptional |
Null or String |
contractTypeoptional |
String |
enabledoptional |
Boolean |
maxPositionoptional |
Null or Number format: double |
maxSizeoptional |
Null or Number format: double |
timeFrameoptional |
String enum: "all", "weekdays", "weekends" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Lists all changes in assignment program preferences
GET
https://www.cryptofacilities.com/derivatives/api/v3/assignmentprogram/history
This endpoint returns information on assignment program preferences
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /assignmentprogram/historycode 200application/json
{
"participants": [
{
"deleted": false,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
]
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"participants": [
{
"deleted": false,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
participantsoptional |
Array array items: [AssignmentParticipantHistoryJson] |
AssignmentParticipantHistoryJson
AssignmentParticipantHistoryJson example
(Some parts of this example are auto-generated)
{
"deleted": false,
"participant": {
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
deletedoptional |
Boolean |
participantoptional |
AssignmentParticipantJson |
AssignmentParticipantJson
AssignmentParticipantJson example
{
"acceptLong": true,
"acceptShort": true,
"contract": "PF_BTCUSD",
"contractType": "flex",
"enabled": true,
"maxPosition": 10,
"maxSize": 10,
"timeFrame": "weekdays"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
acceptLongoptional |
Boolean |
acceptShortoptional |
Boolean |
contractoptional |
Null or String |
contractTypeoptional |
String |
enabledoptional |
Boolean |
maxPositionoptional |
Null or Number format: double |
maxSizeoptional |
Null or Number format: double |
timeFrameoptional |
String enum: "all", "weekdays", "weekends" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Fee Schedules
Get fee schedules
GET
https://www.cryptofacilities.com/derivatives/api/v3/feeschedules
This endpoint lists all fee schedules.
Authentication is not required.
Response - application/json
Example response: success
GET /feeschedulescode 200application/json
{
"feeSchedules": [
{
"name": "PGTMainFees",
"tiers": [
{
"makerFee": 0.02,
"takerFee": 0.05,
"usdVolume": 0
},
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000
},
{
"makerFee": 0.0125,
"takerFee": 0.03,
"usdVolume": 1000000
},
{
"makerFee": 0.01,
"takerFee": 0.025,
"usdVolume": 5000000
},
{
"makerFee": 0.0075,
"takerFee": 0.02,
"usdVolume": 10000000
},
{
"makerFee": 0.005,
"takerFee": 0.015,
"usdVolume": 20000000
},
{
"makerFee": 0.0025,
"takerFee": 0.0125,
"usdVolume": 50000000
},
{
"makerFee": 0,
"takerFee": 0.01,
"usdVolume": 100000000
}
],
"uid": "7fc4d7c0-464f-4029-a9bb-55856d0c5247"
},
{
"name": "mainfees",
"tiers": [
{
"makerFee": 0.02,
"takerFee": 0.05,
"usdVolume": 0
},
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000
},
{
"makerFee": 0.0125,
"takerFee": 0.03,
"usdVolume": 1000000
},
{
"makerFee": 0.01,
"takerFee": 0.025,
"usdVolume": 5000000
},
{
"makerFee": 0.0075,
"takerFee": 0.02,
"usdVolume": 10000000
},
{
"makerFee": 0.005,
"takerFee": 0.015,
"usdVolume": 20000000
},
{
"makerFee": 0.0025,
"takerFee": 0.0125,
"usdVolume": 50000000
},
{
"makerFee": 0,
"takerFee": 0.01,
"usdVolume": 100000000
}
],
"uid": "d46c2190-81e3-4370-a333-424f24387829"
}
],
"result": "success",
"serverTime": "2022-03-31T20:38:53.677Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"feeSchedules": [
{
"name": "PGTMainFees",
"tiers": [
{
"makerFee": 0.02,
"takerFee": 0.05,
"usdVolume": 0
},
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000
},
{
"makerFee": 0.0125,
"takerFee": 0.03,
"usdVolume": 1000000
},
{
"makerFee": 0.01,
"takerFee": 0.025,
"usdVolume": 5000000
},
{
"makerFee": 0.0075,
"takerFee": 0.02,
"usdVolume": 10000000
},
{
"makerFee": 0.005,
"takerFee": 0.015,
"usdVolume": 20000000
},
{
"makerFee": 0.0025,
"takerFee": 0.0125,
"usdVolume": 50000000
},
{
"makerFee": 0,
"takerFee": 0.01,
"usdVolume": 100000000
}
],
"uid": "7fc4d7c0-464f-4029-a9bb-55856d0c5247"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
feeSchedulesoptional |
Array array items: [FeeSchedule] |
FeeSchedule
FeeSchedule example
{
"name": "PGTMainFees",
"tiers": [
{
"makerFee": 0.02,
"takerFee": 0.05,
"usdVolume": 0
},
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000
},
{
"makerFee": 0.0125,
"takerFee": 0.03,
"usdVolume": 1000000
},
{
"makerFee": 0.01,
"takerFee": 0.025,
"usdVolume": 5000000
},
{
"makerFee": 0.0075,
"takerFee": 0.02,
"usdVolume": 10000000
},
{
"makerFee": 0.005,
"takerFee": 0.015,
"usdVolume": 20000000
},
{
"makerFee": 0.0025,
"takerFee": 0.0125,
"usdVolume": 50000000
},
{
"makerFee": 0,
"takerFee": 0.01,
"usdVolume": 100000000
}
],
"uid": "7fc4d7c0-464f-4029-a9bb-55856d0c5247"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
nameoptional |
Name of schedule. | String | "PGTMainFees" |
tiersoptional |
A list containing a structures for each fee tier, see below. | Array array items: [FeeTier] |
|
uidoptional |
Unique identifier of fee schedule. | String | "7fc4d7c0-464f-4029-a9bb-55856d0c5247" |
FeeTier
FeeTier example
(Some parts of this example are auto-generated)
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
makerFeeoptional |
Percentage value of maker fee in the tier. | Number | 0.015 |
takerFeeoptional |
Percentage value of taker fee in the tier. | Number | 0.04 |
usdVolumeoptional |
Minimum 30-day USD volume for fee tier to be applicable. | Number | 100000 |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get fee schedule volumes
GET
https://www.cryptofacilities.com/derivatives/api/v3/feeschedules/volumes
Returns your fee schedule volumes for each fee schedule.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response: success
GET /feeschedules/volumescode 200application/json
{
"result": "success",
"serverTime": "2016-02-25T09:45:53.818Z",
"volumesByFeeSchedule": {
"eef90775-995b-4596-9257-0917f6134766": 53823
}
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"volumesByFeeSchedule": {
"7fc4d7c0-464f-4029-a9bb-55856d0c5247": 10,
"d46c2190-81e3-4370-a333-424f24387829": 10
}
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
volumesByFeeScheduleoptional |
List containing the 30-day volume. | FeeScheduleVolumes |
FeeScheduleVolumes
FeeScheduleVolumes example
{
"7fc4d7c0-464f-4029-a9bb-55856d0c5247": 10,
"d46c2190-81e3-4370-a333-424f24387829": 10
}
The 30-day volume for your account.
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
| <field> | Dynamic properties | Number |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
General
Get notifications
GET
https://www.cryptofacilities.com/derivatives/api/v3/notifications
This endpoint provides the platform's notifications.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response: failure
GET /notificationscode 200application/json
{
"error": "apiLimitExceeded",
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z"
}
Example response: success
GET /notificationscode 200application/json
{
"notifications": [
{
"note": "We've launched a new Telegram group.",
"priority": "low",
"type": "general"
},
{
"effectiveTime": "2018-06-29T15:00:00Z",
"note": "Week contracts with maturity 29/Jun/2018 expire and settle.",
"priority": "medium",
"type": "settlement"
}
],
"result": "success",
"serverTime": "2018-06-29T15:22:05.187Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"notifications": [
{
"effectiveTime": "string",
"expectedDowntimeMinutes": 0,
"note": "string",
"priority": "low",
"type": "new_feature"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
notificationsoptional |
A list containing the notifications. | Array array items: [NotificationJson] |
NotificationJson
NotificationJson example
(Some parts of this example are auto-generated)
{
"effectiveTime": "string",
"expectedDowntimeMinutes": 0,
"note": "string",
"priority": "low",
"type": "new_feature"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
effectiveTimeoptional |
The time that notification is taking effect. | String |
expectedDowntimeMinutesoptional |
The expected downtime in minutes or absent if no downtime is expected. | Integer |
noteoptional |
The notification note. A short description about the specific notification. | String |
priorityoptional |
The notification priorities: - low - medium - highIf priority == "high" then it implies downtime will occur at effective_time when type == "maintenance". |
String enum: "low", "medium", "high" |
typeoptional |
The notification types: - market - general - new_feature - bug_fix - maintenance - settlementIf type == "maintenance" then it implies downtime will occur at effective_time if priority == "high". |
String enum: "new_feature", "bug_fix", "settlement", "general", "maintenance", "market" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Historical Data
Get your fills
GET
https://www.cryptofacilities.com/derivatives/api/v3/fills
This endpoint returns information on your filled orders for all futures contracts.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
lastFillTimeoptional |
query | If not provided, returns the last 100 fills in any futures contract. If provided, returns the 100 entries before lastFillTime. | String |
Response - application/json
Example response: success
GET /fillscode 200application/json
{
"fills": [
{
"fillTime": "2020-07-22T13:37:27.077Z",
"fillType": "maker",
"fill_id": "3d57ed09-fbd6-44f1-8e8b-b10e551c5e73",
"order_id": "693af756-055e-47ef-99d5-bcf4c456ebc5",
"price": 9400,
"side": "buy",
"size": 5490,
"symbol": "PI_XBTUSD"
},
{
"fillTime": "2020-07-21T12:41:52.790Z",
"fillType": "taker",
"fill_id": "56b86ada-73b0-454d-a95a-e29e3e85b349",
"order_id": "3f513c4c-683d-44ab-a73b-d296abbea201",
"price": 9456,
"side": "buy",
"size": 5000,
"symbol": "PI_XBTUSD"
}
],
"result": "success",
"serverTime": "2020-07-22T13:44:24.311Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"fills": [
{
"fillTime": "2021-11-18T02:39:41.826Z",
"fillType": "maker",
"fill_id": "98e3deeb-0385-4b25-b15e-7e8453512cb2",
"order_id": "06b9d509-965c-4788-b317-0e5ca11d56fb",
"price": 47000,
"side": "buy",
"size": 10,
"symbol": "PI_XBTUSD"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
fillsoptional |
A list containing structures with information on filled orders. The list is sorted descending by fillTime. |
Array array items: [FillJson] |
FillJson
FillJson example
{
"fillTime": "2021-11-18T02:39:41.826Z",
"fillType": "maker",
"fill_id": "98e3deeb-0385-4b25-b15e-7e8453512cb2",
"order_id": "06b9d509-965c-4788-b317-0e5ca11d56fb",
"price": 47000,
"side": "buy",
"size": 10,
"symbol": "PI_XBTUSD"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
cliOrdIdoptional |
The unique client order identifier. This field is returned only if the order has a client order ID. |
Null or String | |
fillTimeoptional |
The date and time the order was filled. | String | "2021-11-18T02:39:41.826Z" |
fillTypeoptional |
The classification of the fill: - maker - user has a limit order that gets filled - taker - the user makes an execution that crosses the spread - liquidation - execution is result of a liquidation - assignee - execution is a result of a counterparty receiving an Assignment in PAS - assignor - execution is a result of user assigning their position due to failed liquidation |
String enum: "maker", "taker", "liquidation", "assignor", "assignee", "takerAfterEdit", "unwindBankrupt", "unwindCounterparty" |
"maker" |
fill_idoptional |
The unique identifier of the fill. Note that several fill_id can pertain to one order_id (but not vice versa) |
String format: uuid |
|
order_idoptional |
The unique identifier of the order. | String format: uuid |
|
priceoptional |
The price of the fill. | Number | 47000 |
sideoptional |
The direction of the order. | String enum: "buy", "sell" |
"buy" |
sizeoptional |
The size of the fill. | Number | 10 |
symboloptional |
The symbol of the futures the fill occurred in. | String | "PI_XBTUSD" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Historical Funding Rates
Historical funding rates
GET
https://www.cryptofacilities.com/derivatives/api/v3/v4/historicalfundingrates
Returns list of historical funding rates for given market.
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
symbol |
query | Market symbol. Market symbol |
String regex pattern: [A-Z0-9_.]+ |
"PF_BTCUSD" |
Response - application/json
Example response: success
GET /v4/historicalfundingratescode 200application/json
{
"rates": [
{
"fundingRate": -8.15861558e-10,
"relativeFundingRate": -0.000016898883333333,
"timestamp": "2022-06-28T00:00:00.000Z"
},
{
"fundingRate": -2.6115278e-11,
"relativeFundingRate": -5.40935416667e-7,
"timestamp": "2022-06-28T04:00:00.000Z"
},
{
"fundingRate": -4.08356853e-10,
"relativeFundingRate": -8.521190625e-6,
"timestamp": "2022-06-28T08:00:00.000Z"
}
],
"result": "success",
"serverTime": "2022-06-28T09:29:04.243Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"rates": [
{
"fundingRate": 0.0,
"relativeFundingRate": 0.0,
"timestamp": "2022-03-31T20:38:53.677Z"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
ratesoptional |
A list containing structures with historical funding rate information. The list is sorted ascending by timestamp. | Array array items: [HistoricalFundingRateJson] |
HistoricalFundingRateJson
HistoricalFundingRateJson example
(Some parts of this example are auto-generated)
{
"fundingRate": 0.0,
"relativeFundingRate": 0.0,
"timestamp": "2022-03-31T20:38:53.677Z"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
fundingRateoptional |
The absolute funding rate for the listed time period | Number |
relativeFundingRateoptional |
The relative funding rate for the listed time period | Number |
timestampoptional |
The date and time UTC of the one-hour period to which the funding rate applies. | String format: date-time |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Instrument Details
- The
/instruments/statusendpoint provides a list of statuses for all instruments. - The
/instruments/{symbol}/statusendpoint provides the status of a single instrument.
Get instruments
GET
https://www.cryptofacilities.com/derivatives/api/v3/instruments
Returns specifications for all currently listed markets and indices.
Authentication is not required.
Response - application/json
Example response: success
GET /instrumentscode 200application/json
{
"instruments": [
{
"category": "",
"contractSize": 1,
"contractValueTradePrecision": 0,
"feeScheduleUid": "eef90775-995b-4596-9257-0917f6134766",
"fundingRateCoefficient": 8,
"impactMidSize": 1,
"isin": "GB00J62YGL67",
"marginLevels": [
{
"contracts": 0,
"initialMargin": 0.02,
"maintenanceMargin": 0.01
},
{
"contracts": 500000,
"initialMargin": 0.04,
"maintenanceMargin": 0.02
},
{
"contracts": 1000000,
"initialMargin": 0.06,
"maintenanceMargin": 0.03
},
{
"contracts": 3000000,
"initialMargin": 0.1,
"maintenanceMargin": 0.05
},
{
"contracts": 6000000,
"initialMargin": 0.15,
"maintenanceMargin": 0.075
},
{
"contracts": 12000000,
"initialMargin": 0.25,
"maintenanceMargin": 0.125
},
{
"contracts": 20000000,
"initialMargin": 0.3,
"maintenanceMargin": 0.15
},
{
"contracts": 50000000,
"initialMargin": 0.4,
"maintenanceMargin": 0.2
}
],
"maxPositionSize": 1000000,
"maxRelativeFundingRate": 0.001,
"openingDate": "2022-01-01T00:00:00.000Z",
"postOnly": false,
"retailMarginLevels": [
{
"contracts": 0,
"initialMargin": 0.5,
"maintenanceMargin": 0.25
}
],
"symbol": "PI_XBTUSD",
"tags": [],
"tickSize": 0.5,
"tradeable": true,
"type": "futures_inverse",
"underlying": "rr_xbtusd"
},
{
"category": "",
"contractSize": 1,
"contractValueTradePrecision": 0,
"feeScheduleUid": "eef90775-995b-4596-9257-0917f6134766",
"impactMidSize": 1,
"isin": "GB00JVMLP260",
"lastTradingTime": "2022-09-30T15:00:00.000Z",
"marginLevels": [
{
"contracts": 0,
"initialMargin": 0.02,
"maintenanceMargin": 0.01
},
{
"contracts": 500000,
"initialMargin": 0.04,
"maintenanceMargin": 0.02
},
{
"contracts": 1000000,
"initialMargin": 0.06,
"maintenanceMargin": 0.03
},
{
"contracts": 3000000,
"initialMargin": 0.1,
"maintenanceMargin": 0.05
},
{
"contracts": 6000000,
"initialMargin": 0.15,
"maintenanceMargin": 0.075
},
{
"contracts": 9000000,
"initialMargin": 0.25,
"maintenanceMargin": 0.125
},
{
"contracts": 15000000,
"initialMargin": 0.3,
"maintenanceMargin": 0.15
},
{
"contracts": 30000000,
"initialMargin": 0.4,
"maintenanceMargin": 0.2
}
],
"maxPositionSize": 1000000,
"openingDate": "2022-01-01T00:00:00.000Z",
"postOnly": false,
"retailMarginLevels": [
{
"contracts": 0,
"initialMargin": 0.5,
"maintenanceMargin": 0.25
}
],
"symbol": "FI_XBTUSD_220930",
"tags": [],
"tickSize": 0.5,
"tradeable": true,
"type": "futures_inverse",
"underlying": "rr_xbtusd"
},
{
"category": "Layer 1",
"contractSize": 1,
"contractValueTradePrecision": 4,
"feeScheduleUid": "5b755fea-c5b0-4307-a66e-b392cd5bd931",
"fundingRateCoefficient": 8,
"impactMidSize": 1,
"marginLevels": [
{
"initialMargin": 0.02,
"maintenanceMargin": 0.01,
"numNonContractUnits": 0
},
{
"initialMargin": 0.04,
"maintenanceMargin": 0.02,
"numNonContractUnits": 500000
},
{
"initialMargin": 0.1,
"maintenanceMargin": 0.05,
"numNonContractUnits": 2000000
},
{
"initialMargin": 0.2,
"maintenanceMargin": 0.1,
"numNonContractUnits": 5000000
},
{
"initialMargin": 0.3,
"maintenanceMargin": 0.15,
"numNonContractUnits": 10000000
},
{
"initialMargin": 0.5,
"maintenanceMargin": 0.25,
"numNonContractUnits": 30000000
}
],
"maxPositionSize": 1000000,
"maxRelativeFundingRate": 0.001,
"openingDate": "2022-01-01T00:00:00.000Z",
"postOnly": false,
"retailMarginLevels": [
{
"initialMargin": 0.02,
"maintenanceMargin": 0.01,
"numNonContractUnits": 0
},
{
"initialMargin": 0.04,
"maintenanceMargin": 0.02,
"numNonContractUnits": 500000
},
{
"initialMargin": 0.1,
"maintenanceMargin": 0.05,
"numNonContractUnits": 2000000
},
{
"initialMargin": 0.2,
"maintenanceMargin": 0.1,
"numNonContractUnits": 5000000
},
{
"initialMargin": 0.3,
"maintenanceMargin": 0.15,
"numNonContractUnits": 10000000
},
{
"initialMargin": 0.5,
"maintenanceMargin": 0.25,
"numNonContractUnits": 30000000
}
],
"symbol": "PF_XBTUSD",
"tags": [],
"tickSize": 1,
"tradeable": true,
"type": "flexible_futures"
}
],
"result": "success",
"serverTime": "2022-06-28T09:29:04.243Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"instruments": [
{
"category": "string",
"contractSize": 0.0,
"contractValueTradePrecision": 0.0,
"feeScheduleUid": "string",
"fundingRateCoefficient": 0.0,
"impactMidSize": 0.0,
"isin": "string",
"lastTradingTime": "2022-03-31T20:38:53.677Z",
"marginLevels": [
{
"contracts": 0,
"initialMargin": 0.0,
"maintenanceMargin": 0.0,
"numNonContractUnits": 0.0
}
],
"maxPositionSize": 0.0,
"maxRelativeFundingRate": 0.0,
"openingDate": "2022-03-31T20:38:53.677Z",
"postOnly": false,
"retailMarginLevels": [
{
"contracts": 0,
"initialMargin": 0.0,
"maintenanceMargin": 0.0,
"numNonContractUnits": 0.0
}
],
"symbol": "string",
"tags": [
"string"
],
"tickSize": 0.0,
"tradeable": false,
"type": "flexible_futures",
"underlying": "string"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
instrumentsoptional |
A list containing structures for each available instrument. The list is in no particular order. | Array array items: [Instrument] |
Instrument
Instrument example
(Some parts of this example are auto-generated)
{
"category": "string",
"contractSize": 0.0,
"contractValueTradePrecision": 0.0,
"feeScheduleUid": "string",
"fundingRateCoefficient": 0.0,
"impactMidSize": 0.0,
"isin": "string",
"lastTradingTime": "2022-03-31T20:38:53.677Z",
"marginLevels": [
{
"contracts": 0,
"initialMargin": 0.0,
"maintenanceMargin": 0.0,
"numNonContractUnits": 0.0
}
],
"maxPositionSize": 0.0,
"maxRelativeFundingRate": 0.0,
"openingDate": "2022-03-31T20:38:53.677Z",
"postOnly": false,
"retailMarginLevels": [
{
"contracts": 0,
"initialMargin": 0.0,
"maintenanceMargin": 0.0,
"numNonContractUnits": 0.0
}
],
"symbol": "string",
"tags": [
"string"
],
"tickSize": 0.0,
"tradeable": false,
"type": "flexible_futures",
"underlying": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
symbol |
String | |
tradeable |
True if the instrument can be traded, False otherwise. | Boolean |
categoryoptional |
'Category of the contract: "Layer 1", "Layer 2", "DeFi", or "Privacy" (multi-collateral contracts only).' | String |
contractSizeoptional |
For futures: The contract size of the Futures For indices: Not returned because N/A |
Number |
contractValueTradePrecisionoptional |
Trade precision for the contract (e.g. trade precision of 2 means trades are precise to the hundredth decimal place 0.01). | Number |
feeScheduleUidoptional |
Unique identifier of fee schedule associated with the instrument | String |
fundingRateCoefficientoptional |
Number | |
impactMidSizeoptional |
Amount of contract used to calculated the mid price for the mark price | Number |
isinoptional |
Single-collateral contracts only: Contract's ISIN code | String |
lastTradingTimeoptional |
String format: date-time |
|
marginLevelsoptional |
For futures: A list containing the margin schedules For indices: Not returned because N/A |
Array array items: [MarginLevel] |
maxPositionSizeoptional |
Maximum number of contracts that one can hold in a position | Number |
maxRelativeFundingRateoptional |
Perpetuals only: the absolute value of the maximum permissible funding rate | Number |
openingDateoptional |
When the contract was first available for trading | String format: date-time |
postOnlyoptional |
True if the instrument is in post-only mode, false otherwise. | Boolean |
retailMarginLevelsoptional |
Margin levels for retail clients (investor category no longer eligible for trading). | Array array items: [MarginLevel] |
tagsoptional |
Tag for the contract (currently does not return a value). | Array array items: [String] |
tickSizeoptional |
Tick size of the contract being traded. | Number |
typeoptional |
The type of the instrument: - flexible_futures - futures_inverse - futures_vanilla |
String enum: "flexible_futures", "futures_inverse", "futures_vanilla" |
underlyingoptional |
For futures: The underlying of the Futures For indices: Not returned because N/A |
String |
MarginLevel
MarginLevel example
(Some parts of this example are auto-generated)
{
"contracts": 0,
"initialMargin": 0.0,
"maintenanceMargin": 0.0,
"numNonContractUnits": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
contractsoptional |
For futures: The lower limit of the number of contracts to which this margin level applies For indices: Not returned because N/A |
Null or Integer format: int64 |
initialMarginoptional |
For futures: The initial margin requirement for this level For indices: Not returned because N/A |
Number |
maintenanceMarginoptional |
For futures: The maintenance margin requirement for this level For indices: Not returned because N/A |
Number |
numNonContractUnitsoptional |
For futures: The lower limit of the number of non-contract units (i.e. quote currency units for linear futures) to which this margin level applies For indices: Not returned because N/A. |
Null or Number format: double |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get instrument status list
GET
https://www.cryptofacilities.com/derivatives/api/v3/instruments/status
Returns price dislocation and volatility details for all markets.
Authentication is not required.
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /instruments/statuscode 200application/json
{
"instrumentStatus": [
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"tradeable": "PI_XBTUSD"
}
]
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"instrumentStatus": [
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"tradeable": "PI_XBTUSD"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
instrumentStatusoptional |
Array array items: [InstrumentStatus] |
InstrumentStatus
InstrumentStatus example
(Some parts of this example are auto-generated)
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"tradeable": "PI_XBTUSD"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
extremeVolatilityInitialMarginMultiplieroptional |
Integer | |
isExperiencingDislocationoptional |
Boolean | |
isExperiencingExtremeVolatilityoptional |
Boolean | |
priceDislocationDirectionoptional |
Null or String enum: "ABOVE_UPPER_BOUND", "BELOW_LOWER_BOUND" |
|
tradeableoptional |
String | "PI_XBTUSD" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get instrument status
GET
https://www.cryptofacilities.com/derivatives/api/v3/instruments/{symbol}/status
Returns price dislocation and volatility details for given market.
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
symbol |
path | Market symbol. Market symbol |
String regex pattern: [A-Z0-9_.]+ |
"PF_BTCUSD" |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /instruments/{symbol}/statuscode 200application/json
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"tradeable": "PI_XBTUSD"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"tradeable": "PI_XBTUSD"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
extremeVolatilityInitialMarginMultiplieroptional |
Integer | ||
isExperiencingDislocationoptional |
Boolean | ||
isExperiencingExtremeVolatilityoptional |
Boolean | ||
priceDislocationDirectionoptional |
Null or String enum: "ABOVE_UPPER_BOUND", "BELOW_LOWER_BOUND" |
||
tradeableoptional |
String | "PI_XBTUSD" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Market Data
Get trade history
GET
https://www.cryptofacilities.com/derivatives/api/v3/history
This endpoint returns the most recent 100 trades prior to the specified lastTime value up
to past 7 days or recent trading engine restart (whichever is sooner).
If no lastTime specified, it will return 100 most recent trades.
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Default |
|---|---|---|---|---|
includeMTFDataoptional |
query | Boolean | true | |
lastTimeoptional |
query | Returns the last 100 trades from the specified lastTime value. | String | |
symboloptional |
query | The symbol of the Futures. | String |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /historycode 200application/json
{
"history": [
{
"execution_venue": "string",
"instrument_identification_type": "string",
"isin": "string",
"notional_amount": 0.0,
"notional_currency": "string",
"price": 0.0,
"price_currency": "string",
"price_notation": "string",
"publication_time": "string",
"publication_venue": "string",
"side": "string",
"size": "string",
"time": "string",
"to_be_cleared": false,
"trade_id": 0,
"transaction_identification_code": "string",
"type": "fill",
"uid": "string"
}
]
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"history": [
{
"execution_venue": "string",
"instrument_identification_type": "string",
"isin": "string",
"notional_amount": 0.0,
"notional_currency": "string",
"price": 0.0,
"price_currency": "string",
"price_notation": "string",
"publication_time": "string",
"publication_venue": "string",
"side": "string",
"size": "string",
"time": "string",
"to_be_cleared": false,
"trade_id": 0,
"transaction_identification_code": "string",
"type": "fill",
"uid": "string"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
historyoptional |
A list containing structures with historical price information. The list is sorted descending by time. | Array array items: [HistoryJson] |
HistoryJson
HistoryJson example
(Some parts of this example are auto-generated)
{
"execution_venue": "string",
"instrument_identification_type": "string",
"isin": "string",
"notional_amount": 0.0,
"notional_currency": "string",
"price": 0.0,
"price_currency": "string",
"price_notation": "string",
"publication_time": "string",
"publication_venue": "string",
"side": "string",
"size": "string",
"time": "string",
"to_be_cleared": false,
"trade_id": 0,
"transaction_identification_code": "string",
"type": "fill",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
execution_venueoptional |
Null or String | |
instrument_identification_typeoptional |
Null or String | |
isinoptional |
Null or String | |
notional_amountoptional |
Null or Number | |
notional_currencyoptional |
Null or String | |
priceoptional |
For futures: The price of a fill For indices: The calculated value |
Number |
price_currencyoptional |
Null or String | |
price_notationoptional |
Null or String | |
publication_timeoptional |
Null or String | |
publication_venueoptional |
Null or String | |
sideoptional |
The classification of the taker side in the matched trade: "buy" if the taker is a buyer, "sell" if the taker is a seller. | Null or String |
sizeoptional |
For futures: The size of a fill For indices: Not returned because N/A | Null or String |
timeoptional |
The date and time of a trade or an index computation For futures: The date and time of a trade. Data is not aggregated For indices: The date and time of an index computation. For real-time indices, data is aggregated to the last computation of each full hour. For reference rates, data is not aggregated |
String |
to_be_clearedoptional |
Null or Boolean | |
trade_idoptional |
For futures: A continuous index starting at 1 for the first fill in a Futures contract maturity For indices: Not returned because N/A | Null or Integer format: int32 |
transaction_identification_codeoptional |
Null or String | |
typeoptional |
The classification of the matched trade in an orderbook: - fill - it is a normal buyer and seller - liquidation - it is a result of a user being liquidated from their position - assignment - the fill is the result of a users position being assigned to a marketmaker - termination - it is a result of a user being terminated - block - it is an element of a block trade |
Null or String enum: "fill", "liquidation", "assignment", "termination", "block" |
uidoptional |
Null or String |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get orderbook
GET
https://www.cryptofacilities.com/derivatives/api/v3/orderbook
This endpoint returns the entire non-cumulative order book of currently listed Futures contracts.
Authentication is not required.
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
symbol |
query | The symbol of the Futures. | String |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /orderbookcode 200application/json
{
"orderBook": {
"asks": [
[
40186,
5.0183
],
[
40190,
0.4183
]
],
"bids": [
[
40178,
5
],
[
40174,
4.2
],
[
40170,
7.2
]
]
}
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"orderBook": {
"asks": [
[
40186,
5.0183
],
[
40190,
0.4183
]
],
"bids": [
[
40178,
5
],
[
40174,
4.2
],
[
40170,
7.2
]
]
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
orderBookoptional |
A structure containing lists with bid and ask prices and sizes. | OrderBook |
OrderBook
OrderBook example
{
"asks": [
[
40186,
5.0183
],
[
40190,
0.4183
]
],
"bids": [
[
40178,
5
],
[
40174,
4.2
],
[
40170,
7.2
]
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
asksoptional |
The first value of the inner list is the ask price, the second is the ask size. The outer list is sorted ascending by ask price. | Array array items: [Schema 2] |
bidsoptional |
The first value of the inner list is the bid price, the second is the bid size. The outer list is sorted descending by bid price. | Array array items: [Schema 3] |
Schema 2
Schema 2 example
[
40178,
5
]
An array of two floats. The first value is the price. The second value is the size.
Type: Array
Array of: Number. Array contains 2 items.
Schema 3
Schema 3 example
[
40178,
5
]
An array of two floats. The first value is the price. The second value is the size.
Type: Array
Array of: Number. Array contains 2 items.
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get tickers
GET
https://www.cryptofacilities.com/derivatives/api/v3/tickers
This endpoint returns current market data for all currently listed Futures contracts and indices.
Authentication is not required.
Response - application/json
Example response: success
GET /tickerscode 200application/json
{
"result": "success",
"serverTime": "2022-06-17T11:00:31.335Z",
"tickers": [
{
"ask": 49289,
"askSize": 139984,
"bid": 8634,
"bidSize": 1000,
"change24h": 1.9974017538161748,
"fundingRate": 1.18588737106e-7,
"fundingRatePrediction": 1.1852486794e-7,
"indexPrice": 21087.8,
"last": 49289,
"lastSize": 100,
"lastTime": "2022-06-17T10:46:35.705Z",
"markPrice": 30209.9,
"open24h": 49289,
"openInterest": 149655,
"pair": "XBT:USD",
"postOnly": false,
"suspended": false,
"symbol": "PI_XBTUSD",
"tag": "perpetual",
"vol24h": 15304,
"volumeQuote": 7305.2
},
{
"bid": 28002,
"bidSize": 900,
"change24h": 1.9974017538161748,
"indexPrice": 21087.8,
"last": 28002,
"lastSize": 100,
"lastTime": "2022-06-17T10:45:57.177Z",
"markPrice": 20478.5,
"open24h": 28002,
"openInterest": 10087,
"pair": "XBT:USD",
"postOnly": false,
"suspended": false,
"symbol": "FI_XBTUSD_211231",
"tag": "month",
"vol24h": 100,
"volumeQuote": 843.9
},
{
"last": 21088,
"lastTime": "2022-06-17T11:00:30.000Z",
"symbol": "in_xbtusd"
},
{
"last": 20938,
"lastTime": "2022-06-16T15:00:00.000Z",
"symbol": "rr_xbtusd"
}
]
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"tickers": [
{
"ask": 0.0,
"askSize": 0.0,
"bid": 0.0,
"bidSize": 0.0,
"change24h": 0.0,
"fundingRate": 0.0,
"fundingRatePrediction": 0.0,
"high24h": 0.0,
"indexPrice": 0.0,
"last": 0.0,
"lastSize": 0.0,
"lastTime": "string",
"low24h": 0.0,
"markPrice": 0.0,
"open24h": 0.0,
"openInterest": 0.0,
"pair": "string",
"postOnly": false,
"suspended": false,
"symbol": "string",
"tag": "string",
"vol24h": 0.0,
"volumeQuote": 0.0
}
]
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
tickersoptional |
A list containing a structures for each available instrument. The list is in no particular order. | Array array items: [TickerJson] |
TickerJson
TickerJson example
(Some parts of this example are auto-generated)
{
"ask": 0.0,
"askSize": 0.0,
"bid": 0.0,
"bidSize": 0.0,
"change24h": 0.0,
"fundingRate": 0.0,
"fundingRatePrediction": 0.0,
"high24h": 0.0,
"indexPrice": 0.0,
"last": 0.0,
"lastSize": 0.0,
"lastTime": "string",
"low24h": 0.0,
"markPrice": 0.0,
"open24h": 0.0,
"openInterest": 0.0,
"pair": "string",
"postOnly": false,
"suspended": false,
"symbol": "string",
"tag": "string",
"vol24h": 0.0,
"volumeQuote": 0.0
}
This is one of:
ContractTickerJson
ContractTickerJson example
(Some parts of this example are auto-generated)
{
"ask": 0.0,
"askSize": 0.0,
"bid": 0.0,
"bidSize": 0.0,
"change24h": 0.0,
"fundingRate": 0.0,
"fundingRatePrediction": 0.0,
"high24h": 0.0,
"indexPrice": 0.0,
"last": 0.0,
"lastSize": 0.0,
"lastTime": "string",
"low24h": 0.0,
"markPrice": 0.0,
"open24h": 0.0,
"openInterest": 0.0,
"pair": "string",
"postOnly": false,
"suspended": false,
"symbol": "string",
"tag": "string",
"vol24h": 0.0,
"volumeQuote": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
change24h |
The 24h change in price (%) | Number |
indexPrice |
Number | |
markPrice |
For futures: The price to which Kraken Futures currently marks the Futures for margining purposes For indices: Not returned because N/A |
Number |
openInterest |
For futures: The current open interest of the instrument For indices: Not returned because N/A |
Number |
pair |
For futures: The currency pair of the instrument For indices: Not returned because N/A |
String |
postOnly |
Boolean | |
suspended |
True if the market is suspended, False otherwise. | Boolean |
symbol |
The symbol of the Futures. | String |
tag |
For futures: Currently can be 'perpetual', 'month' or 'quarter'. Other tags may be added without notice For indices: Not returned because N/A |
String |
vol24h |
For futures: The sum of the sizes of all fills observed in the last 24 hours For indices: Not returned because N/A |
Number |
volumeQuote |
For futures: The sum of the size * price of all fills observed in the last 24 hours For indices: Not returned because N/A |
Number |
askoptional |
For futures: The price of the current best ask For indices: Not returned because N/A |
Number |
askSizeoptional |
For futures: The size of the current best ask For indices: Not returned because N/A |
Number |
bidoptional |
For futures: The price of the current best bid For indices: Not returned because N/A |
Number |
bidSizeoptional |
For futures: The size of the current best bid For indices: Not returned because N/A |
Number |
fundingRateoptional |
The current absolute funding rate. | Number |
fundingRatePredictionoptional |
The estimated next absolute funding rate. | Number |
high24hoptional |
For futures: The highest fill price observed in the last 24 hours For indices: Not returned because N/A |
Number |
lastoptional |
For futures: The price of the last fill For indices: The last calculated value |
Number |
lastSizeoptional |
For futures: The size of the last fill For indices: Not returned because N/A |
Number |
lastTimeoptional |
The date and time at which last was observed. | String |
low24hoptional |
For futures: The lowest fill price observed in the last 24 hours For indices: Not returned because N/A |
Number |
open24hoptional |
For futures: The price of the fill observed 24 hours ago For indices: Not returned because N/A |
Number |
SpotTickerJson
SpotTickerJson example
(Some parts of this example are auto-generated)
{
"last": 0.0,
"lastTime": "string",
"symbol": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
symbol |
The symbol of the index. | String |
lastoptional |
For futures: The price of the last fill For indices: The last calculated value |
Number |
lastTimeoptional |
The date and time at which last was observed. | String |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get ticker by symbol
GET
https://www.cryptofacilities.com/derivatives/api/v3/tickers/{symbol}
Get market data for contract or index by symbol
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
symbol |
path | Market symbol. Market symbol |
String regex pattern: [A-Z0-9_.]+ |
"PF_BTCUSD" |
Response
Example response: success
GET /tickers/{symbol}code 200application/json
{
"result": "success",
"serverTime": "2022-06-17T11:00:31.335Z",
"ticker": {
"ask": 49289,
"askSize": 139984,
"bid": 8634,
"bidSize": 1000,
"change24h": 1.9974017538161748,
"fundingRate": 1.18588737106e-7,
"fundingRatePrediction": 1.1852486794e-7,
"indexPrice": 21087.8,
"last": 49289,
"lastSize": 100,
"lastTime": "2022-06-17T10:46:35.705Z",
"markPrice": 30209.9,
"open24h": 49289,
"openInterest": 149655,
"pair": "XBT:USD",
"postOnly": false,
"suspended": false,
"symbol": "pi_xbtusd",
"tag": "perpetual",
"vol24h": 15304,
"volumeQuote": 40351.34
}
}
Example response
(Some parts of this example are auto-generated)GET /tickers/{symbol}code 404application/json
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
| Code | Description / Content type | Type |
|---|---|---|
| 200 | ||
application/json |
Schema 1 | |
| 404 | Contract could not be found | |
application/json |
ErrorResponse |
Schemas
Schema 1
Schema 1 example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"ticker": {
"ask": 0.0,
"askSize": 0.0,
"bid": 0.0,
"bidSize": 0.0,
"change24h": 0.0,
"fundingRate": 0.0,
"fundingRatePrediction": 0.0,
"high24h": 0.0,
"indexPrice": 0.0,
"last": 0.0,
"lastSize": 0.0,
"lastTime": "string",
"low24h": 0.0,
"markPrice": 0.0,
"open24h": 0.0,
"openInterest": 0.0,
"pair": "string",
"postOnly": false,
"suspended": false,
"symbol": "string",
"tag": "string",
"vol24h": 0.0,
"volumeQuote": 0.0
}
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
tickeroptional |
TickerJson |
TickerJson
TickerJson example
(Some parts of this example are auto-generated)
{
"ask": 0.0,
"askSize": 0.0,
"bid": 0.0,
"bidSize": 0.0,
"change24h": 0.0,
"fundingRate": 0.0,
"fundingRatePrediction": 0.0,
"high24h": 0.0,
"indexPrice": 0.0,
"last": 0.0,
"lastSize": 0.0,
"lastTime": "string",
"low24h": 0.0,
"markPrice": 0.0,
"open24h": 0.0,
"openInterest": 0.0,
"pair": "string",
"postOnly": false,
"suspended": false,
"symbol": "string",
"tag": "string",
"vol24h": 0.0,
"volumeQuote": 0.0
}
This is one of:
ContractTickerJson
ContractTickerJson example
(Some parts of this example are auto-generated)
{
"ask": 0.0,
"askSize": 0.0,
"bid": 0.0,
"bidSize": 0.0,
"change24h": 0.0,
"fundingRate": 0.0,
"fundingRatePrediction": 0.0,
"high24h": 0.0,
"indexPrice": 0.0,
"last": 0.0,
"lastSize": 0.0,
"lastTime": "string",
"low24h": 0.0,
"markPrice": 0.0,
"open24h": 0.0,
"openInterest": 0.0,
"pair": "string",
"postOnly": false,
"suspended": false,
"symbol": "string",
"tag": "string",
"vol24h": 0.0,
"volumeQuote": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
change24h |
The 24h change in price (%) | Number |
indexPrice |
Number | |
markPrice |
For futures: The price to which Kraken Futures currently marks the Futures for margining purposes For indices: Not returned because N/A |
Number |
openInterest |
For futures: The current open interest of the instrument For indices: Not returned because N/A |
Number |
pair |
For futures: The currency pair of the instrument For indices: Not returned because N/A |
String |
postOnly |
Boolean | |
suspended |
True if the market is suspended, False otherwise. | Boolean |
symbol |
The symbol of the Futures. | String |
tag |
For futures: Currently can be 'perpetual', 'month' or 'quarter'. Other tags may be added without notice For indices: Not returned because N/A |
String |
vol24h |
For futures: The sum of the sizes of all fills observed in the last 24 hours For indices: Not returned because N/A |
Number |
volumeQuote |
For futures: The sum of the size * price of all fills observed in the last 24 hours For indices: Not returned because N/A |
Number |
askoptional |
For futures: The price of the current best ask For indices: Not returned because N/A |
Number |
askSizeoptional |
For futures: The size of the current best ask For indices: Not returned because N/A |
Number |
bidoptional |
For futures: The price of the current best bid For indices: Not returned because N/A |
Number |
bidSizeoptional |
For futures: The size of the current best bid For indices: Not returned because N/A |
Number |
fundingRateoptional |
The current absolute funding rate. | Number |
fundingRatePredictionoptional |
The estimated next absolute funding rate. | Number |
high24hoptional |
For futures: The highest fill price observed in the last 24 hours For indices: Not returned because N/A |
Number |
lastoptional |
For futures: The price of the last fill For indices: The last calculated value |
Number |
lastSizeoptional |
For futures: The size of the last fill For indices: Not returned because N/A |
Number |
lastTimeoptional |
The date and time at which last was observed. | String |
low24hoptional |
For futures: The lowest fill price observed in the last 24 hours For indices: Not returned because N/A |
Number |
open24hoptional |
For futures: The price of the fill observed 24 hours ago For indices: Not returned because N/A |
Number |
SpotTickerJson
SpotTickerJson example
(Some parts of this example are auto-generated)
{
"last": 0.0,
"lastTime": "string",
"symbol": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
symbol |
The symbol of the index. | String |
lastoptional |
For futures: The price of the last fill For indices: The last calculated value |
Number |
lastTimeoptional |
The date and time at which last was observed. | String |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Order Management
Batch order management
POST
https://www.cryptofacilities.com/derivatives/api/v3/batchorder
This endpoint allows sending limit or stop order(s) and/or cancelling open order(s) and/or editing open order(s) for a currently listed Futures contract in batch.
When editing an order, if the trailingStopMaxDeviation and trailingStopDeviationUnit
parameters are sent unchanged, the system will recalculate a new stop price upon successful
order modification.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
json |
query | Contains the request body as a String | Batch Order As a string formatted as application/json |
|
algoIdoptional |
header | ID of the algorithm that is making the request. | String | |
processBeforeoptional |
query | The time before which the request should be processed, otherwise it is rejected. | String | "2023-11-08T19:56:35.441899Z" |
Response - application/json
Example response: success
POST /batchordercode 200application/json
{
"batchStatus": [
{
"dateTimeReceived": "2019-09-05T16:41:35.173Z",
"orderEvents": [
{
"order": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-05T16:41:35.173Z",
"limitPrice": 9400,
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"quantity": 1000,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-05T16:41:35.173Z",
"type": "lmt"
},
"reducedQuantity": null,
"type": "PLACE"
}
],
"order_id": "022774bc-2c4a-4f26-9317-436c8d85746d",
"order_tag": "1",
"status": "placed"
},
{
"orderEvents": [
{
"new": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-05T16:41:40.996Z",
"limitPrice": 9400,
"orderId": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"quantity": 1000,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-04T11:45:48.884Z",
"type": "lmt"
},
"old": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-04T11:45:48.884Z",
"limitPrice": 8500,
"orderId": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"quantity": 102,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-04T11:45:48.884Z",
"type": "lmt"
},
"reducedQuantity": null,
"type": "EDIT"
}
],
"order_id": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"status": "edited"
},
{
"orderEvents": [
{
"order": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-02T12:54:08.005Z",
"limitPrice": 8500,
"orderId": "566942c8-a3b5-4184-a451-622b09493129",
"quantity": 100,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-02T12:54:08.005Z",
"type": "lmt"
},
"type": "CANCEL",
"uid": "566942c8-a3b5-4184-a451-622b09493129"
}
],
"order_id": "566942c8-a3b5-4184-a451-622b09493129",
"status": "cancelled"
}
],
"result": "success",
"serverTime": "2019-09-05T16:41:40.996Z"
}
This is one of:
Schemas
Batch Order
Batch Order example
{
"batchOrder": [
{
"cliOrdId": "my_another_client_id",
"limitPrice": 1,
"order": "send",
"orderType": "lmt",
"order_tag": "1",
"side": "buy",
"size": 1,
"symbol": "PI_XBTUSD"
},
{
"limitPrice": 2,
"order": "send",
"orderType": "stp",
"order_tag": "2",
"side": "buy",
"size": 1,
"stopPrice": 3,
"symbol": "PI_XBTUSD"
},
{
"order": "cancel",
"order_id": "e35d61dd-8a30-4d5f-a574-b5593ef0c050"
},
{
"cliOrdId": "my_client_id",
"order": "cancel"
}
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
batchOrder |
A list containing structures of order sending and order cancellation instructions. The list is in no particular order. | Array array items: [Batch Instruction] |
Batch Instruction
Batch Instruction example
(Some parts of this example are auto-generated)
{
"cliOrdId": "my_another_client_id",
"limitPrice": 1,
"order": "send",
"orderType": "lmt",
"order_tag": "1",
"side": "buy",
"size": 1,
"symbol": "PI_XBTUSD"
}
This is one of the following, depending on the value of order:
send: BatchOrderSendedit: BatchOrderEditcancel: BatchOrderCancel
BatchOrderSend
BatchOrderSend example
{
"cliOrdId": "my_another_client_id",
"limitPrice": 1,
"order": "send",
"orderType": "lmt",
"order_tag": "1",
"side": "buy",
"size": 1,
"symbol": "PI_XBTUSD"
}
Type: Object
Object fields:
| Field | Description | Type | Default |
|---|---|---|---|
orderType |
Order type: - lmt - a limit order, - post - a post-only limit order, - take_profit - a take profit order or - stp - a stop order - trailing_stop - a trailing stop order |
String enum: "lmt", "ioc", "post", "stp", "take_profit" |
|
order_tag |
An arbitrary string provided client-side to tag the order for the purpose of mapping order sending instructions to the API's response. | String | |
side |
The direction of the order. | String enum: "buy", "sell" |
|
size |
The size associated with the order. | Number | |
symbol |
The symbol of the Futures. | String | |
cliOrdIdoptional |
The order identity that is specified from the user. It must be globally unique. | String max str len: 100 |
|
limitPriceoptional |
The limit price associated with the order. If placing a trailing_stop order then leave undefined. |
Number | |
orderoptional |
Always send. |
String value: "send" |
|
reduceOnlyoptional |
Set as 'true' if you wish the order to only reduce an existing position. Any order which increases an existing position will be rejected. Default 'false'. | Boolean | false |
stopPriceoptional |
The stop price associated with a stop order. Required if orderType is stp. Note that for stp orders, limitPrice is also required and denotes the worst price at which the stp order can get filled |
Number | |
trailingStopDeviationUnitoptional |
Required if the order type is trailing_stop.This defines how the trailing trigger price is calculated from the requested trigger signal. For example, if the max deviation is set to 10, the unit is 'PERCENT', and the underlying order is a sell, then the trigger price will never be more then 10% below the trigger signal. Similarly, if the deviation is 100, the unit is 'QUOTE_CURRENCY', the underlying order is a sell, and the contract is quoted in USD, then the trigger price will never be more than $100 below the trigger signal. |
String enum: "PERCENT", "QUOTE_CURRENCY" |
|
trailingStopMaxDeviationoptional |
Required if the order type is trailing_stop.Is the maximum distance the trailing stop's trigger price may trail behind the requested trigger signal. It defines the threshold at which the trigger price updates. |
Number | |
triggerSignaloptional |
String enum: "mark", "spot", "last" |
BatchOrderEdit
BatchOrderEdit example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"limitPrice": 0.0,
"order": "edit",
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"size": 0.0,
"stopPrice": 0.0,
"trailingStopDeviationUnit": "PERCENT",
"trailingStopMaxDeviation": 0.1
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdoptional |
Unique client order identifier. | Null or String max str len: 100 |
limitPriceoptional |
The limit price associated with the order. | Number |
orderoptional |
Always edit. |
String value: "edit" |
order_idoptional |
Order ID. | String format: uuid |
sizeoptional |
The size associated with the order. | Number |
stopPriceoptional |
The stop price associated with a stop order. Required if old orderType is stp. Note that for stp orders, limitPrice is also required and denotes the worst price at which the stp order can get filled. |
Number |
trailingStopDeviationUnitoptional |
Only relevant for trailing stop orders. This defines how the trailing trigger price is calculated from the requested trigger signal. For example, if the max deviation is set to 10, the unit is 'PERCENT', and the underlying order is a sell, then the trigger price will never be more then 10% below the trigger signal. Similarly, if the deviation is 100, the unit is 'QUOTE_CURRENCY', the underlying order is a sell, and the contract is quoted in USD, then the trigger price will never be more than $100 below the trigger signal. |
String enum: "PERCENT", "QUOTE_CURRENCY" |
trailingStopMaxDeviationoptional |
Only relevant for trailing stop orders. Maximum value of 50%, minimum value of 0.1% for 'PERCENT' 'maxDeviationUnit'. Is the maximum distance the trailing stop's trigger price may trail behind the requested trigger signal. It defines the threshold at which the trigger price updates. |
Number min: **0.1 max: **50 |
BatchOrderCancel
BatchOrderCancel example
{
"order": "cancel",
"order_id": "e35d61dd-8a30-4d5f-a574-b5593ef0c050"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdoptional |
Unique client order identifier. | Null or String max str len: 100 |
orderoptional |
Always cancel. |
String value: "cancel" |
order_idoptional |
Order ID. | String format: uuid |
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"batchStatus": [
{
"cliOrdId": "string",
"dateTimeReceived": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"order_id": "string",
"order_tag": "string",
"status": "placed"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
batchStatus |
A structure containing information on the send order request. | Array array items: [BatchInstructionResult] |
|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
BatchInstructionResult
BatchInstructionResult example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"dateTimeReceived": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"order_id": "string",
"order_tag": "string",
"status": "placed"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdoptional |
The unique client order identifier. This field is returned only if the order has a client order ID. | String |
dateTimeReceivedoptional |
The date and time the order was received. | Null or String |
orderEventsoptional |
Array array items: [OrderEvent] |
|
order_idoptional |
The unique identifier of the order. | Null or String |
order_tagoptional |
The arbitrary string provided client-side when the order was sent for the purpose of mapping order sending instructions to the API's response. | Null or String |
statusoptional |
The status of the order: - placed - the order was placed successfully - cancelled - the order was cancelled successfully - invalidOrderType - the order was not placed because orderType is invalid - invalidSide - the order was not placed because side is invalid - invalidSize - the order was not placed because size is invalid - invalidPrice - the order was not placed because limitPrice and/or stopPrice are invalid - insufficientAvailableFunds - the order was not placed because available funds are insufficient - selfFill - the order was not placed because it would be filled against an existing order belonging to the same account - tooManySmallOrders - the order was not placed because the number of small open orders would exceed the permissible limit - marketSuspended - the order was not placed because the market is suspended - marketInactive - the order was not placed because the market is inactive - clientOrderIdAlreadyExist - the specified client ID already exist - clientOrderIdTooLong - the client ID is longer than the permissible limit - outsidePriceCollar - the limit order crosses the spread but is an order of magnitude away from the mark price - fat finger control - postWouldExecute - the post-only order would be filled upon placement, thus is cancelled - iocWouldNotExecute - the immediate-or-cancel order would not execute |
String enum: "placed", "edited", "cancelled", "invalidOrderType", "invalidSide", "invalidSize", "invalidPrice", "insufficientAvailableFunds", "selfFill", "tooManySmallOrders", "marketSuspended", "marketInactive", "clientOrderIdAlreadyExist", "clientOrderIdTooLong", "outsidePriceCollar", "postWouldExecute", "iocWouldNotExecute" |
OrderEvent
OrderEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
This is one of:
PlaceEvent
PlaceEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
The placed order. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed before placement or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderJson
OrderJson example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
algoIdoptional |
Null or String | |
cliOrdIdoptional |
The client order id or null if order does not have one. | Null or String |
filledoptional |
The total amount of the order that has been filled. | Number |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Number |
orderIdoptional |
The UID associated with the order. | String |
quantityoptional |
The quantity (size) associated with the order. | Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind", "block" |
CancelEvent
CancelEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 2 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
The UID associated with the order. | String |
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
EditEvent
EditEvent example
(Some parts of this example are auto-generated)
{
"new": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"old": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "EDIT"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
newoptional |
The order after the edit was applied. | OrderJson |
oldoptional |
The order before the edit was applied. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EDIT. |
String value: "EDIT" |
RejectEvent
RejectEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reason": "POST_WOULD_EXECUTE",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 3 | |
reasonoptional |
The rejection reason: - POST_WOULD_EXECUTE - The post-only order would be filled upon placement, thus is cancelled. - IOC_WOULD_NOT_EXECUTE - The immediate-or-cancel order would not execute. |
String enum: "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE" |
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
The UID associated with the order. | String |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
ExecuteEvent
ExecuteEvent example
(Some parts of this example are auto-generated)
{
"amount": 0.0,
"executionId": "string",
"orderPriorEdit": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"orderPriorExecution": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"price": 0.0,
"takerReducedQuantity": 0.0,
"type": "EXECUTION"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
amountoptional |
The executed amount. | Number |
executionIdoptional |
The UID associated with the execution. | String |
orderPriorEditoptional |
Schema 4 | |
orderPriorExecutionoptional |
The order before it executes. | OrderJson |
priceoptional |
The price of the execution. | Number |
takerReducedQuantityoptional |
The amount of quantity that was removed from the order before execution or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EXECUTION. |
String value: "EXECUTION" |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
PlaceTriggerEvent
PlaceTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
OrderTriggerJson | |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderTriggerJson
OrderTriggerJson example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
clientIdoptional |
The client order id or null if order does not have one. | Null or String |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Null or Number |
quantityoptional |
The quantity (size) associated with the order. | Null or Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
startTimeoptional |
Null or String | |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
triggerPriceoptional |
Null or Number | |
triggerSideoptional |
Null or String enum: "trigger_above", "trigger_below" |
|
triggerSignaloptional |
Null or String enum: "mark_price", "last_price", "spot_price" |
|
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind" |
uidoptional |
The UID associated with the order. | String |
CancelTriggerEvent
CancelTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 5 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
String |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
RejectTriggerEvent
RejectTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"reason": "MARKET_SUSPENDED",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 6 | |
reasonoptional |
String enum: "MARKET_SUSPENDED", "MARKET_NOT_FOUND", "INVALID_PRICE", "INVALID_QUANTITY", "SMALL_ORDER_LIMIT_EXCEEDED", "INSUFFICIENT_MARGIN", "WOULD_CAUSE_LIQUIDATION", "CLIENT_ORDER_ID_IN_USE", "CLIENT_ORDER_ID_TOO_LONG", "MAX_POSITION_EXCEEDED", "PRICE_COLLAR", "PRICE_DISLOCATION", "EDIT_HAS_NO_EFFECT", "ORDER_FOR_CANCELLATION_NOT_FOUND", "ORDER_FOR_EDIT_NOT_FOUND", "ORDER_CANNOT_HAVE_TRIGGER_PRICE", "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE", "WOULD_EXECUTE_SELF", "WOULD_NOT_REDUCE_POSITION", "REJECTED_AFTER_EXECUTION", "MARKET_IS_POST_ONLY", "ORDER_LIMIT_EXCEEDED", "FIXED_LEVERAGE_TOO_HIGH", "CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP", "CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP", "TRAILING_STOP_ORDER_LIMIT_EXCEEDED", "TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES", "TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE", "TRAILING_STOP_MAX_DEVIATION_TOO_LARGE", "TRAILING_STOP_MAX_DEVIATION_TOO_SMALL", "INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP", "NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE", "INSUFFICIENT_CLOSING_MARGIN", "LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE", "LIMIT_PRICE_OFFSET_VALUE_INVALID", "LIMIT_PRICE_OFFSET_UNIT_INVALID", "LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT", "LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE", "LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES", "LIMIT_PRICE_OFFSET_TOO_HIGH", "LIMIT_PRICE_OFFSET_TOO_LOW" |
|
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
String |
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Cancel all orders
POST
https://www.cryptofacilities.com/derivatives/api/v3/cancelallorders
This endpoint allows cancelling orders which are associated with a future's contract or a margin account. If no arguments are specified all open orders will be cancelled.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
algoIdoptional |
header | ID of the algorithm that is making the request. | String |
symboloptional |
query | A futures product to cancel all open orders. | String |
Response - application/json
Example response: success
POST /cancelallorderscode 200application/json
{
"cancelStatus": {
"cancelOnly": "all",
"cancelledOrders": [
{
"order_id": "6180adfa-e4b1-4a52-adac-ea5417620dbd"
},
{
"order_id": "89e3edbe-d739-4c52-b866-6f5a8407ff6e"
},
{
"order_id": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7"
}
],
"orderEvents": [
{
"order": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-08-01T15:57:08.508Z",
"limitPrice": 10040,
"orderId": "89e3edbe-d739-4c52-b866-6f5a8407ff6e",
"quantity": 890,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-08-01T15:57:08.508Z",
"type": "post"
},
"type": "CANCEL",
"uid": "89e3edbe-d739-4c52-b866-6f5a8407ff6e"
},
{
"order": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-08-01T15:57:14.003Z",
"limitPrice": 10145,
"orderId": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7",
"quantity": 900,
"reduceOnly": true,
"side": "sell",
"symbol": "PI_XBTUSD",
"timestamp": "2019-08-01T15:57:14.003Z",
"type": "lmt"
},
"type": "CANCEL",
"uid": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7"
}
],
"receivedTime": "2019-08-01T15:57:37.518Z",
"status": "cancelled"
},
"result": "success",
"serverTime": "2019-08-01T15:57:37.520Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"cancelStatus": {
"cancelOnly": "string",
"cancelledOrders": [
{
"cliOrdId": "string",
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
],
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"type": "CANCEL",
"uid": "string"
}
],
"receivedTime": "string",
"status": "noOrdersToCancel"
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
cancelStatusoptional |
A structure containing information on the cancellation request. | CancelAllOrdersStatusJson |
CancelAllOrdersStatusJson
CancelAllOrdersStatusJson example
(Some parts of this example are auto-generated)
{
"cancelOnly": "string",
"cancelledOrders": [
{
"cliOrdId": "string",
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
],
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"type": "CANCEL",
"uid": "string"
}
],
"receivedTime": "string",
"status": "noOrdersToCancel"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cancelOnlyoptional |
The symbol of the futures or all. | String |
cancelledOrdersoptional |
A list of structures containing all the successfully cancelled orders. | Array array items: [OrderIdElement] |
orderEventsoptional |
Array array items: [CancelEvent] |
|
receivedTimeoptional |
The date and time the order cancellation was received. | String |
statusoptional |
The status of the order cancellation: - cancelled - successful cancellation - noOrdersToCancel - no open orders for cancellation |
String enum: "noOrdersToCancel", "cancelled" |
OrderIdElement
OrderIdElement example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Provide either order_id or cliOrdId.
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdoptional |
Unique client order identifier. | Null or String max str len: 100 |
order_idoptional |
Order ID. | String format: uuid |
CancelEvent
CancelEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 2 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
The UID associated with the order. | String |
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
OrderJson
OrderJson example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
algoIdoptional |
Null or String | |
cliOrdIdoptional |
The client order id or null if order does not have one. | Null or String |
filledoptional |
The total amount of the order that has been filled. | Number |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Number |
orderIdoptional |
The UID associated with the order. | String |
quantityoptional |
The quantity (size) associated with the order. | Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind", "block" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Dead man's switch
POST
https://www.cryptofacilities.com/derivatives/api/v3/cancelallordersafter
This endpoint provides a Dead Man's Switch mechanism to protect the user from network malfunctions. The user can send a request with a timeout in seconds which will trigger a countdown timer that will cancel all user orders when timeout expires. The user has to keep sending request to push back the timeout expiration or they can deactivate the mechanism by specifying a timeout of zero (0).
The recommended mechanism usage is making a call every 15 to 20 seconds and provide a timeout of 60 seconds. This allows the user to keep the orders in place on a brief network failure, while keeping them safe in case of a network breakdown.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
algoIdoptional |
header | ID of the algorithm that is making the request. | String | |
timeoutoptional |
query | The timeout specified in seconds. | Number format: uint32 |
60 |
Response - application/json
Example response: cancel
POST /cancelallordersaftercode 200application/json
{
"result": "success",
"serverTime": "2018-06-19T16:51:23.839Z",
"status": {
"currentTime": "2018-06-19T16:51:23.839Z",
"triggerTime": "0"
}
}
Example response: failure
POST /cancelallordersaftercode 200application/json
{
"error": "apiLimitExceeded",
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z"
}
Example response: success
POST /cancelallordersaftercode 200application/json
{
"result": "success",
"serverTime": "2018-06-19T16:51:23.839Z",
"status": {
"currentTime": "2018-06-19T16:51:23.839Z",
"triggerTime": "2018-06-19T16:52:23.839Z"
}
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"status": {
"currentTime": "string",
"triggerTime": "string"
}
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
statusoptional |
The status of the switch. | DeadManSwitchStatusJson |
DeadManSwitchStatusJson
DeadManSwitchStatusJson example
(Some parts of this example are auto-generated)
{
"currentTime": "string",
"triggerTime": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
currentTimeoptional |
The server date and time that server received the request. | String |
triggerTimeoptional |
The server date and time that the switch will be activated. | String |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Cancel order
POST
https://www.cryptofacilities.com/derivatives/api/v3/cancelorder
This endpoint allows cancelling an open order for a Futures contract.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
algoIdoptional |
header | ID of the algorithm that is making the request. | String | |
cliOrdIdoptional |
query | The client unique identifier of the order to be cancelled. | String | |
order_idoptional |
query | The unique identifier of the order to be cancelled. | String | |
processBeforeoptional |
query | The time before which the request should be processed, otherwise it is rejected. | String | "2023-11-08T19:56:35.441899Z" |
Response - application/json
Example response: success
POST /cancelordercode 200application/json
{
"cancelStatus": {
"orderEvents": [
{
"order": {
"cliOrdId": "1234568",
"filled": 0,
"lastUpdateTimestamp": "2020-07-22T13:25:56.366Z",
"limitPrice": 8000,
"orderId": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"quantity": 5500,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2020-07-22T13:25:56.366Z",
"type": "lmt"
},
"type": "CANCEL",
"uid": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47"
}
],
"order_id": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"receivedTime": "2020-07-22T13:26:20.806Z",
"status": "cancelled"
},
"result": "success",
"serverTime": "2020-07-22T13:26:20.806Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"cancelStatus": {
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"receivedTime": "string",
"status": "cancelled"
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
cancelStatusoptional |
A structure containing information on the cancellation request. | CancelOrderStatusJson |
CancelOrderStatusJson
CancelOrderStatusJson example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"receivedTime": "string",
"status": "cancelled"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdoptional |
The client order ID. Shown only if client specified one. | Null or String |
orderEventsoptional |
Array array items: [OrderEvent] |
|
order_idoptional |
The cancelled order UID | String format: uuid |
receivedTimeoptional |
The date and time the order cancellation was received. | String |
statusoptional |
The status of the order cancellation: - cancelled - The order has been cancelled. This may only be part of the order as part may have been filled. Check open_orders websocket feed for status of the order. - filled - The order was found completely filled and could not be cancelled - notFound - The order was not found, either because it had already been cancelled or it never existed |
String enum: "cancelled", "filled", "notFound" |
OrderEvent
OrderEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
This is one of:
PlaceEvent
PlaceEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
The placed order. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed before placement or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderJson
OrderJson example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
algoIdoptional |
Null or String | |
cliOrdIdoptional |
The client order id or null if order does not have one. | Null or String |
filledoptional |
The total amount of the order that has been filled. | Number |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Number |
orderIdoptional |
The UID associated with the order. | String |
quantityoptional |
The quantity (size) associated with the order. | Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind", "block" |
CancelEvent
CancelEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 2 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
The UID associated with the order. | String |
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
EditEvent
EditEvent example
(Some parts of this example are auto-generated)
{
"new": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"old": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "EDIT"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
newoptional |
The order after the edit was applied. | OrderJson |
oldoptional |
The order before the edit was applied. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EDIT. |
String value: "EDIT" |
RejectEvent
RejectEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reason": "POST_WOULD_EXECUTE",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 3 | |
reasonoptional |
The rejection reason: - POST_WOULD_EXECUTE - The post-only order would be filled upon placement, thus is cancelled. - IOC_WOULD_NOT_EXECUTE - The immediate-or-cancel order would not execute. |
String enum: "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE" |
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
The UID associated with the order. | String |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
ExecuteEvent
ExecuteEvent example
(Some parts of this example are auto-generated)
{
"amount": 0.0,
"executionId": "string",
"orderPriorEdit": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"orderPriorExecution": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"price": 0.0,
"takerReducedQuantity": 0.0,
"type": "EXECUTION"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
amountoptional |
The executed amount. | Number |
executionIdoptional |
The UID associated with the execution. | String |
orderPriorEditoptional |
Schema 4 | |
orderPriorExecutionoptional |
The order before it executes. | OrderJson |
priceoptional |
The price of the execution. | Number |
takerReducedQuantityoptional |
The amount of quantity that was removed from the order before execution or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EXECUTION. |
String value: "EXECUTION" |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
PlaceTriggerEvent
PlaceTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
OrderTriggerJson | |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderTriggerJson
OrderTriggerJson example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
clientIdoptional |
The client order id or null if order does not have one. | Null or String |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Null or Number |
quantityoptional |
The quantity (size) associated with the order. | Null or Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
startTimeoptional |
Null or String | |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
triggerPriceoptional |
Null or Number | |
triggerSideoptional |
Null or String enum: "trigger_above", "trigger_below" |
|
triggerSignaloptional |
Null or String enum: "mark_price", "last_price", "spot_price" |
|
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind" |
uidoptional |
The UID associated with the order. | String |
CancelTriggerEvent
CancelTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 5 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
String |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
RejectTriggerEvent
RejectTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"reason": "MARKET_SUSPENDED",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 6 | |
reasonoptional |
String enum: "MARKET_SUSPENDED", "MARKET_NOT_FOUND", "INVALID_PRICE", "INVALID_QUANTITY", "SMALL_ORDER_LIMIT_EXCEEDED", "INSUFFICIENT_MARGIN", "WOULD_CAUSE_LIQUIDATION", "CLIENT_ORDER_ID_IN_USE", "CLIENT_ORDER_ID_TOO_LONG", "MAX_POSITION_EXCEEDED", "PRICE_COLLAR", "PRICE_DISLOCATION", "EDIT_HAS_NO_EFFECT", "ORDER_FOR_CANCELLATION_NOT_FOUND", "ORDER_FOR_EDIT_NOT_FOUND", "ORDER_CANNOT_HAVE_TRIGGER_PRICE", "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE", "WOULD_EXECUTE_SELF", "WOULD_NOT_REDUCE_POSITION", "REJECTED_AFTER_EXECUTION", "MARKET_IS_POST_ONLY", "ORDER_LIMIT_EXCEEDED", "FIXED_LEVERAGE_TOO_HIGH", "CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP", "CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP", "TRAILING_STOP_ORDER_LIMIT_EXCEEDED", "TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES", "TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE", "TRAILING_STOP_MAX_DEVIATION_TOO_LARGE", "TRAILING_STOP_MAX_DEVIATION_TOO_SMALL", "INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP", "NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE", "INSUFFICIENT_CLOSING_MARGIN", "LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE", "LIMIT_PRICE_OFFSET_VALUE_INVALID", "LIMIT_PRICE_OFFSET_UNIT_INVALID", "LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT", "LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE", "LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES", "LIMIT_PRICE_OFFSET_TOO_HIGH", "LIMIT_PRICE_OFFSET_TOO_LOW" |
|
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
String |
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Edit order
POST
https://www.cryptofacilities.com/derivatives/api/v3/editorder
This endpoint allows editing an existing order for a currently listed Futures contract.
When editing an order, if the trailingStopMaxDeviation and trailingStopDeviationUnit
parameters are sent unchanged, the system will recalculate a new stop price upon successful
order modification.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
algoIdoptional |
header | ID of the algorithm that is making the request. | String | |
cliOrdIdoptional |
query | The order identity that is specified from the user. It must be globally unique (Required if orderId is not included) | String | |
limitPriceoptional |
query | The limit price associated with the order. Must not exceed the tick size of the contract. | Number | |
orderIdoptional |
query | ID of the order you wish to edit. (Required if CliOrdId is not included) | String | |
processBeforeoptional |
query | The time before which the request should be processed, otherwise it is rejected. | String | "2023-11-08T19:56:35.441899Z" |
sizeoptional |
query | The size associated with the order | Number | |
stopPriceoptional |
query | The stop price associated with a stop order. Required if old orderType is stp. Must not exceed tick size of the contract. Note that for stp orders, limitPrice is also required and denotes the worst price at which the stp order can get filled. | Number | |
trailingStopDeviationUnitoptional |
query | Only relevant for trailing stop orders. This defines how the trailing trigger price is calculated from the requested trigger signal. For example, if the max deviation is set to 10, the unit is 'PERCENT', and the underlying order is a sell, then the trigger price will never be more then 10% below the trigger signal. Similarly, if the deviation is 100, the unit is 'QUOTE_CURRENCY', the underlying order is a sell, and the contract is quoted in USD, then the trigger price will never be more than $100 below the trigger signal. |
String enum: "PERCENT", "QUOTE_CURRENCY" |
|
trailingStopMaxDeviationoptional |
query | Only relevant for trailing stop orders. Maximum value of 50%, minimum value of 0.1% for 'PERCENT' 'maxDeviationUnit'. Is the maximum distance the trailing stop's trigger price may trail behind the requested trigger signal. It defines the threshold at which the trigger price updates. |
Number min: **0.1 max: **50 |
Response - application/json
Example response: success
POST /editordercode 200application/json
{
"editStatus": {
"orderEvents": [
{
"new": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-05T16:47:47.519Z",
"limitPrice": 7200,
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"quantity": 1501,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-05T16:41:35.173Z",
"type": "lmt"
},
"old": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-05T16:41:35.173Z",
"limitPrice": 9400,
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"quantity": 1000,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-05T16:41:35.173Z",
"type": "lmt"
},
"reducedQuantity": null,
"type": "EDIT"
}
],
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"receivedTime": "2019-09-05T16:47:47.521Z",
"status": "edited"
},
"result": "success",
"serverTime": "2019-09-05T16:47:47.521Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"editStatus": {
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"orderId": "string",
"receivedTime": "string",
"status": "edited"
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
editStatusoptional |
A structure containing information on the send order request | EditOrderStatus |
EditOrderStatus
EditOrderStatus example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"orderId": "string",
"receivedTime": "string",
"status": "edited"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdoptional |
The unique client order identifier. This field is returned only if the order has a client order ID. |
Null or String |
orderEventsoptional |
Array array items: [OrderEvent] |
|
orderIdoptional |
The unique identifier of the order | Null or String |
receivedTimeoptional |
The date and time the order was received | Null or String |
statusoptional |
The status of the order, either of: - edited - The order was edited successfully - invalidSize - The order was not placed because size is invalid - invalidPrice - The order was not placed because limitPrice and/or stopPrice are invalid - insufficientAvailableFunds - The order was not placed because available funds are insufficient - selfFill - The order was not placed because it would be filled against an existing order belonging to the same account - tooManySmallOrders - The order was not placed because the number of small open orders would exceed the permissible limit - outsidePriceCollar - The limit order crosses the spread but is an order of magnitude away from the mark price - fat finger control - postWouldExecute - The post-only order would be filled upon placement, thus is cancelled - wouldNotReducePosition - The edit cannot be applied because the reduce only policy is violated. (Only for reduceOnly orders) - orderForEditNotFound - The requested order for edit has not been found - orderForEditNotAStop - The supplied stopPrice cannot be applied because order is not a stop order |
String enum: "edited", "invalidSize", "invalidPrice", "insufficientAvailableFunds", "selfFill", "tooManySmallOrders", "outsidePriceCollar", "postWouldExecute", "wouldNotReducePosition", "orderForEditNotFound", "orderForEditNotAStop" |
OrderEvent
OrderEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
This is one of:
PlaceEvent
PlaceEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
The placed order. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed before placement or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderJson
OrderJson example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
algoIdoptional |
Null or String | |
cliOrdIdoptional |
The client order id or null if order does not have one. | Null or String |
filledoptional |
The total amount of the order that has been filled. | Number |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Number |
orderIdoptional |
The UID associated with the order. | String |
quantityoptional |
The quantity (size) associated with the order. | Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind", "block" |
CancelEvent
CancelEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 2 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
The UID associated with the order. | String |
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
EditEvent
EditEvent example
(Some parts of this example are auto-generated)
{
"new": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"old": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "EDIT"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
newoptional |
The order after the edit was applied. | OrderJson |
oldoptional |
The order before the edit was applied. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EDIT. |
String value: "EDIT" |
RejectEvent
RejectEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reason": "POST_WOULD_EXECUTE",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 3 | |
reasonoptional |
The rejection reason: - POST_WOULD_EXECUTE - The post-only order would be filled upon placement, thus is cancelled. - IOC_WOULD_NOT_EXECUTE - The immediate-or-cancel order would not execute. |
String enum: "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE" |
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
The UID associated with the order. | String |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
ExecuteEvent
ExecuteEvent example
(Some parts of this example are auto-generated)
{
"amount": 0.0,
"executionId": "string",
"orderPriorEdit": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"orderPriorExecution": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"price": 0.0,
"takerReducedQuantity": 0.0,
"type": "EXECUTION"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
amountoptional |
The executed amount. | Number |
executionIdoptional |
The UID associated with the execution. | String |
orderPriorEditoptional |
Schema 4 | |
orderPriorExecutionoptional |
The order before it executes. | OrderJson |
priceoptional |
The price of the execution. | Number |
takerReducedQuantityoptional |
The amount of quantity that was removed from the order before execution or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EXECUTION. |
String value: "EXECUTION" |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
PlaceTriggerEvent
PlaceTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
OrderTriggerJson | |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderTriggerJson
OrderTriggerJson example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
clientIdoptional |
The client order id or null if order does not have one. | Null or String |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Null or Number |
quantityoptional |
The quantity (size) associated with the order. | Null or Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
startTimeoptional |
Null or String | |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
triggerPriceoptional |
Null or Number | |
triggerSideoptional |
Null or String enum: "trigger_above", "trigger_below" |
|
triggerSignaloptional |
Null or String enum: "mark_price", "last_price", "spot_price" |
|
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind" |
uidoptional |
The UID associated with the order. | String |
CancelTriggerEvent
CancelTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 5 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
String |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
RejectTriggerEvent
RejectTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"reason": "MARKET_SUSPENDED",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 6 | |
reasonoptional |
String enum: "MARKET_SUSPENDED", "MARKET_NOT_FOUND", "INVALID_PRICE", "INVALID_QUANTITY", "SMALL_ORDER_LIMIT_EXCEEDED", "INSUFFICIENT_MARGIN", "WOULD_CAUSE_LIQUIDATION", "CLIENT_ORDER_ID_IN_USE", "CLIENT_ORDER_ID_TOO_LONG", "MAX_POSITION_EXCEEDED", "PRICE_COLLAR", "PRICE_DISLOCATION", "EDIT_HAS_NO_EFFECT", "ORDER_FOR_CANCELLATION_NOT_FOUND", "ORDER_FOR_EDIT_NOT_FOUND", "ORDER_CANNOT_HAVE_TRIGGER_PRICE", "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE", "WOULD_EXECUTE_SELF", "WOULD_NOT_REDUCE_POSITION", "REJECTED_AFTER_EXECUTION", "MARKET_IS_POST_ONLY", "ORDER_LIMIT_EXCEEDED", "FIXED_LEVERAGE_TOO_HIGH", "CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP", "CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP", "TRAILING_STOP_ORDER_LIMIT_EXCEEDED", "TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES", "TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE", "TRAILING_STOP_MAX_DEVIATION_TOO_LARGE", "TRAILING_STOP_MAX_DEVIATION_TOO_SMALL", "INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP", "NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE", "INSUFFICIENT_CLOSING_MARGIN", "LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE", "LIMIT_PRICE_OFFSET_VALUE_INVALID", "LIMIT_PRICE_OFFSET_UNIT_INVALID", "LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT", "LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE", "LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES", "LIMIT_PRICE_OFFSET_TOO_HIGH", "LIMIT_PRICE_OFFSET_TOO_LOW" |
|
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
String |
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get initial margin requirements
GET
https://www.cryptofacilities.com/derivatives/api/v3/initialmargin
Returns initial margin requirements based on given order parameters.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
orderType |
query | The order type: - lmt - a limit order - mkt - an immediate-or-cancel order with 1% price protection |
String enum: "lmt", "mkt" |
side |
query | The direction of the order | String enum: "buy", "sell" |
size |
query | The size associated with the order. Note that different Futures have different contract sizes. | Number |
symbol |
query | The symbol of the Futures. | String |
limitPriceoptional |
query | The limit price associated with the order. | Number |
Response - application/json
The maximum order size
Example response
(Some parts of this example are auto-generated)GET /initialmargincode 200application/json
{
"error": "MARKET_SUSPENDED",
"estimatedLiquidationThreshold": 0.0,
"initialMargin": 0.0,
"price": 0.0
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"error": "MARKET_SUSPENDED",
"estimatedLiquidationThreshold": 0.0,
"initialMargin": 0.0,
"price": 0.0,
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
String enum: "MARKET_SUSPENDED", "MARKET_NOT_FOUND", "INVALID_PRICE", "INVALID_QUANTITY", "SMALL_ORDER_LIMIT_EXCEEDED", "INSUFFICIENT_MARGIN", "WOULD_CAUSE_LIQUIDATION", "CLIENT_ORDER_ID_IN_USE", "CLIENT_ORDER_ID_TOO_LONG", "MAX_POSITION_EXCEEDED", "PRICE_COLLAR", "PRICE_DISLOCATION", "EDIT_HAS_NO_EFFECT", "ORDER_FOR_CANCELLATION_NOT_FOUND", "ORDER_FOR_EDIT_NOT_FOUND", "ORDER_CANNOT_HAVE_TRIGGER_PRICE", "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE", "WOULD_EXECUTE_SELF", "WOULD_NOT_REDUCE_POSITION", "REJECTED_AFTER_EXECUTION", "MARKET_IS_POST_ONLY", "ORDER_LIMIT_EXCEEDED", "FIXED_LEVERAGE_TOO_HIGH", "CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP", "CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP", "TRAILING_STOP_ORDER_LIMIT_EXCEEDED", "TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES", "TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE", "TRAILING_STOP_MAX_DEVIATION_TOO_LARGE", "TRAILING_STOP_MAX_DEVIATION_TOO_SMALL", "INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP", "NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE", "INSUFFICIENT_CLOSING_MARGIN", "LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE", "LIMIT_PRICE_OFFSET_VALUE_INVALID", "LIMIT_PRICE_OFFSET_UNIT_INVALID", "LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT", "LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE", "LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES", "LIMIT_PRICE_OFFSET_TOO_HIGH", "LIMIT_PRICE_OFFSET_TOO_LOW" |
||
estimatedLiquidationThresholdoptional |
The estimated liquidation price after execution | Number | |
initialMarginoptional |
The initial margin requirement or null if there is no market | Number | |
priceoptional |
The limit price of the order or null if the order type was mkt and there is no market |
Number |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get maximum order size
GET
https://www.cryptofacilities.com/derivatives/api/v3/initialmargin/maxordersize
This endpoint is only supported for multi-collateral futures.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
orderType |
query | The order type: - lmt - a limit order - mkt - an immediate-or-cancel order with 1% price protection |
String enum: "lmt", "mkt" |
symbol |
query | The symbol of the Futures. | String |
limitPriceoptional |
query | The limit price if orderType is lmt |
Number |
Response - application/json
The maximum order size
Example response
(Some parts of this example are auto-generated)GET /initialmargin/maxordersizecode 200application/json
{
"buyPrice": 0.0,
"maxBuySize": 0.0,
"maxSellSize": 0.0,
"sellPrice": 0.0
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"buyPrice": 0.0,
"maxBuySize": 0.0,
"maxSellSize": 0.0,
"result": "success",
"sellPrice": 0.0,
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
buyPriceoptional |
The limit price of the buy order or null if the order type was mkt and there is no market |
Number | |
maxBuySizeoptional |
The maximum size of a buy order at the limit price or null if there is no market | Number | |
maxSellSizeoptional |
The maximum size of a sell order at the limit price or null if there is no market | Number | |
sellPriceoptional |
The limit price of the sell order or null if the order type was mkt and there is no market |
Number |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get open orders
GET
https://www.cryptofacilities.com/derivatives/api/v3/openorders
This endpoint returns information on all open orders for all Futures contracts.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response: success
GET /openorderscode 200application/json
{
"openOrders": [
{
"filledSize": 0,
"lastUpdateTime": "2019-09-05T17:01:17.410Z",
"limitPrice": 10640,
"orderType": "lmt",
"order_id": "59302619-41d2-4f0b-941f-7e7914760ad3",
"receivedTime": "2019-09-05T17:01:17.410Z",
"reduceOnly": true,
"side": "sell",
"status": "untouched",
"symbol": "PI_XBTUSD",
"unfilledSize": 304
},
{
"filledSize": 0,
"lastUpdateTime": "2019-09-05T16:47:47.519Z",
"limitPrice": 7200,
"orderType": "lmt",
"order_id": "022774bc-2c4a-4f26-9317-436c8d85746d",
"receivedTime": "2019-09-05T16:41:35.173Z",
"reduceOnly": false,
"side": "buy",
"status": "untouched",
"symbol": "PI_XBTUSD",
"unfilledSize": 1501
},
{
"filledSize": 0,
"lastUpdateTime": "2019-09-05T16:38:43.651Z",
"limitPrice": 10640,
"orderType": "lmt",
"order_id": "d08021f7-58cb-4f2c-9c86-da4c60de46bb",
"receivedTime": "2019-09-05T16:38:43.651Z",
"reduceOnly": true,
"side": "sell",
"status": "untouched",
"symbol": "PI_XBTUSD",
"unfilledSize": 10000
},
{
"filledSize": 0,
"lastUpdateTime": "2019-09-05T16:33:50.734Z",
"limitPrice": 9400,
"orderType": "lmt",
"order_id": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"receivedTime": "2019-09-05T16:33:50.734Z",
"reduceOnly": false,
"side": "buy",
"status": "untouched",
"symbol": "PI_XBTUSD",
"unfilledSize": 10000
},
{
"filledSize": 0,
"lastUpdateTime": "2019-09-05T16:41:40.996Z",
"limitPrice": 9400,
"orderType": "lmt",
"order_id": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"receivedTime": "2019-09-04T11:45:48.884Z",
"reduceOnly": false,
"side": "buy",
"status": "untouched",
"symbol": "PI_XBTUSD",
"unfilledSize": 1000
},
{
"filledSize": 0,
"lastUpdateTime": "2019-09-03T12:52:17.945Z",
"limitPrice": 8500,
"orderType": "lmt",
"order_id": "3deea5c8-0274-4d33-988c-9e5a3895ccf8",
"receivedTime": "2019-09-03T12:52:17.945Z",
"reduceOnly": false,
"side": "buy",
"status": "untouched",
"symbol": "PI_XBTUSD",
"unfilledSize": 102
},
{
"filledSize": 0,
"lastUpdateTime": "2019-09-02T12:54:34.347Z",
"limitPrice": 7200,
"orderType": "lmt",
"order_id": "fcbb1459-6ed2-4b3c-a58c-67c4df7412cf",
"receivedTime": "2019-09-02T12:54:34.347Z",
"reduceOnly": false,
"side": "buy",
"status": "untouched",
"symbol": "PI_XBTUSD",
"unfilledSize": 1501
}
],
"result": "success",
"serverTime": "2019-09-05T17:08:18.138Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"openOrders": [
{
"algoId": "string",
"cliOrdId": "string",
"filledSize": 0.0,
"lastUpdateTime": "string",
"limitPrice": 0.0,
"orderType": "lmt",
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"receivedTime": "string",
"reduceOnly": false,
"side": "buy",
"status": "untouched",
"stopPrice": 0.0,
"symbol": "string",
"triggerSignal": "mark",
"unfilledSize": 0.0
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
openOrdersoptional |
A list containing structures with information on open orders. The list is sorted descending by receivedTime. | Array array items: [OpenOrderJson] |
OpenOrderJson
OpenOrderJson example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filledSize": 0.0,
"lastUpdateTime": "string",
"limitPrice": 0.0,
"orderType": "lmt",
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"receivedTime": "string",
"reduceOnly": false,
"side": "buy",
"status": "untouched",
"stopPrice": 0.0,
"symbol": "string",
"triggerSignal": "mark",
"unfilledSize": 0.0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
algoIdoptional |
ID of the algorithm that placed the order. | Null or String |
cliOrdIdoptional |
The unique client order identifier. This field is returned only if the order has a client order ID. | Null or String |
filledSizeoptional |
The filled size associated with the order. | Null or Number |
lastUpdateTimeoptional |
The date and time the order was last updated. | String |
limitPriceoptional |
The limit price associated with the order. | Null or Number |
orderTypeoptional |
The order type: - lmt - limit order - stp - stop order - take_profit - take profit order |
String enum: "lmt", "stop", "take_profit" |
order_idoptional |
The unique identifier of the order. | String format: uuid |
receivedTimeoptional |
The date and time the order was received. | String |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The direction of the order. | String enum: "buy", "sell" |
statusoptional |
The status of the order: - untouched - the entire size of the order is unfilled - partiallyFilled - the size of the order is partially but not entirely filled |
String enum: "untouched", "partiallyFilled" |
stopPriceoptional |
If orderType is stp: The stop price associated with the orderIf orderType is lmt: Not returned because N/A |
Null or Number |
symboloptional |
The symbol of the futures to which the order refers. | String |
triggerSignaloptional |
The trigger signal for the stop or take profit order. | Null or String enum: "mark", "last", "spot" |
unfilledSizeoptional |
The unfilled size associated with the order. | Number |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get Specific Orders' Status
POST
https://www.cryptofacilities.com/derivatives/api/v3/orders/status
Returns information on specified orders which are open or were filled/cancelled in the last 5 seconds.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Request body - application/x-www-form-urlencoded
Example request body
POST /orders/statusapplication/x-www-form-urlencoded
{
"cliOrdIds": [
"testOrder1",
"testOrder2"
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdsoptional |
Client Order IDs associated with orders or triggers. | Array array items: [String] |
orderIdsoptional |
UIDs associated with orders or triggers. | Array array items: [String (uuid)] |
Response - application/json
Example response
(Some parts of this example are auto-generated)POST /orders/statuscode 200application/json
{
"orders": [
{
"error": "string",
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"priceTriggerOptions": {
"triggerPrice": 0.0,
"triggerSide": "TRIGGER_ABOVE",
"triggerSignal": "MARK_PRICE"
},
"quantity": 0.0,
"reduceOnly": false,
"side": "string",
"symbol": "string",
"timestamp": "string",
"triggerTime": "string",
"type": "TRIGGER_ORDER"
},
"status": "ENTERED_BOOK",
"updateReason": "string"
}
]
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"orders": [
{
"error": "string",
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"priceTriggerOptions": {
"triggerPrice": 0.0,
"triggerSide": "TRIGGER_ABOVE",
"triggerSignal": "MARK_PRICE"
},
"quantity": 0.0,
"reduceOnly": false,
"side": "string",
"symbol": "string",
"timestamp": "string",
"triggerTime": "string",
"type": "TRIGGER_ORDER"
},
"status": "ENTERED_BOOK",
"updateReason": "string"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
ordersoptional |
Array array items: [OrderStatusDetailsJson] |
OrderStatusDetailsJson
OrderStatusDetailsJson example
(Some parts of this example are auto-generated)
{
"error": "string",
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"priceTriggerOptions": {
"triggerPrice": 0.0,
"triggerSide": "TRIGGER_ABOVE",
"triggerSignal": "MARK_PRICE"
},
"quantity": 0.0,
"reduceOnly": false,
"side": "string",
"symbol": "string",
"timestamp": "string",
"triggerTime": "string",
"type": "TRIGGER_ORDER"
},
"status": "ENTERED_BOOK",
"updateReason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
erroroptional |
Schema 3 |
orderoptional |
CachedOrderJson |
statusoptional |
String enum: "ENTERED_BOOK", "FULLY_EXECUTED", "REJECTED", "CANCELLED", "TRIGGER_PLACED", "TRIGGER_ACTIVATION_FAILURE" |
updateReasonoptional |
Schema 5 |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
"string"
This is one of:
String (enum:
"MARKET_SUSPENDED","MARKET_NOT_FOUND","INVALID_PRICE","INVALID_QUANTITY","SMALL_ORDER_LIMIT_EXCEEDED","INSUFFICIENT_MARGIN","WOULD_CAUSE_LIQUIDATION","CLIENT_ORDER_ID_IN_USE","CLIENT_ORDER_ID_TOO_LONG","MAX_POSITION_EXCEEDED","PRICE_COLLAR","PRICE_DISLOCATION","EDIT_HAS_NO_EFFECT","ORDER_FOR_CANCELLATION_NOT_FOUND","ORDER_FOR_EDIT_NOT_FOUND","ORDER_CANNOT_HAVE_TRIGGER_PRICE","POST_WOULD_EXECUTE","IOC_WOULD_NOT_EXECUTE","WOULD_EXECUTE_SELF","WOULD_NOT_REDUCE_POSITION","REJECTED_AFTER_EXECUTION","MARKET_IS_POST_ONLY","ORDER_LIMIT_EXCEEDED","FIXED_LEVERAGE_TOO_HIGH","CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP","CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP","TRAILING_STOP_ORDER_LIMIT_EXCEEDED","TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES","TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE","TRAILING_STOP_MAX_DEVIATION_TOO_LARGE","TRAILING_STOP_MAX_DEVIATION_TOO_SMALL","INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP","NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE","INSUFFICIENT_CLOSING_MARGIN","LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE","LIMIT_PRICE_OFFSET_VALUE_INVALID","LIMIT_PRICE_OFFSET_UNIT_INVALID","LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT","LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE","LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES","LIMIT_PRICE_OFFSET_TOO_HIGH","LIMIT_PRICE_OFFSET_TOO_LOW")Null
CachedOrderJson
CachedOrderJson example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"priceTriggerOptions": {
"triggerPrice": 0.0,
"triggerSide": "TRIGGER_ABOVE",
"triggerSignal": "MARK_PRICE"
},
"quantity": 0.0,
"reduceOnly": false,
"side": "string",
"symbol": "string",
"timestamp": "string",
"triggerTime": "string",
"type": "TRIGGER_ORDER"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
algoIdoptional |
ID of the algorithm that placed the order. | Null or String |
cliOrdIdoptional |
Null or String | |
filledoptional |
Null or Number | |
lastUpdateTimestampoptional |
String | |
limitPriceoptional |
Null or Number | |
orderIdoptional |
String format: uuid |
|
priceTriggerOptionsoptional |
Schema 4 | |
quantityoptional |
Null or Number | |
reduceOnlyoptional |
Boolean | |
sideoptional |
String | |
symboloptional |
String | |
timestampoptional |
String | |
triggerTimeoptional |
Null or String | |
typeoptional |
String enum: "TRIGGER_ORDER", "ORDER" |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"triggerPrice": 0.0,
"triggerSide": "TRIGGER_ABOVE",
"triggerSignal": "MARK_PRICE"
}
This is one of:
Null
TriggerOptions
TriggerOptions example
(Some parts of this example are auto-generated)
{
"triggerPrice": 0.0,
"triggerSide": "TRIGGER_ABOVE",
"triggerSignal": "MARK_PRICE"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
triggerPriceoptional |
Number |
triggerSideoptional |
String enum: "TRIGGER_ABOVE", "TRIGGER_BELOW" |
triggerSignaloptional |
String enum: "MARK_PRICE", "LAST_PRICE", "SPOT_PRICE" |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
"string"
This is one of:
String (enum:
"LOADING_MARKET","NEW_USER_ORDER","LIQUIDATION_ORDER","STOP_ORDER_TRIGGERED","LIMIT_FROM_STOP","PARTIAL_FILL","FULL_FILL","CANCELLED_BY_USER","CONTRACT_EXPIRED","NOT_ENOUGH_MARGIN","MARKET_INACTIVE","DEAD_MAN_SWITCH","CANCELLED_BY_ADMIN","POST_WOULD_EXECUTE_REASON","IOC_WOULD_NOT_EXECUTE_REASON","WOULD_EXECUTE_SELF_REASON","WOULD_NOT_REDUCE_POSITION","EDITED_BY_USER","ORDER_FOR_EDIT_NOT_FOUND_REASON","EXPIRED","TRAILING_STOP_PRICE_UPDATED","TRAILING_STOP_CANCELLED_AND_REPLACED_BY_ADMIN")Null
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Send order
POST
https://www.cryptofacilities.com/derivatives/api/v3/sendorder
This endpoint allows sending a limit, stop, take profit or immediate-or-cancel order for a currently listed Futures contract.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
orderType |
query | The order type: - lmt - a limit order - post - a post-only limit order - mkt - an immediate-or-cancel order with 1% price protection - stp - a stop order - take_profit - a take profit order - ioc - an immediate-or-cancel order - trailing_stop - a trailing stop order |
String enum: "lmt", "post", "ioc", "mkt", "stp", "take_profit", "trailing_stop" |
|
side |
query | The direction of the order | String enum: "buy", "sell" |
|
size |
query | The size associated with the order. Note that different Futures have different contract sizes. | Number | |
symbol |
query | The symbol of the Futures | String | |
algoIdoptional |
header | ID of the algorithm that is making the request. | String | |
cliOrdIdoptional |
query | The order identity that is specified from the user. It must be globally unique. | String max str len: 100 |
|
limitPriceoptional |
query | The limit price associated with the order. Note that for stop orders, limitPrice denotes the worst price at which the stp or take_profit order can get filled at. If no limitPrice is provided the stp or take_profit order will trigger a market order. If placing a trailing_stop order then leave undefined. |
Number | |
limitPriceOffsetUnitoptional |
query | Can only be set together with limitPriceOffsetValue. This defines the unit for the relative limit price distance from the trigger's stopPrice. |
String enum: "QUOTE_CURRENCY", "PERCENT" |
|
limitPriceOffsetValueoptional |
query | Can only be set for triggers, e.g. order types take_profit, stop and trailing_stop. If set, limitPriceOffsetUnit must be set as well. This defines a relative limit price depending on the trigger stopPrice. The price is determined when the trigger is activated by the triggerSignal. The offset can be positive or negative, there might be restrictions on the value depending on the limitPriceOffsetUnit. |
Number | |
processBeforeoptional |
query | The time before which the request should be processed, otherwise it is rejected. | String | "2023-11-08T19:56:35.441899Z" |
reduceOnlyoptional |
query | Set as true if you wish the order to only reduce an existing position. Any order which increases an existing position will be rejected. Default false. |
Boolean | |
stopPriceoptional |
query | The stop price associated with a stop or take profit order. Required if orderType is stp or take_profit, but if placing a trailing_stop then leave undefined. Note that for stop orders, limitPrice denotes the worst price at which the stp or take_profit order can get filled at. If no limitPrice is provided the stp or take_profit order will trigger a market order. |
Number | |
trailingStopDeviationUnitoptional |
query | Required if the order type is trailing_stop.This defines how the trailing trigger price is calculated from the requested trigger signal. For example, if the max deviation is set to 10, the unit is 'PERCENT', and the underlying order is a sell, then the trigger price will never be more then 10% below the trigger signal. Similarly, if the deviation is 100, the unit is 'QUOTE_CURRENCY', the underlying order is a sell, and the contract is quoted in USD, then the trigger price will never be more than $100 below the trigger signal. |
String enum: "PERCENT", "QUOTE_CURRENCY" |
|
trailingStopMaxDeviationoptional |
query | Required if the order type is trailing_stop. Maximum value of 50%, minimum value of 0.1% for 'PERCENT' 'maxDeviationUnit'.Is the maximum distance the trailing stop's trigger price may trail behind the requested trigger signal. It defines the threshold at which the trigger price updates. |
Number min: **0.1 max: **50 |
|
triggerSignaloptional |
query | If placing a stp, take_profit or trailing_stop, the signal used for trigger.- mark - the mark price - index - the index price - last - the last executed trade |
String enum: "mark", "spot", "last" |
Response - application/json
Example response: executed
POST /sendordercode 200application/json
{
"result": "success",
"sendStatus": {
"orderEvents": [
{
"amount": 10,
"executionId": "e1ec9f63-2338-4c44-b40a-43486c6732d7",
"orderPriorEdit": null,
"orderPriorExecution": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-12-11T17:17:33.888Z",
"limitPrice": 7500,
"orderId": "61ca5732-3478-42fe-8362-abbfd9465294",
"quantity": 10,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-12-11T17:17:33.888Z",
"type": "lmt"
},
"price": 7244.5,
"takerReducedQuantity": null,
"type": "EXECUTION"
}
],
"order_id": "61ca5732-3478-42fe-8362-abbfd9465294",
"receivedTime": "2019-12-11T17:17:33.888Z",
"status": "placed"
},
"serverTime": "2019-12-11T17:17:33.888Z"
}
Example response: placed
POST /sendordercode 200application/json
{
"result": "success",
"sendStatus": {
"orderEvents": [
{
"order": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-05T16:33:50.734Z",
"limitPrice": 9400,
"orderId": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"quantity": 10000,
"reduceOnly": false,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-05T16:33:50.734Z",
"type": "lmt"
},
"reducedQuantity": null,
"type": "PLACE"
}
],
"order_id": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"receivedTime": "2019-09-05T16:33:50.734Z",
"status": "placed"
},
"serverTime": "2019-09-05T16:33:50.734Z"
}
Example response: rejected
POST /sendordercode 200application/json
{
"result": "success",
"sendStatus": {
"orderEvents": [
{
"order": {
"cliOrdId": null,
"filled": 0,
"lastUpdateTimestamp": "2019-09-05T16:32:54.076Z",
"limitPrice": 9400,
"orderId": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"quantity": 10000,
"reduceOnly": true,
"side": "buy",
"symbol": "PI_XBTUSD",
"timestamp": "2019-09-05T16:32:54.076Z",
"type": "lmt"
},
"reason": "IOC_WOULD_NOT_EXECUTE",
"type": "REJECT",
"uid": "614a5298-0071-450f-83c6-0617ce8c6bc4"
}
],
"order_id": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"receivedTime": "2019-09-05T16:32:54.076Z",
"status": "iocWouldNotExecute"
},
"serverTime": "2019-09-05T16:32:54.077Z"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"result": "success",
"sendStatus": {
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"receivedTime": "string",
"status": "placed"
},
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
sendStatusoptional |
A structure containing information on the send order request. | SendOrderJson |
SendOrderJson
SendOrderJson example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
],
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"receivedTime": "string",
"status": "placed"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
cliOrdIdoptional |
The unique client order identifier. This field is returned only if the order has a client order ID. | Null or String |
orderEventsoptional |
Array array items: [OrderEvent] |
|
order_idoptional |
The unique identifier of the order | String format: uuid |
receivedTimeoptional |
The date and time the order was received. | String |
statusoptional |
The status of the order, either of: - placed - the order was placed successfully - cancelled - the order was cancelled successfully - invalidOrderType - the order was not placed because orderType is invalid - invalidSide - the order was not placed because side is invalid - invalidSize - the order was not placed because size is invalid - invalidPrice - the order was not placed because limitPrice and/or stopPrice are invalid - insufficientAvailableFunds - the order was not placed because available funds are insufficient - selfFill - the order was not placed because it would be filled against an existing order belonging to the same account - tooManySmallOrders - the order was not placed because the number of small open orders would exceed the permissible limit - maxPositionViolation - Order would cause you to exceed your maximum position in this contract. - marketSuspended - the order was not placed because the market is suspended - marketInactive - the order was not placed because the market is inactive - clientOrderIdAlreadyExist - the specified client id already exist - clientOrderIdTooLong - the client id is longer than the permissible limit - outsidePriceCollar - the order would have executed outside of the price collar for its order type - postWouldExecute - the post-only order would be filled upon placement, thus is cancelled - iocWouldNotExecute - the immediate-or-cancel order would not execute. - wouldCauseLiquidation - returned when a new order would fill at a worse price than the mark price, causing the portfolio value to fall below maintenance margin and triggering a liquidation. - wouldNotReducePosition - the reduce only order would not reduce position. - wouldProcessAfterSpecifiedTime - order would be processed after the time specified in processBefore parameter. |
String enum: "placed", "partiallyFilled", "filled", "cancelled", "edited", "marketSuspended", "marketInactive", "invalidPrice", "invalidSize", "tooManySmallOrders", "insufficientAvailableFunds", "wouldCauseLiquidation", "clientOrderIdAlreadyExist", "clientOrderIdTooBig", "maxPositionViolation", "outsidePriceCollar", "wouldIncreasePriceDislocation", "notFound", "orderForEditNotAStop", "orderForEditNotFound", "postWouldExecute", "iocWouldNotExecute", "selfFill", "wouldNotReducePosition", "marketIsPostOnly", "tooManyOrders", "fixedLeverageTooHigh", "clientOrderIdInvalid", "cannotEditTriggerPriceOfTrailingStop", "cannotEditLimitPriceOfTrailingStop", "wouldProcessAfterSpecifiedTime" |
OrderEvent
OrderEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
This is one of:
PlaceEvent
PlaceEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
The placed order. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed before placement or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderJson
OrderJson example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
algoIdoptional |
Null or String | |
cliOrdIdoptional |
The client order id or null if order does not have one. | Null or String |
filledoptional |
The total amount of the order that has been filled. | Number |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Number |
orderIdoptional |
The UID associated with the order. | String |
quantityoptional |
The quantity (size) associated with the order. | Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind", "block" |
CancelEvent
CancelEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 2 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
The UID associated with the order. | String |
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
EditEvent
EditEvent example
(Some parts of this example are auto-generated)
{
"new": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"old": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reducedQuantity": 0.0,
"type": "EDIT"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
newoptional |
The order after the edit was applied. | OrderJson |
oldoptional |
The order before the edit was applied. | OrderJson |
reducedQuantityoptional |
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EDIT. |
String value: "EDIT" |
RejectEvent
RejectEvent example
(Some parts of this example are auto-generated)
{
"order": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"reason": "POST_WOULD_EXECUTE",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderoptional |
Schema 3 | |
reasonoptional |
The rejection reason: - POST_WOULD_EXECUTE - The post-only order would be filled upon placement, thus is cancelled. - IOC_WOULD_NOT_EXECUTE - The immediate-or-cancel order would not execute. |
String enum: "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE" |
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
The UID associated with the order. | String |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
ExecuteEvent
ExecuteEvent example
(Some parts of this example are auto-generated)
{
"amount": 0.0,
"executionId": "string",
"orderPriorEdit": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"orderPriorExecution": {
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
},
"price": 0.0,
"takerReducedQuantity": 0.0,
"type": "EXECUTION"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
amountoptional |
The executed amount. | Number |
executionIdoptional |
The UID associated with the execution. | String |
orderPriorEditoptional |
Schema 4 | |
orderPriorExecutionoptional |
The order before it executes. | OrderJson |
priceoptional |
The price of the execution. | Number |
takerReducedQuantityoptional |
The amount of quantity that was removed from the order before execution or null if the order is not a reduce only. | Null or Number |
typeoptional |
Always EXECUTION. |
String value: "EXECUTION" |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"algoId": "string",
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "string",
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"symbol": "string",
"timestamp": "string",
"type": "lmt"
}
This is one of:
Null
PlaceTriggerEvent
PlaceTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "PLACE"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
OrderTriggerJson | |
typeoptional |
Always PLACE. |
String value: "PLACE" |
OrderTriggerJson
OrderTriggerJson example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
clientIdoptional |
The client order id or null if order does not have one. | Null or String |
lastUpdateTimestampoptional |
The date and time the order was edited. | String |
limitPriceoptional |
The limit price associated with a limit order. | Null or Number |
quantityoptional |
The quantity (size) associated with the order. | Null or Number |
reduceOnlyoptional |
Is the order a reduce only order or not. | Boolean |
sideoptional |
The side associated with the order | String enum: "buy", "sell" |
startTimeoptional |
Null or String | |
symboloptional |
The symbol of the Futures. | String |
timestampoptional |
The date and time the order was placed. | String |
triggerPriceoptional |
Null or Number | |
triggerSideoptional |
Null or String enum: "trigger_above", "trigger_below" |
|
triggerSignaloptional |
Null or String enum: "mark_price", "last_price", "spot_price" |
|
typeoptional |
The order type | String enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind" |
uidoptional |
The UID associated with the order. | String |
CancelTriggerEvent
CancelTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"type": "CANCEL",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 5 | |
typeoptional |
Always CANCEL. |
String value: "CANCEL" |
uidoptional |
String |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
RejectTriggerEvent
RejectTriggerEvent example
(Some parts of this example are auto-generated)
{
"orderTrigger": {
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
},
"reason": "MARKET_SUSPENDED",
"type": "REJECT",
"uid": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
orderTriggeroptional |
Schema 6 | |
reasonoptional |
String enum: "MARKET_SUSPENDED", "MARKET_NOT_FOUND", "INVALID_PRICE", "INVALID_QUANTITY", "SMALL_ORDER_LIMIT_EXCEEDED", "INSUFFICIENT_MARGIN", "WOULD_CAUSE_LIQUIDATION", "CLIENT_ORDER_ID_IN_USE", "CLIENT_ORDER_ID_TOO_LONG", "MAX_POSITION_EXCEEDED", "PRICE_COLLAR", "PRICE_DISLOCATION", "EDIT_HAS_NO_EFFECT", "ORDER_FOR_CANCELLATION_NOT_FOUND", "ORDER_FOR_EDIT_NOT_FOUND", "ORDER_CANNOT_HAVE_TRIGGER_PRICE", "POST_WOULD_EXECUTE", "IOC_WOULD_NOT_EXECUTE", "WOULD_EXECUTE_SELF", "WOULD_NOT_REDUCE_POSITION", "REJECTED_AFTER_EXECUTION", "MARKET_IS_POST_ONLY", "ORDER_LIMIT_EXCEEDED", "FIXED_LEVERAGE_TOO_HIGH", "CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP", "CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP", "TRAILING_STOP_ORDER_LIMIT_EXCEEDED", "TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES", "TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE", "TRAILING_STOP_MAX_DEVIATION_TOO_LARGE", "TRAILING_STOP_MAX_DEVIATION_TOO_SMALL", "INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP", "NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE", "INSUFFICIENT_CLOSING_MARGIN", "LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE", "LIMIT_PRICE_OFFSET_VALUE_INVALID", "LIMIT_PRICE_OFFSET_UNIT_INVALID", "LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT", "LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE", "LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES", "LIMIT_PRICE_OFFSET_TOO_HIGH", "LIMIT_PRICE_OFFSET_TOO_LOW" |
|
typeoptional |
Always REJECT. |
String value: "REJECT" |
uidoptional |
String |
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
{
"clientId": "string",
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"quantity": 0.0,
"reduceOnly": false,
"side": "buy",
"startTime": "string",
"symbol": "string",
"timestamp": "string",
"triggerPrice": 0.0,
"triggerSide": "trigger_above",
"triggerSignal": "mark_price",
"type": "lmt",
"uid": "string"
}
This is one of:
Null
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Subaccounts
Check if a subaccount has trading enabled or disabled
GET
https://www.cryptofacilities.com/derivatives/api/v3/subaccount/{subaccountUid}/trading-enabled
Returns trading capability info for given subaccount.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Type |
|---|---|---|
subaccountUid |
path | String format: uuid |
Response
Example response
(Some parts of this example are auto-generated)GET /subaccount/{subaccountUid}/trading-enabledcode 200application/json
{
"tradingEnabled": false
}
| Code | Description / Content type | Type |
|---|---|---|
| 200 | Trading enabled status. | |
application/json |
Schema 1 | |
| 404 | The account or subaccount could not be found |
Schemas
Schema 1
Schema 1 example
(Some parts of this example are auto-generated)
{
"tradingEnabled": false
}
This is one of:
SubaccountEnabledJson
SubaccountEnabledJson example
(Some parts of this example are auto-generated)
{
"tradingEnabled": false
}
Type: Object
Object fields:
| Field | Type |
|---|---|
tradingEnabled |
Boolean |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Enable or disable trading on a subaccount
PUT
https://www.cryptofacilities.com/derivatives/api/v3/subaccount/{subaccountUid}/trading-enabled
Updates trading capabilities for given subaccount.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Type |
|---|---|---|
subaccountUid |
path | String format: uuid |
tradingEnabled |
query | Boolean |
Response
Example response
(Some parts of this example are auto-generated)PUT /subaccount/{subaccountUid}/trading-enabledcode 200application/json
{
"tradingEnabled": false
}
| Code | Description / Content type | Type |
|---|---|---|
| 200 | Trading was successfully enabled/disabled. | |
application/json |
Schema 1 | |
| 404 | The account or subaccount could not be found |
Schemas
Schema 1
Schema 1 example
(Some parts of this example are auto-generated)
{
"tradingEnabled": false
}
This is one of:
SubaccountEnabledJson
SubaccountEnabledJson example
(Some parts of this example are auto-generated)
{
"tradingEnabled": false
}
Type: Object
Object fields:
| Field | Type |
|---|---|
tradingEnabled |
Boolean |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Get subaccounts
GET
https://www.cryptofacilities.com/derivatives/api/v3/subaccounts
Return information about subaccounts, including balances and UIDs.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Example response: cfSuccess
GET /subaccountscode 200application/json
{
"masterAccountUid": "ba598ca1-65c1-4f48-927d-0e2b647d627a",
"result": "success",
"serverTime": "2022-03-31T20:38:53.677Z",
"subaccounts": [
{
"accountUid": "7f5c528e-2285-45f0-95f5-83d53d4bfcd2",
"email": "[email protected]",
"fullName": "John Doe",
"futuresAccounts": [
{
"availableMargin": 16187.33210488726,
"name": "f-xrp:usd"
},
{
"availableMargin": 67.59768318324302,
"name": "f-eth:usd"
},
{
"availableMargin": -0.0009056832839642471,
"name": "f-xbt:usd"
},
{
"availableMargin": 67.51126059691163,
"name": "f-ltc:usd"
},
{
"availableMargin": 2.34e-9,
"name": "f-xrp:xbt"
},
{
"availableMargin": 47.151615710695495,
"name": "f-bch:usd"
}
],
"holdingAccounts": [
{
"amount": 0,
"currency": "gbp"
},
{
"amount": 0.00004,
"currency": "bch"
},
{
"amount": 13662.85078,
"currency": "xrp"
},
{
"amount": 0,
"currency": "usd"
},
{
"amount": 3.0000485057,
"currency": "eth"
},
{
"amount": 0,
"currency": "usdt"
},
{
"amount": 0.00002,
"currency": "ltc"
},
{
"amount": 0,
"currency": "usdc"
},
{
"amount": 3.46e-9,
"currency": "xbt"
}
]
}
]
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"masterAccountUid": "string",
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"subaccounts": [
{
"accountUid": "string",
"email": "string",
"fullName": "string",
"futuresAccounts": [
{
"availableMargin": 0.0,
"name": "string"
}
],
"holdingAccounts": [
{
"amount": 0.0,
"currency": "string"
}
]
}
]
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
masterAccountUidoptional |
Master account UID | String | |
subaccountsoptional |
The sub-accounts. | Array array items: [SubAccount] |
SubAccount
SubAccount example
(Some parts of this example are auto-generated)
{
"accountUid": "string",
"email": "string",
"fullName": "string",
"futuresAccounts": [
{
"availableMargin": 0.0,
"name": "string"
}
],
"holdingAccounts": [
{
"amount": 0.0,
"currency": "string"
}
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
accountUidoptional |
The account UID | String |
emailoptional |
The email associated with the account | String |
fullNameoptional |
The name of the account | Null or String |
futuresAccountsoptional |
Structure containing structures with single-collateral accounts information for a specific futures account asset. | Array array items: [FutureAccountBalance] |
holdingAccountsoptional |
Structure containing structures with holding accounts information for a specific holding account asset. | Array array items: [HoldingAccountBalance] |
FutureAccountBalance
FutureAccountBalance example
(Some parts of this example are auto-generated)
{
"availableMargin": 0.0,
"name": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
availableMarginoptional |
The amount of currency in the holding account in the quote currency of the name pair. | Number |
nameoptional |
The name of the futures account as the account pair. | String |
HoldingAccountBalance
HoldingAccountBalance example
(Some parts of this example are auto-generated)
{
"amount": 0.0,
"currency": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
amountoptional |
The amount of currency in the holding account. | Number |
currencyoptional |
The currency of the account. All figures shown in this currency. | String |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Trading Settings
Get current self trade strategy
GET
https://www.cryptofacilities.com/derivatives/api/v3/self-trade-strategy
Returns account-wide self-trade matching strategy.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response - application/json
Get current self trade strategy
Example response
(Some parts of this example are auto-generated)GET /self-trade-strategycode 200application/json
{
"strategy": "REJECT_TAKER"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"strategy": "REJECT_TAKER"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
strategy |
Self trade matching behaviour: - REJECT_TAKER - default behaviour, rejects the taker order that would match against a maker order from any sub-account - CANCEL_MAKER_SELF - only cancels the maker order if it is from the same account that sent the taker order - CANCEL_MAKER_CHILD - only allows master to cancel its own maker orders and orders from its sub-account - CANCEL_MAKER_ANY - allows both master accounts and their subaccounts to cancel maker orders |
String enum: "REJECT_TAKER", "CANCEL_MAKER_SELF", "CANCEL_MAKER_CHILD", "CANCEL_MAKER_ANY" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Update self trade strategy
PUT
https://www.cryptofacilities.com/derivatives/api/v3/self-trade-strategy
Updates account-wide self-trade matching behavior to given strategy.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
strategy |
query | Defines self trade behaviour Self trade matching behaviour: - REJECT_TAKER - default behaviour, rejects the taker order that would match against a maker order from any sub-account - CANCEL_MAKER_SELF - only cancels the maker order if it is from the same account that sent the taker order - CANCEL_MAKER_CHILD - only allows master to cancel its own maker orders and orders from its sub-account - CANCEL_MAKER_ANY - allows both master accounts and their subaccounts to cancel maker orders |
String enum: "REJECT_TAKER", "CANCEL_MAKER_SELF", "CANCEL_MAKER_CHILD", "CANCEL_MAKER_ANY" |
Response - application/json
Self trade strategy was successfully updated
Example response
(Some parts of this example are auto-generated)PUT /self-trade-strategycode 200application/json
{
"strategy": "REJECT_TAKER"
}
This is one of:
Schemas
Success Response
Success Response example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"strategy": "REJECT_TAKER"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
strategy |
Self trade matching behaviour: - REJECT_TAKER - default behaviour, rejects the taker order that would match against a maker order from any sub-account - CANCEL_MAKER_SELF - only cancels the maker order if it is from the same account that sent the taker order - CANCEL_MAKER_CHILD - only allows master to cancel its own maker orders and orders from its sub-account - CANCEL_MAKER_ANY - allows both master accounts and their subaccounts to cancel maker orders |
String enum: "REJECT_TAKER", "CANCEL_MAKER_SELF", "CANCEL_MAKER_CHILD", "CANCEL_MAKER_ANY" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Transfers
Initiate wallet transfer
POST
https://www.cryptofacilities.com/derivatives/api/v3/transfer
This endpoint allows you to transfer funds between two margin accounts with the same collateral currency, or between a margin account and your cash account.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
amount |
query | The amount to transfer | Number format: decimal exclusive **min: **0 |
0.1 |
fromAccount |
query | The wallet (cash or margin account) from which funds should be debited | String | "fi_ethusd" |
toAccount |
query | The wallet (cash or margin account) to which funds should be credited | String | "flex" |
unit |
query | The currency unit to transfer | String | "eth" |
Response - application/json
Example response
(Some parts of this example are auto-generated)POST /transfercode 200application/json
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
This is one of:
Schemas
SuccessResponse
SuccessResponse example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Initiate sub account transfer
POST
https://www.cryptofacilities.com/derivatives/api/v3/transfer/subaccount
This endpoint allows you to transfer funds between the current account and a sub account, between two margin accounts with the same collateral currency, or between a margin account and your cash account.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with full access)
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
amount |
query | The amount to transfer | String |
fromAccount |
query | The wallet (cash or margin account) from which funds should be debited | String |
fromUser |
query | The user account (this or a sub account) from which funds should be debited | String |
toAccount |
query | The wallet (cash or margin account) to which funds should be credited | String |
toUser |
query | The user account (this or a sub account) to which funds should be credited | String |
unit |
query | The currency unit to transfer | String |
Response - application/json
Example response: failure
POST /transfer/subaccountcode 200application/json
{
"error": "invalidUnit",
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z"
}
Example response: success
POST /transfer/subaccountcode 200application/json
{
"result": "success",
"serverTime": "2022-06-28T14:48:58.711Z"
}
This is one of:
Schemas
SuccessResponse
SuccessResponse example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
Initiate withdrawal to Spot wallet
POST
https://www.cryptofacilities.com/derivatives/api/v3/withdrawal
This endpoint allows you to request to withdraw digital assets to your Kraken Spot wallet.
Wallet names can be found in the 'accounts' structure in the Get Wallets /accounts response.
Authentication
Authentheader (Authentication string)APIKeyheader (Withdrawal API key with full access )
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
amount |
query | The amount of currency that shall be withdrawn back to spot wallet. | Number format: decimal exclusive **min: **0 |
0.1 |
currency |
query | The digital asset that shall be withdrawn back to spot wallet. | String | "eth" |
sourceWalletoptional |
query | The wallet from which the funds shall be withdrawn back to spot wallet. Default is "cash" wallet. | String | "flex" |
Response - application/json
Example response: failure
POST /withdrawalcode 200application/json
{
"error": "Unavailable",
"result": "error",
"serverTime": "2019-05-15T09:24:16.968Z"
}
Example response: success
POST /withdrawalcode 200application/json
{
"result": "success",
"serverTime": "2022-06-28T14:48:58.711Z",
"uid": "9053db5f-0d5e-48dd-b606-a5c92576b706"
}
This is one of:
Schemas
WithdrawalResponse
WithdrawalResponse example
(Some parts of this example are auto-generated)
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"uid": "string"
}
Withdrawal initiated
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "success" |
"success" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
uid |
Withdrawal/transfer reference | String |
ErrorResponse
ErrorResponse example
(Some parts of this example are auto-generated)
{
"error": "accountInactive",
"errors": [
"accountInactive"
],
"result": "error",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
result |
String value: "error" |
"error" |
|
serverTime |
Server time in Coordinated Universal Time (UTC) | String format: date-time |
"2020-08-27T17:03:33.196Z" |
erroroptional |
Error description. - accountInactive: The Futures account the request refers to is inactive - apiLimitExceeded: The API limit for the calling IP address has been exceeded - authenticationError: The request could not be authenticated - insufficientFunds: The amount requested for transfer is below the amount of funds available - invalidAccount: The Futures account the transfer request refers to is invalid - invalidAmount: The amount the transfer request refers to is invalid - invalidArgument: One or more arguments provided are invalid - invalidUnit: The unit the transfer request refers to is invalid - Json Parse Error: The request failed to pass valid JSON as an argument - marketUnavailable: The market is currently unavailable - nonceBelowThreshold: The provided nonce is below the threshold - nonceDuplicate: The provided nonce is a duplicate as it has been used in a previous request - notFound: The requested information could not be found - requiredArgumentMissing: One or more required arguments are missing - Server Error: There was an error processing the request - Unavailable: The endpoint being called is unavailable - unknownError: An unknown error has occurred |
String enum: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError" |
|
errorsoptional |
Array array items: [Error] |
Error
Error example
"accountInactive"
Error description.
accountInactive: The Futures account the request refers to is inactiveapiLimitExceeded: The API limit for the calling IP address has been exceededauthenticationError: The request could not be authenticatedinsufficientFunds: The amount requested for transfer is below the amount of funds availableinvalidAccount: The Futures account the transfer request refers to is invalidinvalidAmount: The amount the transfer request refers to is invalidinvalidArgument: One or more arguments provided are invalidinvalidUnit: The unit the transfer request refers to is invalidJson Parse Error: The request failed to pass valid JSON as an argumentmarketUnavailable: The market is currently unavailablenonceBelowThreshold: The provided nonce is below the thresholdnonceDuplicate: The provided nonce is a duplicate as it has been used in a previous requestnotFound: The requested information could not be foundrequiredArgumentMissing: One or more required arguments are missingServer Error: There was an error processing the requestUnavailable: The endpoint being called is unavailableunknownError: An unknown error has occurred
Type: String
Must be one of: "accountInactive", "apiLimitExceeded", "authenticationError", "insufficientFunds", "invalidAccount", "invalidAmount", "invalidArgument", "invalidUnit", "Json Parse Error", "marketUnavailable", "nonceBelowThreshold", "nonceDuplicate", "notFound", "requiredArgumentMissing", "Server Error", "Unavailable", "unknownError"
History
Public history APIs.
Account History
Account History provides account-specific data, including account logs ( history of all balance and position changes) and history for executions, orders, and triggers.
- The
/account-logendpoint provides a paginated JSON response, with access to all account log history specified by ranges of timestamp or ID. - The
/accountlogcsvendpoint provides a CSV formatted response of 500,000 rows of most recent account logs. See also the websocket feed of account log snapshots - The
/executionsendpoint provides a paginated JSON response, with access to all private execution history specified by ranges of timestamp or ID - The
/ordersendpoint provides a paginated JSON response, with access to all private order history specified by ranges of timestamp or ID - The
/triggersendpoint provides a paginated JSON response, with access to all private trigger history specified by ranges of timestamp or ID
Get account log
GET
https://www.cryptofacilities.com/api/history/v3/account-log
Lists account log entries, paged by timestamp or by ID.
To request entries by time range, use the since and before parameters.
To request entries by ID range, use the from and to parameters.
Any combination of since, before, from and to can be used to restrict the requested range of entries.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type | Default | Example |
|---|---|---|---|---|---|
beforeoptional |
query | Unix timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
countoptional |
query | Amount of entries to be returned. | Integer | 500 | |
fromoptional |
query | ID of the first entry (inclusive). IDs start at 1. | Integer | 1 |
|
infooptional |
query | Type of entry to filter by. Only this type will be returned. | String enum: "futures trade", "futures liquidation", "futures assignor", "futures assignee", "futures unwind counterparty", "futures unwind bankrupt", "covered liquidation", "funding rate change", "conversion", "interest payment", "transfer", "cross-exchange transfer", "kfee applied", "subaccount transfer", "settlement", "admin transfer" |
"futures trade" |
|
sinceoptional |
query | Unix timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
sortoptional |
query | Order of events in response. asc = chronological, desc = reverse-chronological. |
String enum: "asc", "desc" |
"desc" | |
tooptional |
query | ID of the last entry (inclusive). | Integer | 100 |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /account-logcode 200application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"logs": [
{
"asset": "string",
"booking_uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"collateral": "string",
"contract": "string",
"conversion_spread_percentage": 0.0,
"date": "2019-08-24T14:15:22Z",
"execution": "string",
"fee": 0.0,
"funding_rate": 0.0,
"id": 1,
"info": "futures trade",
"liquidation_fee": 0.0,
"margin_account": "string",
"mark_price": 0.0,
"new_average_entry_price": 0.0,
"new_balance": 0.0,
"old_average_entry_price": 0.0,
"old_balance": 0.0,
"realized_funding": 0.0,
"realized_pnl": 0.0,
"trade_price": 0.0
}
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
accountUid |
UID of the account | String format: uuid |
logs |
Array array items: [AccountLogEntry] |
Schemas
AccountLogEntry
AccountLogEntry example
(Some parts of this example are auto-generated)
{
"asset": "string",
"booking_uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"collateral": "string",
"contract": "string",
"conversion_spread_percentage": 0.0,
"date": "2019-08-24T14:15:22Z",
"execution": "string",
"fee": 0.0,
"funding_rate": 0.0,
"id": 1,
"info": "futures trade",
"liquidation_fee": 0.0,
"margin_account": "string",
"mark_price": 0.0,
"new_average_entry_price": 0.0,
"new_balance": 0.0,
"old_average_entry_price": 0.0,
"old_balance": 0.0,
"realized_funding": 0.0,
"realized_pnl": 0.0,
"trade_price": 0.0
}
Account log entry
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
asset |
Asset related with the entry. | String | |
booking_uid |
UID of the log entry. | String format: uuid |
|
collateral |
Currency of the associated entry. | Null or String | |
contract |
Null or String | ||
conversion_spread_percentage |
Percentage conversion spread used in a currency conversion. | Null or Number format: double |
|
date |
RFC 3339 formatted date-time | String format: date-time |
"2019-08-24T14:15:22Z" |
execution |
UID of the associated execution or transfer. For orders and trades, this is always a UUID. However, this field is also populated with "cross-exchange transfer" references, which are not always UUIDs. |
Null or String | |
fee |
Fee paid | Null or Number format: double |
|
funding_rate |
Absolute funding rate at time of entry. | Null or Number format: double |
|
id |
Log entry ID. | Integer format: int64 **min: **1 |
|
info |
Short description of the entry. | String enum: "futures trade", "futures liquidation", "futures assignor", "futures assignee", "futures unwind counterparty", "futures unwind bankrupt", "covered liquidation", "funding rate change", "conversion", "interest payment", "transfer", "cross-exchange transfer", "kfee applied", "subaccount transfer", "settlement", "admin transfer" |
|
liquidation_fee |
Liquidation fee associated with a liquidation/assignment entry. Not applicable for inverse futures. |
Null or Number format: double |
|
margin_account |
Name of the wallet associated with the entry. | String | |
mark_price |
Mark price at the time the trade was executed. | Null or Number format: double |
|
new_average_entry_price |
Average entry price of the position after this trade. | Null or Number format: double |
|
new_balance |
New balance of wallet or new size of the position after the described in info action. |
Number format: double |
|
old_average_entry_price |
Average entry price of the position prior to this trade. | Null or Number format: double |
|
old_balance |
Account balance before the described in info action. | Number format: double |
|
realized_funding |
Funding realized due to change in position size or end of funding rate period. | Null or Number format: double |
|
realized_pnl |
PnL that is realized by reducing the position. | Null or Number format: double |
|
trade_price |
Price at which the trade was executed. | Null or Number format: double |
Account log (CSV)
GET
https://www.cryptofacilities.com/api/history/v3/accountlogcsv
Lists recent account log entries in CSV format.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Response
| Code | Description / Content type |
|---|---|
| 200 | A CSV formatted response of most recent account log entries. |
| 401 | Credentials required. |
| 429 | Rate limited. Check Rate-Limit-Reset header for how long until next access is allowed in seconds. |
Get execution events
GET
https://www.cryptofacilities.com/api/history/v3/executions
Lists executions/trades for authenticated account.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type | Default | Example |
|---|---|---|---|---|---|
beforeoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
continuation_tokenoptional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
||
countoptional |
query | The maximum number of results to return. The upper bound is determined by a global limit. | Integer format: int64 **min: **1 |
||
sinceoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
sortoptional |
query | Determines the order of events in response(s). - asc = chronological - desc = reverse-chronological |
String enum: "asc", "desc" |
"desc" | |
tradeableoptional |
query | If present events of other tradeables are filtered out. | String |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /executionscode 200application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"Execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0,
"serverTime": "2022-03-31T20:38:53.677Z"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
accountUid |
String format: uuid |
|
elements |
Array array items: [HistoricalExecutionElement] |
|
len |
Integer format: uint64 |
|
continuationTokenoptional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
serverTimeoptional |
String format: date-time |
Schemas
HistoricalExecutionElement
HistoricalExecutionElement example
(Some parts of this example are auto-generated)
{
"event": {
"Execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
event |
HistoricalExecutionEvent | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String |
HistoricalExecutionEvent
HistoricalExecutionEvent example
(Some parts of this example are auto-generated)
{
"Execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
Execution |
HistoricalExecutionDetails |
HistoricalExecutionDetails
HistoricalExecutionDetails example
(Some parts of this example are auto-generated)
{
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
execution |
HistoricalExecution | |
takerReducedQuantity |
sometimes empty string | String |
HistoricalExecution
HistoricalExecution example
(Some parts of this example are auto-generated)
{
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
limitFilled |
Boolean | |
makerOrder |
HistoricalOrder | |
makerOrderData |
MakerOrderData | |
markPrice |
String format: big-decimal |
"1234.56789" |
price |
String format: big-decimal |
"1234.56789" |
quantity |
String format: big-decimal |
"1234.56789" |
takerOrder |
HistoricalOrder | |
takerOrderData |
TakerOrderData | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String format: uuid |
|
usdValue |
String format: big-decimal |
"1234.56789" |
oldTakerOrderoptional |
HistoricalOrder |
HistoricalOrder
HistoricalOrder example
(Some parts of this example are auto-generated)
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
accountUid |
String format: uuid |
|
clientId |
String | |
direction |
String enum: "Buy", "Sell" |
|
filled |
String format: big-decimal |
"1234.56789" |
lastUpdateTimestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
limitPrice |
String format: big-decimal |
"1234.56789" |
orderType |
String enum: "Limit", "IoC", "Post", "Market", "Liquidation", "Assignment", "Unwind" |
|
quantity |
String format: big-decimal |
"1234.56789" |
reduceOnly |
Boolean | |
spotData |
Null or String | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
tradeable |
String | |
uid |
String format: uuid |
MakerOrderData
MakerOrderData example
(Some parts of this example are auto-generated)
{
"fee": "1234.56789",
"positionSize": "1234.56789"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
fee |
String format: big-decimal |
"1234.56789" |
positionSize |
String format: big-decimal |
"1234.56789" |
TakerOrderData
TakerOrderData example
(Some parts of this example are auto-generated)
{
"fee": "1234.56789",
"positionSize": "1234.56789"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
fee |
String format: big-decimal |
"1234.56789" |
positionSize |
String format: big-decimal |
"1234.56789" |
Get order events
GET
https://www.cryptofacilities.com/api/history/v3/orders
Lists order events for authenticated account.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type | Default | Example |
|---|---|---|---|---|---|
beforeoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
continuation_tokenoptional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
||
countoptional |
query | The maximum number of results to return. The upper bound is determined by a global limit. | Integer format: int64 **min: **1 |
||
sinceoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
sortoptional |
query | Determines the order of events in response(s). - asc = chronological - desc = reverse-chronological |
String enum: "asc", "desc" |
"desc" | |
tradeableoptional |
query | If present events of other tradeables are filtered out. | String |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /orderscode 200application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"OrderPlaced": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0,
"serverTime": "2022-03-31T20:38:53.677Z"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
accountUid |
String format: uuid |
|
elements |
Array array items: [HistoricalOrderElement] |
|
len |
Integer format: uint64 |
|
continuationTokenoptional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
serverTimeoptional |
String format: date-time |
Schemas
HistoricalOrderElement
HistoricalOrderElement example
(Some parts of this example are auto-generated)
{
"event": {
"OrderPlaced": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
event |
HistoricalOrderEvent | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String |
HistoricalOrderEvent
HistoricalOrderEvent example
(Some parts of this example are auto-generated)
{
"OrderPlaced": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
}
Type: Object
This is one of:
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"OrderPlaced": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderPlaced |
OrderPlaced |
OrderPlaced
OrderPlaced example
(Some parts of this example are auto-generated)
{
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
order |
HistoricalOrder | |
reason |
String | |
reducedQuantity |
always empty string | String |
HistoricalOrder
HistoricalOrder example
(Some parts of this example are auto-generated)
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
accountUid |
String format: uuid |
|
clientId |
String | |
direction |
String enum: "Buy", "Sell" |
|
filled |
String format: big-decimal |
"1234.56789" |
lastUpdateTimestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
limitPrice |
String format: big-decimal |
"1234.56789" |
orderType |
String enum: "Limit", "IoC", "Post", "Market", "Liquidation", "Assignment", "Unwind" |
|
quantity |
String format: big-decimal |
"1234.56789" |
reduceOnly |
Boolean | |
spotData |
Null or String | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
tradeable |
String | |
uid |
String format: uuid |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
{
"OrderUpdated": {
"newOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "1234.56789"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderUpdated |
OrderUpdated |
OrderUpdated
OrderUpdated example
(Some parts of this example are auto-generated)
{
"newOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "1234.56789"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
newOrder |
HistoricalOrder | |
oldOrder |
HistoricalOrder | |
reason |
String | |
reducedQuantity |
String format: big-decimal |
"1234.56789" |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"OrderRejected": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string",
"reason": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderRejected |
OrderRejected |
OrderRejected
OrderRejected example
(Some parts of this example are auto-generated)
{
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string",
"reason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
order |
HistoricalOrder |
orderError |
String |
reason |
String |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
{
"OrderCancelled": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderCancelled |
OrderCancelled |
OrderCancelled
OrderCancelled example
(Some parts of this example are auto-generated)
{
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
order |
HistoricalOrder |
reason |
String |
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
{
"OrderNotFound": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"orderId": "Uuid(uuid=2ceb1d31-f619-457b-870c-fd4ddbb10d45)"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderNotFound |
OrderNotFound |
OrderNotFound
OrderNotFound example
(Some parts of this example are auto-generated)
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"orderId": "Uuid(uuid=2ceb1d31-f619-457b-870c-fd4ddbb10d45)"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
accountUid |
String format: uuid |
orderId |
String |
Schema 7
Schema 7 example
(Some parts of this example are auto-generated)
{
"OrderEditRejected": {
"attemptedOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderEditRejected |
OrderEditRejected |
OrderEditRejected
OrderEditRejected example
(Some parts of this example are auto-generated)
{
"attemptedOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "Limit",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
attemptedOrder |
HistoricalOrder |
oldOrder |
HistoricalOrder |
orderError |
String |
Get trigger events
GET
https://www.cryptofacilities.com/api/history/v3/triggers
Lists trigger events for authenticated account.
Authentication
Authentheader (Authentication string)APIKeyheader (General API key with at least read-only access)
Parameters
| Parameter | In | Description | Type | Default | Example |
|---|---|---|---|---|---|
beforeoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
continuation_tokenoptional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
||
countoptional |
query | The maximum number of results to return. The upper bound is determined by a global limit. | Integer format: int64 **min: **1 |
||
sinceoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
sortoptional |
query | Determines the order of events in response(s). - asc = chronological - desc = reverse-chronological |
String enum: "asc", "desc" |
"desc" | |
tradeableoptional |
query | If present events of other tradeables are filtered out. | String |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /triggerscode 200application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"OrderTriggerPlaced": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0,
"serverTime": "2022-03-31T20:38:53.677Z"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
accountUid |
String format: uuid |
|
elements |
Array array items: [HistoricalTriggerElement] |
|
len |
Integer format: uint64 |
|
continuationTokenoptional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
serverTimeoptional |
String format: date-time |
Schemas
HistoricalTriggerElement
HistoricalTriggerElement example
(Some parts of this example are auto-generated)
{
"event": {
"OrderTriggerPlaced": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
event |
HistoricalTriggerEvent | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String |
HistoricalTriggerEvent
HistoricalTriggerEvent example
(Some parts of this example are auto-generated)
{
"OrderTriggerPlaced": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
}
Type: Object
This is one of:
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"OrderTriggerPlaced": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderTriggerPlaced |
TriggerPlaced |
TriggerPlaced
TriggerPlaced example
(Some parts of this example are auto-generated)
{
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
order |
HistoricalTrigger |
reason |
String |
HistoricalTrigger
HistoricalTrigger example
(Some parts of this example are auto-generated)
{
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
accountId |
Number format: uint64 |
|
accountUid |
String format: uuid |
|
clientId |
String | |
direction |
String enum: "Buy", "Sell" |
|
lastUpdateTimestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
limitPrice |
String format: big-decimal |
"1234.56789" |
orderType |
String | |
quantity |
String format: big-decimal |
"1234.56789" |
reduceOnly |
Boolean | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
tradeable |
String | |
triggerOptions |
TriggerOptions | |
uid |
String format: uuid |
TriggerOptions
TriggerOptions example
(Some parts of this example are auto-generated)
{
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
limitPriceOffset |
PriceOffset | |
trailingStopOptions |
TrailingStopOptions | |
triggerPrice |
String format: big-decimal |
"1234.56789" |
triggerSide |
String enum: "Above", "Below" |
|
triggerSignal |
String enum: "MarkPrice", "LastPrice", "SpotPrice" |
PriceOffset
PriceOffset example
(Some parts of this example are auto-generated)
{
"priceOffset": "1234.56789",
"unit": "Percent"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
priceOffset |
String format: big-decimal |
"1234.56789" |
unit |
String enum: "Percent", "QuoteCurrency" |
TrailingStopOptions
TrailingStopOptions example
(Some parts of this example are auto-generated)
{
"maxDeviation": "1234.56789",
"unit": "Percent"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
maxDeviation |
String format: big-decimal |
"1234.56789" |
unit |
String enum: "Percent", "QuoteCurrency" |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
{
"OrderTriggerCancelled": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderTriggerCancelled |
TriggerCancelled |
TriggerCancelled
TriggerCancelled example
(Some parts of this example are auto-generated)
{
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
order |
HistoricalTrigger |
reason |
String |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"OrderTriggerUpdated": {
"newOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderTriggerUpdated |
TriggerUpdated |
TriggerUpdated
TriggerUpdated example
(Some parts of this example are auto-generated)
{
"newOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
newOrderTrigger |
HistoricalTrigger |
oldOrderTrigger |
HistoricalTrigger |
reason |
String |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
{
"OrderTriggerActivated": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderTriggerActivated |
TriggerActivated |
TriggerActivated
TriggerActivated example
(Some parts of this example are auto-generated)
{
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
order |
HistoricalTrigger |
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
{
"OrderTriggerEditRejected": {
"attemptedOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string",
"reason": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderTriggerEditRejected |
TriggerEditRejected |
TriggerEditRejected
TriggerEditRejected example
(Some parts of this example are auto-generated)
{
"attemptedOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"limitPriceOffset": {
"priceOffset": "1234.56789",
"unit": "Percent"
},
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "Above",
"triggerSignal": "MarkPrice"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string",
"reason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
attemptedOrderTrigger |
HistoricalTrigger |
oldOrderTrigger |
HistoricalTrigger |
orderError |
String |
reason |
String |
Market History
Get public execution events
GET
https://www.cryptofacilities.com/api/history/v3/market/{tradeable}/executions
Lists trades for a market.
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Default | Example |
|---|---|---|---|---|---|
tradeable |
path | String | |||
beforeoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
continuation_tokenoptional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
||
countoptional |
query | The maximum number of results to return. The upper bound is determined by a global limit. | Integer format: int64 **min: **1 |
||
sinceoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
sortoptional |
query | Determines the order of events in response(s). - asc = chronological - desc = reverse-chronological |
String enum: "asc", "desc" |
"desc" |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /market/{tradeable}/executionscode 200application/json
{
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"Execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
elements |
Array array items: [HistoricalExecutionElementSanitized] |
|
len |
Integer format: uint64 |
|
continuationTokenoptional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
Schemas
HistoricalExecutionElementSanitized
HistoricalExecutionElementSanitized example
(Some parts of this example are auto-generated)
{
"event": {
"Execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
event |
HistoricalExecutionEventSanitized | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String |
HistoricalExecutionEventSanitized
HistoricalExecutionEventSanitized example
(Some parts of this example are auto-generated)
{
"Execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
Execution |
HistoricalExecutionDetailsSanitized |
HistoricalExecutionDetailsSanitized
HistoricalExecutionDetailsSanitized example
(Some parts of this example are auto-generated)
{
"execution": {
"limitFilled": false,
"makerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
execution |
HistoricalExecutionSanitized | |
takerReducedQuantity |
sometimes empty string | String |
HistoricalExecutionSanitized
HistoricalExecutionSanitized example
(Some parts of this example are auto-generated)
{
"limitFilled": false,
"makerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
limitFilled |
Boolean | |
makerOrder |
HistoricalOrderSanitized | |
markPrice |
String format: big-decimal |
"1234.56789" |
price |
String format: big-decimal |
"1234.56789" |
quantity |
String format: big-decimal |
"1234.56789" |
takerOrder |
HistoricalOrderSanitized | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String format: uuid |
|
usdValue |
String format: big-decimal |
"1234.56789" |
oldTakerOrderoptional |
HistoricalOrderSanitized |
HistoricalOrderSanitized
HistoricalOrderSanitized example
(Some parts of this example are auto-generated)
{
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
direction |
String enum: "Buy", "Sell" |
|
lastUpdateTimestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
limitPrice |
String format: big-decimal |
"1234.56789" |
orderType |
String | |
quantity |
String format: big-decimal |
"1234.56789" |
reduceOnly |
Boolean | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
tradeable |
String | |
uid |
String format: uuid |
Get public order events
GET
https://www.cryptofacilities.com/api/history/v3/market/{tradeable}/orders
Lists order events for a market.
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Default | Example |
|---|---|---|---|---|---|
tradeable |
path | String | |||
beforeoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
continuation_tokenoptional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
||
countoptional |
query | The maximum number of results to return. The upper bound is determined by a global limit. | Integer format: int64 **min: **1 |
||
sinceoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
sortoptional |
query | Determines the order of events in response(s). - asc = chronological - desc = reverse-chronological |
String enum: "asc", "desc" |
"desc" |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /market/{tradeable}/orderscode 200application/json
{
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"OrderPlaced": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
elements |
Array array items: [HistoricalOrderElementSanitized] |
|
len |
Integer format: uint64 |
|
continuationTokenoptional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
Schemas
HistoricalOrderElementSanitized
HistoricalOrderElementSanitized example
(Some parts of this example are auto-generated)
{
"event": {
"OrderPlaced": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
event |
HistoricalOrderEventSanitized | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String |
HistoricalOrderEventSanitized
HistoricalOrderEventSanitized example
(Some parts of this example are auto-generated)
{
"OrderPlaced": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
}
Type: Object
This is one of:
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
{
"OrderPlaced": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderPlaced |
OrderPlacedSanitized |
OrderPlacedSanitized
OrderPlacedSanitized example
(Some parts of this example are auto-generated)
{
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
order |
HistoricalOrderSanitized | |
reason |
String | |
reducedQuantity |
always empty string | String |
HistoricalOrderSanitized
HistoricalOrderSanitized example
(Some parts of this example are auto-generated)
{
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
direction |
String enum: "Buy", "Sell" |
|
lastUpdateTimestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
limitPrice |
String format: big-decimal |
"1234.56789" |
orderType |
String | |
quantity |
String format: big-decimal |
"1234.56789" |
reduceOnly |
Boolean | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
tradeable |
String | |
uid |
String format: uuid |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
{
"OrderUpdated": {
"newOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "1234.56789"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderUpdated |
OrderUpdatedSanitized |
OrderUpdatedSanitized
OrderUpdatedSanitized example
(Some parts of this example are auto-generated)
{
"newOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "1234.56789"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
newOrder |
HistoricalOrderSanitized | |
oldOrder |
HistoricalOrderSanitized | |
reason |
String | |
reducedQuantity |
String format: big-decimal |
"1234.56789" |
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
{
"OrderCancelled": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
OrderCancelled |
OrderCancelledSanitized |
OrderCancelledSanitized
OrderCancelledSanitized example
(Some parts of this example are auto-generated)
{
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
order |
HistoricalOrderSanitized |
reason |
String |
Get public mark price events
GET
https://www.cryptofacilities.com/api/history/v3/market/{tradeable}/price
Lists price events for a market.
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Default | Example |
|---|---|---|---|---|---|
tradeable |
path | String | |||
beforeoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
continuation_tokenoptional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
||
countoptional |
query | The maximum number of results to return. The upper bound is determined by a global limit. | Integer format: int64 **min: **1 |
||
sinceoptional |
query | Timestamp in milliseconds. | Integer format: timestamp-milliseconds |
1604937694000 |
|
sortoptional |
query | Determines the order of events in response(s). - asc = chronological - desc = reverse-chronological |
String enum: "asc", "desc" |
"desc" |
Response - application/json
Example response
(Some parts of this example are auto-generated)GET /market/{tradeable}/pricecode 200application/json
{
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"price": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
elements |
Array array items: [PriceElement] |
|
len |
Integer format: uint64 |
|
continuationTokenoptional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
String format: base64 |
Schemas
PriceElement
PriceElement example
(Some parts of this example are auto-generated)
{
"event": {
"price": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "string"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
event |
MarkPriceChanged | |
timestamp |
Integer format: timestamp-milliseconds |
1604937694000 |
uid |
String |
MarkPriceChanged
MarkPriceChanged example
(Some parts of this example are auto-generated)
{
"price": "1234.56789"
}
Type: Object
Object fields:
| Field | Type | Example |
|---|---|---|
price |
String format: big-decimal |
"1234.56789" |
Charts
Public chart candle and analytics APIs.
Analytics
Get liquidity pool statistic
GET
https://www.cryptofacilities.com/api/charts/v1/analytics/liquidity-pool
Get liquidity pool statistic including usd value
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
interval |
query | Resolution in seconds | Integer enum: 60, 300, 900, 1800, 3600, 14400, 43200, 86400, 604800 |
|
since |
query | epoch time in seconds | Integer format: int64 |
1676556478 |
tooptional |
query | epoch time in seconds, default now | Integer | 1676556478 |
Response
Example response
(Some parts of this example are auto-generated)GET /analytics/liquidity-poolcode 200application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
Example response
(Some parts of this example are auto-generated)GET /analytics/liquidity-poolcode 400application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
Example response
(Some parts of this example are auto-generated)GET /analytics/liquidity-poolcode 404application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
| Code | Description / Content type | Type |
|---|---|---|
| 200 | Available analytics by type and symbol | |
application/json |
Analytics response | |
| 400 | Query has invalid arguments | |
application/json |
Analytics response | |
| 404 | Symbol or analytics type could not be found | |
application/json |
Analytics response |
Schemas
Analytics response
Analytics response example
(Some parts of this example are auto-generated)
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
errors |
Array array items: [Analytics response error] |
result |
Result container for analytics response |
Analytics response error
Analytics response error example
(Some parts of this example are auto-generated)
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
error_class |
String |
severity |
String |
type |
String |
fieldoptional |
String |
msgoptional |
String |
valueoptional |
String |
Result container for analytics response
Result container for analytics response example
(Some parts of this example are auto-generated)
{
"data": [],
"more": false,
"timestamp": [
0
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
data |
Schema 1 | |
more |
True if there are more candles in time range | Boolean |
timestamp |
Array array items: [Integer] |
Schema 1
Schema 1 example
(Some parts of this example are auto-generated)
[]
This is one of:
Array (array items: [Schema 2])
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
"string"
This is one of:
Number
String (big-decimal)
Array (array len:
4, array items: [Number])
Statistic of long and short positions
Statistic of long and short positions example
(Some parts of this example are auto-generated)
{
"longCount": [
0
],
"longPercent": [
"string"
],
"ratio": [
"string"
],
"shortCount": [
0
],
"shortPercent": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
ratio |
Array array items: [String (big-decimal)] |
longCountoptional |
Array array items: [Integer] |
longPercentoptional |
Array array items: [String (big-decimal)] |
shortCountoptional |
Array array items: [Integer] |
shortPercentoptional |
Array array items: [String (big-decimal)] |
Orderbook analytics data
Orderbook analytics data example
(Some parts of this example are auto-generated)
{
"ask": {
"best_price": [
"string"
]
},
"bid": {
"best_price": [
"string"
]
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
ask |
Asks statistics |
bid |
Bids statistics |
Asks statistics
Asks statistics example
(Some parts of this example are auto-generated)
{
"best_price": [
"string"
]
}
This is one of:
Orderbook spread data
Orderbook spread data example
(Some parts of this example are auto-generated)
{
"best_price": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
best_price |
Array array items: [Null or String (big-decimal)] |
Orderbook liquidity data
Orderbook liquidity data example
(Some parts of this example are auto-generated)
{
"liquidity_005": [
"string"
],
"liquidity_01": [
"string"
],
"liquidity_025": [
"string"
],
"liquidity_05": [
"string"
],
"liquidity_10": [
"string"
],
"liquidity_100": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
liquidity_005 |
Array array items: [Null or String (big-decimal)] |
liquidity_01 |
Array array items: [Null or String (big-decimal)] |
liquidity_025 |
Array array items: [Null or String (big-decimal)] |
liquidity_05 |
Array array items: [Null or String (big-decimal)] |
liquidity_10 |
Array array items: [Null or String (big-decimal)] |
liquidity_100 |
Array array items: [Null or String (big-decimal)] |
Orderbook slippage data
Orderbook slippage data example
(Some parts of this example are auto-generated)
{
"slippage_100k": [
"string"
],
"slippage_10k": [
"string"
],
"slippage_1k": [
"string"
],
"slippage_1m": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
slippage_100k |
Array array items: [Null or String (big-decimal)] |
slippage_10k |
Array array items: [Null or String (big-decimal)] |
slippage_1k |
Array array items: [Null or String (big-decimal)] |
slippage_1m |
Array array items: [Null or String (big-decimal)] |
Combination of all orderbook metrics
Combination of all orderbook metrics example
(Some parts of this example are auto-generated)
{
"bestPrice": [
"string"
],
"liquidity005": [
"string"
],
"liquidity01": [
"string"
],
"liquidity025": [
"string"
],
"liquidity05": [
"string"
],
"liquidity10": [
"string"
],
"liquidity100": [
"string"
],
"slippage100k": [
"string"
],
"slippage10k": [
"string"
],
"slippage1k": [
"string"
],
"slippage1m": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
bestPrice |
Array array items: [Null or String (big-decimal)] |
liquidity005 |
Array array items: [Null or String (big-decimal)] |
liquidity01 |
Array array items: [Null or String (big-decimal)] |
liquidity025 |
Array array items: [Null or String (big-decimal)] |
liquidity05 |
Array array items: [Null or String (big-decimal)] |
liquidity10 |
Array array items: [Null or String (big-decimal)] |
liquidity100 |
Array array items: [Null or String (big-decimal)] |
slippage100k |
Array array items: [Null or String (big-decimal)] |
slippage10k |
Array array items: [Null or String (big-decimal)] |
slippage1k |
Array array items: [Null or String (big-decimal)] |
slippage1m |
Array array items: [Null or String (big-decimal)] |
Bids statistics
Bids statistics example
(Some parts of this example are auto-generated)
{
"best_price": [
"string"
]
}
This is one of:
AnalyticsCvdData
AnalyticsCvdData example
(Some parts of this example are auto-generated)
{
"buyVolume": [
"string"
],
"cvd": [
"string"
],
"sellVolume": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
buyVolume |
Array array items: [String (big-decimal)] |
cvd |
Array array items: [String (big-decimal)] |
sellVolume |
Array array items: [String (big-decimal)] |
AnalyticsTopTradersData
AnalyticsTopTradersData example
(Some parts of this example are auto-generated)
{
"top20Percent": {
"longCount": [
0
],
"longPercent": [
"string"
],
"openInterest": [
"string"
],
"ratio": [
"string"
],
"shortCount": [
0
],
"shortPercent": [
"string"
]
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
top20Percent |
AnalyticsTopTradersLevelData |
AnalyticsTopTradersLevelData
AnalyticsTopTradersLevelData example
(Some parts of this example are auto-generated)
{
"longCount": [
0
],
"longPercent": [
"string"
],
"openInterest": [
"string"
],
"ratio": [
"string"
],
"shortCount": [
0
],
"shortPercent": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
longCount |
Array array items: [Integer] |
longPercent |
Array array items: [String (big-decimal)] |
openInterest |
Array array items: [String (big-decimal)] |
ratio |
Array array items: [String (big-decimal)] |
shortCount |
Array array items: [Integer] |
shortPercent |
Array array items: [String (big-decimal)] |
AnalyticsLiquidityPoolData
AnalyticsLiquidityPoolData example
(Some parts of this example are auto-generated)
{
"usdValue": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
usdValue |
Array array items: [String (big-decimal)] |
AnalyticsFutureBasisData
AnalyticsFutureBasisData example
(Some parts of this example are auto-generated)
{
"basis": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
basis |
Array array items: [String (big-decimal)] |
Result container for analytics response
Result container for analytics response example
(Some parts of this example are auto-generated)
{
"data": [],
"more": false,
"timestamp": [
0
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
data |
Schema 3 | |
more |
True if there are more candles in time range | Boolean |
timestamp |
Array array items: [Integer] |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
[]
This is one of:
Array (array items: [Schema 4])
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
"string"
This is one of:
Number
String (big-decimal)
Array (array len:
4, array items: [Number])
Result container for analytics response
Result container for analytics response example
(Some parts of this example are auto-generated)
{
"data": [],
"more": false,
"timestamp": [
0
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
data |
Schema 5 | |
more |
True if there are more candles in time range | Boolean |
timestamp |
Array array items: [Integer] |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
[]
This is one of:
Array (array items: [Schema 6])
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
"string"
This is one of:
Number
String (big-decimal)
Array (array len:
4, array items: [Number])
Market Analytics
GET
https://www.cryptofacilities.com/api/charts/v1/analytics/{symbol}/{analytics_type}
Analytics data divided into time buckets
Authentication is not required.
Parameters
| Parameter | In | Description | Type | Example |
|---|---|---|---|---|
analytics_type |
path | Type of analytics | String enum: "open-interest", "aggressor-differential", "trade-volume", "trade-count", "liquidation-volume", "rolling-volatility", "long-short-ratio", "long-short-info", "cvd", "top-traders", "orderbook", "spreads", "liquidity", "slippage", "future-basis" |
|
symbol |
path | Market symbol | String | |
interval |
query | Resolution in seconds | Integer enum: 60, 300, 900, 1800, 3600, 14400, 43200, 86400, 604800 |
|
since |
query | epoch time in seconds | Integer format: int64 |
1676556478 |
tooptional |
query | epoch time in seconds, default now | Integer | 1676556478 |
Response
Example response
(Some parts of this example are auto-generated)GET /analytics/{symbol}/{analytics_type}code 200application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
Example response
(Some parts of this example are auto-generated)GET /analytics/{symbol}/{analytics_type}code 400application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
Example response
(Some parts of this example are auto-generated)GET /analytics/{symbol}/{analytics_type}code 404application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
| Code | Description / Content type | Type |
|---|---|---|
| 200 | Available analytics by type and symbol | |
application/json |
Analytics response | |
| 400 | Query has invalid arguments | |
application/json |
Analytics response | |
| 404 | Symbol or analytics type could not be found | |
application/json |
Analytics response |
Schemas
Analytics response
Analytics response example
(Some parts of this example are auto-generated)
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [],
"more": false,
"timestamp": [
0
]
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
errors |
Array array items: [Analytics response error] |
result |
Result container for analytics response |
Analytics response error
Analytics response error example
(Some parts of this example are auto-generated)
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
Type: Object
Object fields:
| Field | Type |
|---|---|
error_class |
String |
severity |
String |
type |
String |
fieldoptional |
String |
msgoptional |
String |
valueoptional |
String |
Result container for analytics response
Result container for analytics response example
(Some parts of this example are auto-generated)
{
"data": [],
"more": false,
"timestamp": [
0
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
data |
Schema 1 | |
more |
True if there are more candles in time range | Boolean |
timestamp |
Array array items: [Integer] |
Schema 1
Schema 1 example
(Some parts of this example are auto-generated)
[]
This is one of:
Array (array items: [Schema 2])
Schema 2
Schema 2 example
(Some parts of this example are auto-generated)
"string"
This is one of:
Number
String (big-decimal)
Array (array len:
4, array items: [Number])
Statistic of long and short positions
Statistic of long and short positions example
(Some parts of this example are auto-generated)
{
"longCount": [
0
],
"longPercent": [
"string"
],
"ratio": [
"string"
],
"shortCount": [
0
],
"shortPercent": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
ratio |
Array array items: [String (big-decimal)] |
longCountoptional |
Array array items: [Integer] |
longPercentoptional |
Array array items: [String (big-decimal)] |
shortCountoptional |
Array array items: [Integer] |
shortPercentoptional |
Array array items: [String (big-decimal)] |
Orderbook analytics data
Orderbook analytics data example
(Some parts of this example are auto-generated)
{
"ask": {
"best_price": [
"string"
]
},
"bid": {
"best_price": [
"string"
]
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
ask |
Asks statistics |
bid |
Bids statistics |
Asks statistics
Asks statistics example
(Some parts of this example are auto-generated)
{
"best_price": [
"string"
]
}
This is one of:
Orderbook spread data
Orderbook spread data example
(Some parts of this example are auto-generated)
{
"best_price": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
best_price |
Array array items: [Null or String (big-decimal)] |
Orderbook liquidity data
Orderbook liquidity data example
(Some parts of this example are auto-generated)
{
"liquidity_005": [
"string"
],
"liquidity_01": [
"string"
],
"liquidity_025": [
"string"
],
"liquidity_05": [
"string"
],
"liquidity_10": [
"string"
],
"liquidity_100": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
liquidity_005 |
Array array items: [Null or String (big-decimal)] |
liquidity_01 |
Array array items: [Null or String (big-decimal)] |
liquidity_025 |
Array array items: [Null or String (big-decimal)] |
liquidity_05 |
Array array items: [Null or String (big-decimal)] |
liquidity_10 |
Array array items: [Null or String (big-decimal)] |
liquidity_100 |
Array array items: [Null or String (big-decimal)] |
Orderbook slippage data
Orderbook slippage data example
(Some parts of this example are auto-generated)
{
"slippage_100k": [
"string"
],
"slippage_10k": [
"string"
],
"slippage_1k": [
"string"
],
"slippage_1m": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
slippage_100k |
Array array items: [Null or String (big-decimal)] |
slippage_10k |
Array array items: [Null or String (big-decimal)] |
slippage_1k |
Array array items: [Null or String (big-decimal)] |
slippage_1m |
Array array items: [Null or String (big-decimal)] |
Combination of all orderbook metrics
Combination of all orderbook metrics example
(Some parts of this example are auto-generated)
{
"bestPrice": [
"string"
],
"liquidity005": [
"string"
],
"liquidity01": [
"string"
],
"liquidity025": [
"string"
],
"liquidity05": [
"string"
],
"liquidity10": [
"string"
],
"liquidity100": [
"string"
],
"slippage100k": [
"string"
],
"slippage10k": [
"string"
],
"slippage1k": [
"string"
],
"slippage1m": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
bestPrice |
Array array items: [Null or String (big-decimal)] |
liquidity005 |
Array array items: [Null or String (big-decimal)] |
liquidity01 |
Array array items: [Null or String (big-decimal)] |
liquidity025 |
Array array items: [Null or String (big-decimal)] |
liquidity05 |
Array array items: [Null or String (big-decimal)] |
liquidity10 |
Array array items: [Null or String (big-decimal)] |
liquidity100 |
Array array items: [Null or String (big-decimal)] |
slippage100k |
Array array items: [Null or String (big-decimal)] |
slippage10k |
Array array items: [Null or String (big-decimal)] |
slippage1k |
Array array items: [Null or String (big-decimal)] |
slippage1m |
Array array items: [Null or String (big-decimal)] |
Bids statistics
Bids statistics example
(Some parts of this example are auto-generated)
{
"best_price": [
"string"
]
}
This is one of:
AnalyticsCvdData
AnalyticsCvdData example
(Some parts of this example are auto-generated)
{
"buyVolume": [
"string"
],
"cvd": [
"string"
],
"sellVolume": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
buyVolume |
Array array items: [String (big-decimal)] |
cvd |
Array array items: [String (big-decimal)] |
sellVolume |
Array array items: [String (big-decimal)] |
AnalyticsTopTradersData
AnalyticsTopTradersData example
(Some parts of this example are auto-generated)
{
"top20Percent": {
"longCount": [
0
],
"longPercent": [
"string"
],
"openInterest": [
"string"
],
"ratio": [
"string"
],
"shortCount": [
0
],
"shortPercent": [
"string"
]
}
}
Type: Object
Object fields:
| Field | Type |
|---|---|
top20Percent |
AnalyticsTopTradersLevelData |
AnalyticsTopTradersLevelData
AnalyticsTopTradersLevelData example
(Some parts of this example are auto-generated)
{
"longCount": [
0
],
"longPercent": [
"string"
],
"openInterest": [
"string"
],
"ratio": [
"string"
],
"shortCount": [
0
],
"shortPercent": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
longCount |
Array array items: [Integer] |
longPercent |
Array array items: [String (big-decimal)] |
openInterest |
Array array items: [String (big-decimal)] |
ratio |
Array array items: [String (big-decimal)] |
shortCount |
Array array items: [Integer] |
shortPercent |
Array array items: [String (big-decimal)] |
AnalyticsLiquidityPoolData
AnalyticsLiquidityPoolData example
(Some parts of this example are auto-generated)
{
"usdValue": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
usdValue |
Array array items: [String (big-decimal)] |
AnalyticsFutureBasisData
AnalyticsFutureBasisData example
(Some parts of this example are auto-generated)
{
"basis": [
"string"
]
}
Type: Object
Object fields:
| Field | Type |
|---|---|
basis |
Array array items: [String (big-decimal)] |
Result container for analytics response
Result container for analytics response example
(Some parts of this example are auto-generated)
{
"data": [],
"more": false,
"timestamp": [
0
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
data |
Schema 3 | |
more |
True if there are more candles in time range | Boolean |
timestamp |
Array array items: [Integer] |
Schema 3
Schema 3 example
(Some parts of this example are auto-generated)
[]
This is one of:
Array (array items: [Schema 4])
Schema 4
Schema 4 example
(Some parts of this example are auto-generated)
"string"
This is one of:
Number
String (big-decimal)
Array (array len:
4, array items: [Number])
Result container for analytics response
Result container for analytics response example
(Some parts of this example are auto-generated)
{
"data": [],
"more": false,
"timestamp": [
0
]
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
data |
Schema 5 | |
more |
True if there are more candles in time range | Boolean |
timestamp |
Array array items: [Integer] |
Schema 5
Schema 5 example
(Some parts of this example are auto-generated)
[]
This is one of:
Array (array items: [Schema 6])
Schema 6
Schema 6 example
(Some parts of this example are auto-generated)
"string"
This is one of:
Number
String (big-decimal)
Array (array len:
4, array items: [Number])
Candles
Tick Types
GET
https://www.cryptofacilities.com/api/charts/v1/
Returns all available tick types to use with the markets endpoint.
Authentication is not required.
Response - application/json
Tick types list
Example response
(Some parts of this example are auto-generated)GET /code 200application/json
[
"spot"
]
Type: Array
Array of: String (enum: "spot", "mark", "trade").
Markets
GET
https://www.cryptofacilities.com/api/charts/v1/{tick_type}
Markets available for specified tick type.
List of available tick types can be fetched from the tick types endpoint.
Authentication is not required.
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
tick_type |
path | Tick Types | String enum: "spot", "mark", "trade" |
Response - application/json
Markets list
Example response
GET /{tick_type}code 200application/json
[
"PI_XRPUSD",
"FI_XRPUSD_210625",
"FI_XBTUSD_210528",
"PI_XBTUSD"
]
Type: Array
Array of: String.
Resolutions
GET
https://www.cryptofacilities.com/api/charts/v1/{tick_type}/{symbol}
Candle resolutions available for specified tick type and market.
List of available tick types can be fetched from the tick types endpoint. List of available markets can be fetched from the markets endpoint.
Authentication is not required.
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
symbol |
path | Market symbol | String |
tick_type |
path | Tick Types | String enum: "spot", "mark", "trade" |
Response - application/json
All resolutions for the given tick_type and symbol
Example response
(Some parts of this example are auto-generated)GET /{tick_type}/{symbol}code 200application/json
[
"1m"
]
Type: Array
Array of: String (enum: "1m", "5m", "15m", "30m", "1h", "4h", "12h", "1d", "1w").
Market Candles
GET
https://www.cryptofacilities.com/api/charts/v1/{tick_type}/{symbol}/{resolution}
Candles for specified tick type, market, and resolution.
List of available tick types can be fetched from the tick types endpoint. List of available markets can be fetched from the markets endpoint. List of available resolutions can be fetched from the resolutions endpoint.
Authentication is not required.
Parameters
| Parameter | In | Description | Type |
|---|---|---|---|
resolution |
path | Resolution | String enum: "1m", "5m", "15m", "30m", "1h", "4h", "12h", "1d", "1w" |
symbol |
path | Market symbol | String |
tick_type |
path | Tick Types | String enum: "spot", "mark", "trade" |
countoptional |
query | Number of candles to return. | Integer **min: **0 |
fromoptional |
query | From date in epoch seconds | Number |
tooptional |
query | To date in epoch seconds | Number |
Response - application/json
OHLC candles
Example response
(Some parts of this example are auto-generated)GET /{tick_type}/{symbol}/{resolution}code 200application/json
{
"candles": [
{
"close": "56250.00000000000",
"high": "56475.00000000000",
"low": "55935.00000000000",
"open": "56294.00000000000",
"time": 1620816960000,
"volume": 10824
}
],
"more_candles": false
}
Type: Object
Object fields:
| Field | Description | Type |
|---|---|---|
candles |
OHLC candles | Array array items: [Candlestick] |
more_candles |
True if there are more candles in time range | Boolean |
Schemas
Candlestick
Candlestick example
(Some parts of this example are auto-generated)
{
"close": "56250.00000000000",
"high": "56475.00000000000",
"low": "55935.00000000000",
"open": "56294.00000000000",
"time": 1620816960000,
"volume": 10824
}
Type: Object
Object fields:
| Field | Description | Type | Example |
|---|---|---|---|
close |
String format: big-decimal |
"56250.00000000000" |
|
high |
String format: big-decimal |
"56475.00000000000" |
|
low |
String format: big-decimal |
"55935.00000000000" |
|
open |
String format: big-decimal |
"56294.00000000000" |
|
time |
Epoch in ms | Integer format: int64 |
1620816960000 |
volume |
Number format: int64 |
10824 |
WebSocket API
WebSocket API Introduction
Sign challenge
The subscribe and unsubscribe requests to WebSocket private feeds require a signed challenge message with the user api_secret.
The challenge is obtained as is shown in Section WebSocket API Public (using the api_key).
Authenticated requests must include both the original challenge message (original_challenge) and the signed (signed_challenge) in JSON format.
Challenge
Challenge example
c100b894-1729-464d-ace1-52dbce11db42
The challenge is a UUID string.
The steps to sign the challenge are the same as the steps to generate an authenticated HTTP request except for step 1 which now is just the challenge string:
- Hash the challenge with the SHA-256 algorithm
- Base64-decode your
api_secret - Use the result of step 2 to hash the result of step 1 with the HMAC-SHA-512 algorithm
- Base64-encode the result of step 3
The result of the step 4 is the signed challenge which will be included in the subscribe request.
The table below shows the expected output from example inputs:
| Name | Value |
|---|---|
challenge |
c100b894-1729-464d-ace1-52dbce11db42 |
api_secret |
7zxMEF5p/Z8l2p2U7Ghv6x14Af+Fx+92tPgUdVQ748FOIrEoT9bgT+bTRfXc5pz8na+hL/QdrCVG7bh9KpT0eMTm |
| signed output | 4JEpF3ix66GA2B+ooK128Ift4XQVtc137N9yeg4Kqsn9PI0Kpzbysl9M1IeCEdjg0zl00wkVqcsnG4bmnlMb3A== |
Subscriptions
Subscriptions requests are sent through a web socket connection.
To subscribe to a feed, a web socket connection is required to establish a connection using the following URL:
wss://www.cryptofacilities.com/ws/v1
Keeping the connection alive
In order to keep the websocket connection alive, you will need to make a ping request at least every 60 seconds. You can see this in our sample implementation.
Snapshots and updates
For ease of use, most web socket feeds first send a snapshot of the history or current state and subsequently send real-time updates.
Authentication
In order to subscription to a private feed, clients must pass a challenge which involves signing a message (see Section Sign Challenge) with the private API key. First, a message must be sent to request the challenge. Second, the solved challenge has to be passed in every subscribe and unsubscribe message that is sent.
Limits
There are limits to both the number of connections a client can have open concurrently and the number of requests an individual connection can make. Limit values are subject to change and additional limits may be added in the future.
The current limits are:
| Resource | Allowance | Replenish Period |
|---|---|---|
| Connections | 100 | N/A |
| Requests | 100 | 1 second |
Public Feeds
Ticker
The ticker feed returns ticker information about listed products. Only tradeable markets are available via individual WebSocket market data feeds. Delta messages are throttled such that they are published every 1s.
Authentication is not required.
| Feed | Event Type | Permissible API Keys |
|---|---|---|
ticker |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "ticker",
"product_ids": [
"PI_XBTUSD"
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed",
"feed": "ticker",
"product_ids": [
"PI_XBTUSD"
]
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
product_ids |
list of strings | A list of strings which represent the products that user will receive information upon |
The subscription data will return values for all fields even if the value of only a single field has changed since the last payload.
Sample Subscription Data
{
"time":1676393235406,
"product_id": "PI_XBTUSD",
"funding_rate": -6.2604214e-11,
"funding_rate_prediction": -3.65989977e-10,
"relative_funding_rate": -1.380384722222e-6,
"relative_funding_rate_prediction": -8.047629166667e-6,
"next_funding_rate_time": 1676394000000,
"feed": "ticker",
"bid": 21978.5,
"ask": 21987.0,
"bid_size": 2536.0,
"ask_size": 13948.0,
"volume": 31403908.0,
"dtm": 0,
"leverage": "50x",
"index": 21984.54,
"premium": -0.0,
"last": 21983.5,
"change": 1.9974017538161748,
"suspended": false,
"tag": "perpetual",
"pair": "XBT:USD",
"openInterest": 30072580.0,
"markPrice": 21979.68641534714,
"maturityTime": 0,
"post_only": false,
"volumeQuote": 31403908.0
"open": 21968.5,
"high": 22123.0,
"low": 21456.0,
}
| Field | Type | Description |
|---|---|---|
time |
positive integer | The UTC time of the server in milliseconds |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
funding_rate(Perpetuals only) |
float | The current funding rate. If zero, field is not populated. |
funding_rate_prediction(Perpetuals only) |
float | The estimated next funding rate. If zero, field is not populated. |
relative_funding_rate(Perpetuals only) |
float | The absolute funding rate relative to the spot price at the time of funding rate calculation. If zero, field is not populated. |
relative_funding_rate_prediction(Perpetuals only) |
float | The estimated next absolute funding rate relative to the current spot price. If zero, field is not populated. |
next_funding_rate_time(Perpetuals only) |
float | The time until next funding rate in milliseconds. |
feed |
string | The subscribed feed |
bid |
positive float | The price of the current best bid |
ask |
positive float | The price of the current best ask |
bid_size |
positive float | The size of the current best bid |
ask_size |
positive float | The size of the current best ask |
volume |
positive float | The sum of the sizes of all fills observed in the last 24 hours |
dtm |
positive integer | The days until maturity |
leverage |
string | The leverage of the product |
index |
positive float | The real time index of the product |
premium |
float | The premium associated with the product |
last |
positive float | The price of the last trade of the product |
change |
float | The 24h change in price |
suspended |
boolean | True if the market is suspended |
tag |
string | Currently can be perpetual, month or quarter. Other tags may be added without notice. |
pair |
string | The currency pair of the instrument |
openInterest |
float | The current open interest of the instrument |
markPrice |
float | The market price of the instrument |
maturityTime |
positive integer | The UTC time, in milliseconds, at which the contract will stop trading |
post_only |
boolean | True if the market is in post-only mode |
volumeQuote |
positive float | The same as volume except that, for multi-collateral futures, it is converted to the non-base currency |
open |
positive float | The first traded price in the last 24h |
high |
positive float | The highest traded price in the last 24h |
low |
positive float | The lowest traded price in the last 24h |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid product idInvalid feedJson Error |
Trade
The trade feed returns information about executed trades
Authentication is not required.
| Feed | Event Type | Permissible API Keys |
|---|---|---|
trade |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "trade",
"product_ids": [
"PI_XBTUSD",
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed ",
"feed": "trade",
"product_ids": [
"PI_XBTUSD"
]
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
product_ids |
list of strings | A list of strings which represent the products that user will receive information upon |
Sample Subscription Snapshot Data
{
"feed": "trade_snapshot",
"product_id": "PI_XBTUSD",
"trades": [
{
"feed": "trade",
"product_id": "PI_XBTUSD",
"uid": "caa9c653-420b-4c24-a9f1-462a054d86f1",
"side": "sell",
"type": "fill",
"seq": 655508,
"time": 1612269657781,
"qty": 440,
"price": 34893
},
{
"feed": "trade",
"product_id": "PI_XBTUSD",
"uid": "45ee9737-1877-4682-bc68-e4ef818ef88a",
"side": "sell",
"type": "fill",
"seq": 655507,
"time": 1612269656839,
"qty": 9643,
"price": 34891
}
]
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed snapshot feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
uid |
string | Unique identifier for the matched trade |
side |
string | The classification of the taker side in the matched trade: buy if the taker is a buyer, sell if the taker is a seller. |
type |
string | The classification of the matched trade in an orderbook: fill if it is a normal buyer and seller, liquidation if it is a result of a user being liquidated from their position, 'assignment' if it is the result of a liquidated position being assigned, 'coveredLiquidation' if it is the result of a liquidation being covered by the liquidity pool (not available for inverse),unwind if it is a result of a user being unwound, or block if it is a component of a block trade. |
seq |
positive integer | The subscription message sequence number |
time |
positive integer | The UTC or GMT time of the trade in milliseconds |
qty |
positive float | The quantity of the traded product |
price |
positive float | The price that the product got traded |
Sample Subscription Delta Data
{
"feed": "trade",
"product_id": "PI_XBTUSD",
"uid": "05af78ac-a774-478c-a50c-8b9c234e071e",
"side": "sell",
"type": "fill",
"seq": 653355,
"time": 1612266317519,
"qty": 15000,
"price": 34969.5
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
side |
string | The classification of the taker side in the matched trade: buy if the taker is a buyer, sell if the taker is a seller. |
type |
string | The classification of the matched trade in an orderbook: fill if it is a normal buyer and seller, liquidation if it is a result of a user being liquidated from their position, 'assignment' if it is the result of a liquidated position being assigned, 'coveredLiquidation' if it is the result of a liquidation being covered by the liquidity pool (not available for inverse),unwind if it is a result of a user being unwound, or block if it is a component of a block trade. |
seq |
positive integer | The subscription message sequence number |
time |
positive integer | The UTC or GMT time of the trade in milliseconds |
qty |
positive float | The quantity of the traded product |
price |
positive float | The price that the product got traded |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
| event | string | Always error |
| message | string | An error message out of:Invalid product idInvalid feedJson Error |
Heartbeat
The heartbeat feed publishes a heartbeat message at timed intervals.
Authentication is not required.
| Feed | Event Type | Permissible API Keys |
|---|---|---|
heartbeat |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "heartbeat"
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "heartbeat"
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
Sample Subscription Data
{
"feed": "heartbeat",
"time": 1534262350627
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
time |
positive integer | The UTC time of the server in milliseconds |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Json Error"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Ticker Lite
The ticker lite feed returns ticker information about listed products. Delta messages are throttled such that they are published every 1s.
Authentication is not required.
| Feed | Event Type | Permissible API Keys |
|---|---|---|
ticker_lite |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "ticker_lite",
"product_ids": [
"PI_XBTUSD",
"FI_ETHUSD_210625"
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed ",
"feed": "ticker_lite",
"product_ids": [
"PI_XBTUSD"
]
}
{
"event": "subscribed",
"feed": "ticker_lite",
"product_ids": [
"FI_ETHUSD_210625"
]
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
product_ids |
list of strings | A list of strings which represent the products that user will receive information upon |
Sample Subscription Data
{
"feed": "ticker_lite",
"product_id": "PI_XBTUSD",
"bid": 34932,
"ask": 34949.5,
"change": 3.3705205220015966,
"premium": 0.1,
"volume": 264126741,
"tag": "perpetual",
"pair": "XBT:USD",
"dtm": 0,
"maturityTime": 0,
"volumeQuote": 264126741
}
{
"feed": "ticker_lite",
"product_id": "FI_ETHUSD_210625",
"bid": 1753.45,
"ask": 1760.35,
"change": 13.448175559936647,
"premium": 9.1,
"volume": 6899673.0,
"tag": "semiannual",
"pair": "ETH:USD",
"dtm": 141,
"maturityTime": 1624633200000,
"volumeQuote": 6899673.0
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
bid |
positive float | The price of the current best bid |
ask |
positive float | The price of the current best ask |
change |
float | The 24h change in price |
premium |
float | The premium associated with the product |
volume |
positive float | The sum of the sizes of all fills observed in the last 24 hours |
tag |
string | Currently can be week, month or quarter. Other tags may be added without notice. |
pair |
string | The currency pair of the instrument |
dtm |
integer | The days until maturity |
maturityTime |
positive integer | Maturity time in milliseconds |
volumeQuote |
positive float | The same as volume except that, for multi-collateral futures, it is converted to the non-base currency |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
| event | string | Always error |
| message | string | An error message out of:Invalid product idInvalid feedJson Error |
Challenge
This request returns a challenge to be used in handshake for user authentication.
Authentication is not required.
| Event Type | Permissible API Keys |
|---|---|
| challenge | Read-only, Read-write, Master |
Sample Sent Message
{
"event": "challenge",
"api_key": "CMl2SeSn09Tz+2tWuzPfdaJdsahq6qv5UaexXuQ3SnahDQU/gO3aT+"
}
| Field | Type | Description |
|---|---|---|
event |
string | The request event type |
api_key |
string | The user API key. |
Sample Return if Successful
{
"event": "challenge",
"message": "226aee50-88fc-4618-a42a-34f7709570b2"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always challenge |
message |
string | The message that user will have to sign for authentication reasons |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Json Error"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | Json Error |
Book
This feed returns information about the order book.
Authentication is not required.
| Feed | Event Type | Permissible API Keys |
|---|---|---|
book |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "book",
"product_ids": [
"PI_XBTUSD",
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed",
"feed": "book",
"product_ids": [
"PI_XBTUSD"
]
}
| Field | Type | Description |
|---|---|---|
| event | string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
| feed | string | The requested subscription feed |
| product_ids | list of strings | A list of strings which represent the products that user will receive information upon |
Sample Subscription Snapshot Data
{
"feed": "book_snapshot",
"product_id": "PI_XBTUSD",
"timestamp": 1612269825817,
"seq": 326072249,
"tickSize": null,
"bids": [
{
"price": 34892.5,
"qty": 6385
},
{
"price": 34892,
"qty": 10924
},
],
"asks": [
{
"price": 34911.5,
"qty": 20598
},
{
"price": 34912,
"qty": 2300
},
]
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed snapshot feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
timestamp |
positive integer | Timestamp in milliseconds |
seq |
positive integer | The subscription message sequence number |
tickSize |
string | Always null |
bids |
list of structures | A list containing buy / bid order structures |
asks |
list of structures | A list containing sell / ask order structures |
Sample Subscription Delta Data
{
"feed": "book",
"product_id": "PI_XBTUSD",
"side": "sell",
"seq": 326094134,
"price": 34981,
"qty": 0,
"timestamp": 1612269953629
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
side |
string | The order side, either buy or sell |
seq |
positive integer | The subscription message sequence number |
price |
positive float | The price of the order |
qty |
non-negative float | The updated total quantity of the orders at the price level. Value is set to 0 if all orders at this price level have been cancelled |
timestamp |
positive integer | Timestamp in milliseconds |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
| event | string | Always error |
| message | string | An error message out of:Invalid feedJson Error |
Private Feeds
Open Orders (Verbose)
This subscription feed publishes information about user open orders. This feed adds extra information about all the post-only orders that failed to cross the book.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
open_orders_verbose |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "open_orders_verbose",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "open_orders_verbose",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "open_orders_verbose_snapshot",
"account": "0f9c23b8-63e2-40e4-9592-6d5aa57c12ba",
"orders": [
{
"instrument": "PI_XBTUSD",
"time": 1567428848005,
"last_update_time": 1567428848005,
"qty": 100.0,
"filled": 0.0,
"limit_price": 8500.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "566942c8-a3b5-4184-a451-622b09493129",
"direction": 0,
"reduce_only": false
},
{
"instrument": "PI_XBTUSD",
"time": 1567428874347,
"last_update_time": 1567428874347,
"qty": 1501.0,
"filled": 0.0,
"limit_price": 7200.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "fcbb1459-6ed2-4b3c-a58c-67c4df7412cf",
"direction": 0,
"reduce_only": false
},
{
"instrument": "PI_XBTUSD",
"time": 1567515137945,
"last_update_time": 1567515137945,
"qty": 102.0,
"filled": 0.0,
"limit_price": 8500.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "3deea5c8-0274-4d33-988c-9e5a3895ccf8",
"direction": 0,
"reduce_only": false
}
]
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account |
orders |
list of structures | A list containing the user open orders |
instrument |
string | The instrument (referred also as symbol or product_id) of the order |
time |
positive integer | The UTC time in milliseconds that the order was created |
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated |
qty |
positive float | The remaining quantity of the order |
filled |
positive float | The total amount of the order that has been filled |
limit_price |
positive float | The limit price of the order |
stop_price |
positive float | The stop price of the order |
type |
string | The order type, limit or stop |
order_id |
UUID | The order id |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
reduce_only |
boolean | If true, the order can only reduce open positions, it cannot increase or open new positions |
triggerSignal |
string | Trigger signal selected for take profit or stop loss order. Options are last, mark, or spot. Returned only for take profit or stop loss orders |
Sample Subscription Delta Data
{
"feed": "open_orders_verbose",
"order": {
"instrument": "PI_XBTUSD",
"time": 1567597581495,
"last_update_time": 1567597581495,
"qty": 102.0,
"filled": 0.0,
"limit_price": 10601.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "fa9806c9-cba9-4661-9f31-8c5fd045a95d",
"direction": 0,
"reduce_only": false
},
"is_cancel": true,
"reason": "post_order_failed_because_it_would_be_filled"
}
{
"feed": "open_orders_verbose",
"order_id": "660c6b23-8007-48c1-a7c9-4893f4572e8c",
"is_cancel": true,
"reason": "cancelled_by_user"
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
order |
structure | The user new order |
instrument |
string | The instrument (referred also as symbol or product_id) of the order |
time |
positive integer | The UTC time in milliseconds that the order was created |
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated |
qty |
positive float | The remaining quantity of the order |
filled |
positive float | The total amount of the order that is filled |
limit_price |
positive float | The limit price of the order |
stop_price |
positive float | The stop price of the order |
type |
string | The order type, limit, take_profit, or stop |
order_id |
UUID | The order id |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
reduce_only |
boolean | If true, the order can only reduce open positions, it cannot increase or open new positions |
triggerSignal |
string | Trigger signal selected for take profit or stop loss order. Options are last, mark, or spot. Returned only for take profit or stop loss orders |
is_cancel |
boolean | If false the open order has been either placed or partially filled and needs to be updated. An order struct will be present.If true the open order was either fully filled (will include order struct) or cancelled (will not include order struct) and must be removed from open orders snapshot |
reason |
string | Reason behind the received delta.new_placed_order_by_user: User placed a new orderedited_by_user: User edited an existing orderliquidation: User position liquidated. The order cancelledstop_order_triggered: A stop order triggered. The system removed the stop orderlimit_order_from_stop: The system created a limit order because an existing stop order triggeredpartial_fill: The order filled partiallyfull_fill: The order filled fully and removedcancelled_by_user: The order cancelled by the user and removedcontract_expired: The order contract expired. All open orders of that contract removednot_enough_margin: The order removed due to insufficient marginmarket_inactive: The order removed because market became inactivecancelled_by_admin: The order removed by administrator's actiondead_man_switch: The order removed because dead man's switch was triggeredioc_order_failed_because_it_would_not_be_executed: The immediate or cancel order was rejected due to insufficient liquiditypost_order_failed_because_it_would_filled: The post only order was rejected as it crosses the spread and would be immediately filledwould_execute_self: The order was rejected as it would execute against another order from the same accountwould_not_reduce_position: The order was rejected as it the reduce-only option was selected and it would not reduce the positionorder_for_edit_not_found: The order edit was rejected as the order to be edited could not be found |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Open Positions
This subscription feed publishes the open positions of the user account.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
open_positions |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "open_positions",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "open_positions",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed. |
feed |
string | The requested subscription feed. |
api_key |
string | The user api key. |
original_challenge |
string | The message that is received from a challenge request. |
signed_challenge |
string | The signed challenge message with user api secret. |
Sample Subscription Data
{
"feed": "open_positions",
"account": "DemoUser",
"positions": [
{
"instrument":"PI_XRPUSD"
"balance":500.0,
"pnl":-239.6506683474764,
"entry_price":0.3985,
"mark_price":0.4925844,
"index_price":0.49756,
"liquidation_threshold":0.0,
"effective_leverage":0.17404676894304316,
"return_on_equity":-2.3609636135508127,
"initial_margin":101.5054475943615,
"initial_margin_with_orders":101.5054475943615,
"maintenance_margin":50.75272379718075
},
{
"instrument":"PF_XBTUSD",
"balance":0.04,
"pnl":119.56244985549435,
"entry_price":26911.75,
"mark_price":29900.81124638736,
"index_price":29900.47,
"liquidation_threshold":9572.804662403718,
"effective_leverage":0.31865408963748215,
"return_on_equity":5.553450159107747,
"unrealized_funding":0.0004114160669590132,
"initial_margin":21.529400000000003,
"initial_margin_with_orders":21.529400000000003,
"maintenance_margin":10.764700000000001,
"pnl_currency":"USD"
} …,
],
"seq":4,
"timestamp":1687383625330
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed. |
account |
string | The user account. |
positions |
list of structures | A list containing the user open positions. |
instrument |
string | The instrument (referred also as symbol or product_id) of the position. |
balance |
float | The size of the position. |
entry_price |
positive float | The average entry price of the instrument. |
mark_price |
positive float | The market price of the position instrument. |
index_price |
positive float | The index price of the position instrument. |
pnl |
float | The profit and loss of the position. |
liquidation_threshold |
float | The mark price of the contract at which the position will be liquidated. |
return_on_equity |
float | The percentage gain or loss relative to the initial margin used in the position. Formula: PnL/IM |
unrealized_funding |
float | Unrealised funding from funding rate |
effective_leverage |
float | How leveraged the net position is in a given margin account. Formula: Position Value at Market / Portfolio Value. |
initial_margin |
float | The initial margin for the open position. |
initial_margin_with_orders |
float | The initial margin for the open position and open orders of the same instrument. |
maintenance_margin |
float | The maintenance margin for the open. |
pnl_currency |
string | The profit currency for the position, not returned for inverse positions. |
seq |
positive integer | The message sequence. |
timestamp |
positive integer | The unix timestamp of open positions state in milliseconds. |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid product idInvalid feedJson Error |
Account Log
This subscription feed publishes account information.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
account_log |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "account_log",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "account_log",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "account_log_snapshot",
"logs": [
{
"id": 1690,
"date": "2019-07-11T08:00:00.000Z",
"asset": "bch",
"info": "funding rate change",
"booking_uid": "86fdc252-1b6e-40ec-ac1d-c7bd46ddeebf",
"margin_account": "f-bch:usd",
"old_balance": 0.01215667051,
"new_balance": 0.01215736653,
"old_average_entry_price": 0.0,
"new_average_entry_price": 0.0,
"trade_price": 0.0,
"mark_price": 0.0,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "",
"collateral": "bch",
"funding_rate": -8.7002552653e-08,
"realized_funding": 6.9602e-07,
"conversion_spread_percentage": 0.0
"liquidation_fee":0.0
},
{
"id": 1689,
"date": "2019-07-11T04:00:00.000Z",
"asset": "bch",
"info": "funding rate change",
"booking_uid": "680d3973-5774-4a9d-b807-ab8aa73f95c3",
"margin_account": "f-bch:usd",
"old_balance": 0.01215715298,
"new_balance": 0.01215667051,
"old_average_entry_price": 0.0,
"new_average_entry_price": 0.0,
"trade_price": 0.0,
"mark_price": 0.0,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "",
"collateral": "bch",
"funding_rate": 6.0309345058e-08,
"realized_funding": -4.8247e-07,
"conversion_spread_percentage": 0.0
"liquidation_fee":0.0
},
{
"id": 1688,
"date": "2019-07-11T00:00:00.000Z",
"asset": "bch",
"info": "funding rate change",
"booking_uid": "72e3396e-8fc4-4bd9-9379-8e2b2225af85",
"margin_account": "f-bch:usd",
"old_balance": 0.01215847263,
"new_balance": 0.01215715298,
"old_average_entry_price": 0.0,
"new_average_entry_price": 0.0,
"trade_price": 0.0,
"mark_price": 0.0,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "",
"collateral": "bch",
"funding_rate": 1.64955714332e-07,
"realized_funding": -1.31965e-06,
"conversion_spread_percentage": 0.0
"liquidation_fee":0.0
}
]
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
logs |
list of structures | A list containing the account logs |
id |
positive integer | The identifier of the log |
date |
ISO8601 datetime | The creation time of the log according to server date and time |
asset |
string | The asset related of the booking |
info |
string | A description of the booking |
booking_uid |
string | The unique id of the booking |
margin_account |
string | The name of the account associated with the entry |
old_balance |
float | The account balance before the described action in 'info' |
new_balance |
float | The new balance of wallet or new size of the position after the described action in 'info' |
old_average_entry_price |
positive float | The average entry price of the position prior to this trade |
new_average_entry_price |
positive float | The average entry price of the position after this trade |
trade_price |
positive float | The price the trade was executed at |
mark_price |
positive float | The mark price at the time the trade was executed |
realized_pnl |
float | The pnl that is realized by reducing the position |
fee |
float | The fee paid |
execution |
string | The uid of the associated execution |
collateral |
string | The currency of the associated entry |
funding_rate |
float | The absolute funding rate |
realized_funding |
float | The funding rate realized due to change in position size or end of funding rate period |
conversion_spread_percentage |
float | The percentage conversion spread used in a currency conversion |
liquidation_fee |
float | The liquidation fee associated with a liquidation/assignment entry. Not applicable for inverse futures |
Sample Subscription Delta Data
{
"feed": "account_log",
"new_entry": {
"id": 1697,
"date": "2019-07-11T13: 00: 27.632Z",
"asset": "pi_bchusd",
"info": "futures trade",
"booking_uid": "55a02b5b-2c90-4d43-b0eb-eb3801d50e3f",
"margin_account": "f-bch:usd",
"old_balance": 1.0,
"new_balance": 2.0,
"old_average_entry_price": 413.3,
"new_average_entry_price": 374.3445326979084,
"trade_price": 342.1,
"mark_price": 342.4,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "fc49fea9-8827-4a2e-8e36-c047523ddc30",
"collateral": "bch"
"funding_rate": 1.64955714332e-07,
"realized_funding": -1.31965e-06,
"conversion_spread_percentage": 0.0
"liquidation_fee":0.0
}
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
logs |
list of structures | A list containing the account logs |
id |
positive integer | The identifier of the log |
date |
ISO8601 datetime | The creation time of the log according to server date and time |
asset |
string | The asset related of the booking |
info |
string | A description of the booking |
booking_uid |
string | The unique id of the booking |
margin_account |
string | The name of the account associated with the entry |
old_balance |
float | The account balance before the described action in 'info' |
new_balance |
float | The new balance of wallet or new size of the position after the described action in 'info' |
old_average_entry_price |
positive float | The average entry price of the position prior to this trade |
new_average_entry_price |
positive float | The average entry price of the position after this trade |
trade_price |
positive float | The price the trade was executed at |
mark_price |
positive float | The mark price at the time the trade was executed |
realized_pnl |
float | The pnl that is realized by reducing the position |
fee |
float | The fee paid |
execution |
string | The uid of the associated execution |
collateral |
string | The currency of the associated entry |
funding_rate |
float | The absolute funding rate |
realized_funding |
float | The funding rate realized due to change in position size or end of funding rate period |
conversion_spread_percentage |
float | The percentage conversion spread used in a currency conversion |
liquidation_fee |
float | The liquidation fee associated with a liquidation/assignment entry. Not applicable for inverse futures |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Fills
This subscription feed publishes fills information.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
fills |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "fills",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful
{
"event": "subscribed",
"feed": "fills",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Optionally, the
product_idsfield can be used to subscribe only to specific products
{
"event": "subscribe",
"feed": "fills",
"product_ids": ["FI_XBTUSD_200925"],
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful
{
"event": "subscribed",
"feed": "fills",
"product_ids": ["FI_XBTUSD_200925"],
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed. |
feed |
string | The requested subscription feed. |
| `product_ids | list | List of product identifiers to subscribe for. Other products are ignored. |
api_key |
string | The user api key. |
original_challenge |
string | The message that is received from a challenge request. |
signed_challenge |
string | The signed challenge message with user api secret. |
Sample Subscription Snapshot Data
{
"feed": "fills_snapshot",
"account": "DemoUser",
"fills": [
{
"instrument": "FI_XBTUSD_200925",
"time": 1600256910739,
"price": 10937.5,
"seq": 36,
"buy": true,
"qty": 5000.0,
"remaining_order_qty":0.0,
"order_id": "9e30258b-5a98-4002-968a-5b0e149bcfbf",
"fill_id": "cad76f07-814e-4dc6-8478-7867407b6bff",
"fill_type": "maker",
"fee_paid": -0.00009142857,
"fee_currency": "BTC",
"taker_order_type": "ioc",
"order_type": "limit"
},
{
"instrument": "PI_ETHUSD",
"time": 1600256945531,
"price": 364.65,
"seq": 39,
"buy": true,
"qty": 5000.0,
"remaining_order_qty":0.0,
"order_id": "7e60b6e8-e4c2-4ce8-bbd0-ef81e18b65bb",
"fill_id": "b1aa44b2-4f2a-4031-999c-ae1175c91580",
"fill_type": "taker",
"fee_paid": 0.00685588921,
"fee_currency": "ETH",
"taker_order_type": "market",
"order_type": "limit"
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed. |
account |
string | The user account. |
fills |
list of structures | A list containing fill elements of the user account. |
instrument |
string | The fill instrument (referred also as symbol or product_id). |
time |
positive integer | The server UTC date and time in milliseconds. |
price |
positive float | The price at which the order was filled. |
seq |
positive integer | The subscription message sequence number. |
buy |
boolean | A flag that shows if filled order was a buy. |
qty |
positive float | The quantity that was filled. |
remaining_order_qty |
float | The remaining unfilled quantity in the order |
order_id |
UUID | The order id that was filled. |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id. |
fill_id |
UUID | The fill id. |
fill_type |
string | The classification of the fill:maker if the user has a limit order that gets filled,taker if the user makes an execution that crosses the spread,liquidation if an execution is the result of a liquidation,assignee if an execution is a result of a counterparty receiving an Assignment in PAS,assignor if an execution is a result of the user assigning their position due to a failed liquidation,unwindBankrupt any portion of a liquidated position cannot be filled or assigned, the remaining contracts are unwound.unwindCounterparty any portion of your counterparty's position is liquidated and cannot be filled or assigned the remaining contracts are unwound. More information on our Equity Protection Process.takerAfterEdit if the user edits the order and it is instantly executed. |
fee_paid |
positive float | Fee paid on fill |
fee_currency |
string | Currency in which the fee was charged. See "Currencies" on Ticker Symbols |
taker_order_type |
string | The order type of the taker execution side. |
order_type |
string | The order type. |
Sample Subscription Delta Data
{
"feed": "fills",
"username": "DemoUser",
"fills": [
{
"instrument": "PI_XBTUSD",
"time": 1600256966528,
"price": 364.65,
"seq": 100,
"buy": true,
"qty": 5000.0,
"remaining_order_qty":0.0,
"order_id": "3696d19b-3226-46bd-993d-a9a7aacc8fbc",
"cli_ord_id": "8b58d9da-fcaf-4f60-91bc-9973a3eba48d",
"fill_id": "c14ee7cb-ae25-4601-853a-d0205e576099",
"fill_type": "taker",
"fee_paid": 0.00685588921,
"fee_currency": "ETH",
"taker_order_type": "liquidation",
"order_type": "limit"
} …,
]
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed. |
username |
string | The user name. |
fills |
list of structures | A list containing fill elements of the user account. |
instrument |
string | The fill instrument (referred also as symbol or product_id). |
time |
positive | The server UTC date and time in milliseconds. |
price |
positive float | The price at which the order was filled. |
seq |
positive integer | The subscription message sequence number. |
buy |
boolean | A flag that shows if filled order was a buy. |
qty |
positive float | The quantity that was filled. |
remaining_order_qty |
float | The remaining unfilled quantity in the order |
order_id |
UUID | The order id that was filled. |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id. |
fill_id |
UUID | The fill id. |
fill_type |
string | The classification of the fill:maker if the user has a limit order that gets filled,taker if the user makes an execution that crosses the spread,liquidation if an execution is the result of a liquidation,assignee if an execution is a result of a counterparty receiving an Assignment in PAS,assignor if an execution is a result of the user assigning their position due to a failed liquidation,takerAfterEdit if the user edits the order and it is instantly executed. |
fee_paid |
positive float | Fee paid on fill |
fee_currency |
string | Currency in which the fee was charged. See "Currencies" on Ticker Symbols |
taker_order_type |
string | The order type of the taker execution side. |
order_type |
string | The order type |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Open Orders
This subscription feed publishes information about user open orders.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
open_orders |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "open_orders",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful
{
"event": "subscribed",
"feed": "open_orders",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "open_orders_snapshot",
"account": "e258dba9-4dd4-4da5-bfef-75beb91c098e",
"orders": [
{
"instrument": "PI_XBTUSD",
"time": 1612275024153,
"last_update_time": 1612275024153,
"qty": 1000,
"filled": 0,
"limit_price": 34900,
"stop_price": 13789,
"type": "stop",
"order_id": "723ba95f-13b7-418b-8fcf-ab7ba6620555",
"direction": 1,
"reduce_only": false,
"triggerSignal": "last"
},
{
"instrument": "PI_XBTUSD",
"time": 1612275024153,
"last_update_time": 1612275178153,
"qty": 12,
"filled": 0,
"stop_price": 3200.1,
"type": "trailing_stop",
"order_id": "59302619-41d2-4f0b-941f-7e7914760ad3",
"direction": 1,
"reduce_only": false,
"triggerSignal": "mark",
"trailing_stop_options": {
"max_deviation": 20.0,
"unit": "percent"
},
"limit_price_offset": {
"price_offset": -10.0,
"unit": "percent"
}
},
{
"instrument": "PI_XBTUSD",
"time": 1612275209430,
"last_update_time": 1612275209430,
"qty": 1000,
"filled": 0,
"limit_price": 35058,
"stop_price": 0,
"type": "limit",
"order_id": "7a2f793e-26f3-4987-a938-56d296a11560",
"direction": 1,
"reduce_only": false
}
]
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account |
orders |
list of structures | A list containing the user open orders |
instrument |
string | The instrument (referred also as symbol or product_id) of the order |
time |
positive integer | The UTC time in milliseconds that the order was created |
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated |
qty |
positive float | The remaining quantity of the order |
filled |
positive float | The total amount of the order that has been filled |
limit_price |
positive float | The limit price of the order |
stop_price |
positive float | The stop price of the order |
type |
string | The order type, limit, stop, or take_profit |
order_id |
UUID | The order id |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
reduce_only |
boolean | If true, the order can only reduce open positions, it cannot increase or open new positions |
triggerSignal |
string | Trigger signal selected for take profit or stop loss order. Options are last, mark, or spot. Returned only for take profit or stop loss orders |
trailing_stop_options |
structure | If this order is a trailing stop, this contains its parameters |
limit_price_offset |
structure | Relative offset from the stop price to place a limit order on trigger activation |
Sample Subscription Delta Data
{
"feed": "open_orders",
"order": {
"instrument": "PI_XBTUSD",
"time": 1567702877410,
"last_update_time": 1567702877410,
"qty": 304.0,
"filled": 0.0,
"limit_price": 10640.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "59302619-41d2-4f0b-941f-7e7914760ad3",
"direction": 1,
"reduce_only": true
},
"is_cancel": false,
"reason": "new_placed_order_by_user"
}
{
"feed": "open_orders",
"order_id": "660c6b23-8007-48c1-a7c9-4893f4572e8c",
"is_cancel": true,
"reason": "cancelled_by_user"
}
| Field | Type | Description | |||
|---|---|---|---|---|---|
feed |
string | The subscribed feed | |||
order |
structure | The user new order | |||
instrument |
string | The instrument (referred also as symbol or product_id) of the order | |||
time |
positive integer | The UTC time in milliseconds that the order was created | |||
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated | |||
qty |
positive float | The remaining quantity of the order | |||
filled |
positive float | The total amount of the order that is filled | |||
limit_price |
positive float | The limit price of the order | |||
stop_price |
positive float | The stop price of the order | |||
type |
string | The order type, limit or stop | |||
order_id |
UUID | The order id | |||
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id | |||
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order | |||
is_cancel |
boolean | If false the open order has been either placed or partially filled and needs to be updated. An order struct will be present.If true the open order was either fully filled (will include order struct) or cancelled (will not include order struct) and must be removed from open orders snapshot |
|||
reason |
string | Reason behind the received delta.new_placed_order_by_user: User placed a new orderedited_by_user: User edited an existing orderliquidation: User position liquidated. The order cancelledstop_order_triggered: A stop order triggered. The system removed the stop orderlimit_order_from_stop: The system created a limit order because an existing stop order triggeredpartial_fill: The order filled partiallyfull_fill: The order filled fully and removedcancelled_by_user: The order cancelled by the user and removedcontract_expired: The order contract expired. All open orders of that contract removednot_enough_margin: The order removed due to insufficient marginmarket_inactive: The order removed because market became inactivecancelled_by_admin: The order removed by administrator's action |
|||
trailing_stop_options |
structure | If this order is a trailing stop, this contains its parameters | |||
limit_price_offset |
structure | Relative offset from the stop price to place a limit order on trigger activation |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Trailing stop options
| Field | Type | Description |
|---|---|---|
max_deviation |
double | The maximum distance the trigger price may be away from the trigger signal |
unit |
string | The unit of the deviation, one of:percentquote_currency |
Limit price offset
| Field | Type | Description |
|---|---|---|
price_offset |
double | The relative offset from the trigger price at which a limit order should be placed |
unit |
string | The unit of the offset, one of:percentquote_currency |
Balances
This feed returns balance information for holding wallets and single collateral wallets.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
balances |
subscribe / unsubscribe |
Any | Yes |
Subscription request
Sample sent message
{
"event": "subscribe",
"feed": "balances",
"api_key": "drUfSSmBbDpcIpwpqK0OBTcGLdAYZJU+NlPIsHaKspu/8feT2YSKl+Jw",
"original_challenge": "c094497e-9b5f-40da-a122-3751c39b107f",
"signed_challenge": "Ds0wtsHaXlAby/Vnoil59Q+yJIrJwZGUlgECD3+qEvFcTFfacJi2LrSRzAoqwBAeZk4pGXSmyyIW0uDymZ3olw=="
}
Sample return if successful
{
"event": "subscribed",
"feed": "balances",
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Balances Snapshot Data
Sample Subscription Snapshot Data
{
"feed": "balances_snapshot",
"account": "4a012c31-df95-484a-9473-d51e4a0c4ae7",
"holding": {
"USDT": 4997.5012493753,
"XBT": 0.1285407184,
"ETH": 1.8714395862,
"LTC": 47.6462740614,
"GBP": 3733.488646461,
"USDC": 5001.00020004,
"USD": 5000.0,
"BCH": 16.8924625832,
"EUR": 4459.070194683,
"XRP": 7065.5399485629
},
"futures": {
"F-ETH:EUR": {
"name": "F-ETH:EUR",
"pair": "ETH/EUR",
"unit": "EUR",
"portfolio_value": 0.0,
"balance": 0.0,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.0,
"unrealized_funding": 0.0,
"pnl": 0.0
},
"F-XBT:USD": {
"name": "F-XBT:USD",
"pair": "XBT/USD",
"unit": "XBT",
"portfolio_value": 0.0,
"balance": 0.0,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.0,
"unrealized_funding": 0.0,
"pnl": 0.0
},
},
"timestamp":1640995200000,
"seq":0
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account name |
timestamp |
positive integer | The unix timestamp of the balance state in milliseconds |
seq |
positive integer | The subscription message sequence number |
holding |
map of floats | A map from currency names to balance quantity |
futures |
map of structures | A map from single collateral wallet names to collateral wallet structure |
Holding Wallet
| Field | Type | Description |
|---|---|---|
| currency | positive float | The balance in the holding wallet |
Futures Wallet
| Field | Type | Description |
|---|---|---|
name |
string | The name of the account |
pair |
string | The wallet currency pair |
unit |
string | The wallet settlement unit |
portfolio_value |
float | The current balance with haircuts and any unrealized margin from open positions in settlement units |
balance |
float | The current balance in settlement units |
maintenance_margin |
positive float | The maintenance margin for open positions |
initial_margin |
float | The initial margin for open positions and open orders |
available |
float | The current portfolio value minus initial margin |
unrealized_funding |
positive float | The total unrealized funding for open positions |
pnl |
positive float | The total profit and loss for open positions |
Balances Delta Data
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account name |
timestamp |
positive integer | The unix timestamp of the balance state in milliseconds |
seq |
positive integer | The subscription message sequence number |
holding |
optional map of floats | A map from currency names to balance quantity |
futures |
optional map of structures | A map from single collateral wallet names to collateral wallet structure |
Sample Holding Wallet Balance Delta
{
"feed": "balances",
"account": "7a641082-55c7-4411-a85f-930ec2e09617",
"holding": {
"USD": 5000.0
},
"futures": {},
"timestamp": 1640995200000,
"seq": 83
}
Sample Single-Collateral Balance Delta
{
"feed": "balances",
"account": "7a641082-55c7-4411-a85f-930ec2e09617",
"holding": {},
"futures": {
"F-XBT:USD": {
"name": "F-XBT:USD",
"pair": "XBT/USD",
"unit": "XBT",
"portfolio_value": 0.1219368845,
"balance": 0.1219368845,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.1219368845,
"unrealized_funding": 0.0,
"pnl": 0.0
}
},
"timestamp": 1640995200000,
"seq": 2
}
Sample return if unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Unsuccessful subscription result
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Account Balances (and margins)
This subscription feed returns balance and margin information for the client's account.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
account_balances_and_margins |
subscribe / unsubscribe |
Any | Yes |
Sample sent message
{
"event": "subscribe",
"feed": "account_balances_and_margins",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample return if successful
{
"event": "subscribed",
"feed": "account_balances_and_margins",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample subscription data
{
"feed": "account_balances_and_margins",
"account": "DemoUser",
"margin_accounts": [
{
"name": "xbt",
"type": "holding",
"balance": 0,
"pnl": 0,
"funding": 0,
"pv": 0,
"am": 0,
"im": 0,
"mm": 0
},
{
"name": "f-xbt:usd",
"type": "inversed",
"balance": 9.99730211055,
"pnl": -0.00006034858674327812,
"funding": 0,
"pv": 9.997241761963258,
"am": 9.99666885201038,
"im": 0.0005729099528781564,
"mm": 0.0002864549764390782
},
],
"seq": 14
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account name |
seq |
positive integer | The subscription message sequence number |
margin_accounts |
list of structures | A list containing the margin account structures |
name |
string | The name of the account |
type |
string | The account type. enum:["holding", "inversed", "vanilla"] |
balance |
positive float | The current balance of the account |
pnl |
float | The profit and loss of the account |
funding |
float | Unrealised funding on the account |
pv |
positive float | The portfolio value calculated as balance plus unrealised pnl value |
am |
positive float | The available margin for opening new positions |
im |
positive float | The initial margin for open positions and orders |
mm |
positive float | The maintenance margin for open positions |
Sample return if unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Notifications
This subscription feed publishes notifications to the client.
Authentication is required.
| Feed | Event Type | API Keys | Original & Signed Challenge |
|---|---|---|---|
notifications_auth |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "notifications_auth",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful
{
"event": "subscribed",
"feed": "notifications_auth",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
| Field | Type | Description |
|---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "notifications_auth",
"notifications": [
{
"id": 5,
"type": "market",
"priority": "low",
"note": "A note describing the notification.",
"effective_time": 1520288300000
},
...
]
}
| Field | Type | Description |
|---|---|---|
feed |
string | The subscribed feed |
notifications |
list of structures | A list containing the notifications. |
id |
positive integer | The notification id |
type |
string | The notification type. Existing types are market, general, new_feature, bug_fix, maintenance, settlement.If type is maintenance then it implies downtime will occur at effective_time if priority is high |
priority |
string | The notification priority. Existing priorities are low, medium, high.If priority is high then it implies downtime will occur at effective_time when type is maintenance. |
note |
string | The notification note. A short description about the specific notification. |
effective_time |
integer | The time that notification is taking effect. |
expected_downtime_minutes |
integer | The expected downtime in minutes or absent if no downtime is expected. |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Json Error"
}
| Field | Type | Description |
|---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feedJson Error |
Additional Resources
Support and malfunction reporting
If you require assistance regarding your API implementation, or if you have questions regarding the API’s functionalities or suggestions for improvements, contact our support team by opening a ticket. We also appreciate any feedback regarding unexpected behaviour of the API or possible shortcomings of the API documentation.
Sample implementations
Sample implementations of the API in Java, Python, C# and Visual Basic .NET can be found on our GitHub page:
https://github.com/cryptofacilities
If you have implemented the API in a language that is not listed here and would like to share your code, contact our support team by opening a ticket.