NAV

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:

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_xbtusd will not contain the keys suspended, lastSize, vol24h, bid, bidSize, ask, askSize and markPrice. This is because rr_xbtusd is 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

cryptofacilities.com

API URLs

To access the HTTP API's endpoints, HTTP calls need to be sent to endpoints under:

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:

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, and authent are 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:

  1. Concatenate postData + Nonce + endpointPath
  2. Hash the result of step 1 with the SHA-256 algorithm
  3. Base64-decode your api_secret
  4. Use the result of step 3 to hash the result of the step 2 with the HMAC-SHA-512 algorithm
  5. Base64-encode the result of step 4

Request Limits

Example

The following shows the return of call of the sendorder endpoint 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 sendorder endpoint.

{
  "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 sendorder endpoint 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
Response - application/json

Example response: success
GET /accounts
code 200
application/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"
accounts
optional
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
cash
optional
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
balances
optional
A structure containing account balances. CashAccountBalances
type
optional
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
auxiliary
optional
A structure containing auxiliary account information. Auxiliary
balances
optional
A structure containing account balances. MarginAccountBalances
currency
optional
The currency of the account. All figures shown in auxiliary and marginRequirements are in this currency. Null or String
marginRequirements
optional
A structure containing the account's margin requirements. MarginRequirements
triggerEstimates
optional
A structure containing the account's margin trigger estimates. MarginRequirements
type
optional
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
af
optional
The available funds of the account, in currency. Number
funding
optional
Number
pnl
optional
The PnL of current open positions of the account, in currency. Number
pv
optional
The portfolio value of the account, in currency. Number
usd
optional
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
im
optional
The initial margin requirement of the account. Number
lt
optional
The liquidation threshold of the account. Number
mm
optional
The maintenance margin requirement of the account. Number
tt
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Response - application/json

Example response: failure
GET /openpositions
code 200
application/json

{
  "error": "apiLimitExceeded",
  "result": "error",
  "serverTime": "2016-02-25T09:45:53.818Z"
}

Example response: success
GET /openpositions
code 200
application/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"
openPositions
optional
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
fillTime
optional
The date and time the position was entered into (Deprecated field, fills endpoint for fill time is recommended). String
price
optional
The average price at which the position was entered into. Number
format: double
side
optional
The direction of the position. String
enum: "long", "short"
size
optional
The size of the position. Number
format: double
symbol
optional
The symbol of the Futures. String
unrealizedFunding
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Response - application/json

Example response: success
GET /unwindqueue
code 200
application/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"
queue
optional
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
percentile
optional
The percentile rank of which the trader's position is in the unwind queue (20, 40, 80, or 100). Number
symbol
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
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
maxPosition
optional
query The maximum position Number
maxSize
optional
query The maximum size for an assignment Number
Response - application/json

Example response
(Some parts of this example are auto-generated)
POST /assignmentprogram/add
code 200
application/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"
id
optional
Number
participant
optional
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
acceptLong
optional
Boolean
acceptShort
optional
Boolean
contract
optional
Null or String
contractType
optional
String
enabled
optional
Boolean
maxPosition
optional
Null or Number
format: double
maxSize
optional
Null or Number
format: double
timeFrame
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Response - application/json

Example response
(Some parts of this example are auto-generated)
GET /assignmentprogram/current
code 200
application/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"
participants
optional
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
id
optional
Number
participant
optional
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
acceptLong
optional
Boolean
acceptShort
optional
Boolean
contract
optional
Null or String
contractType
optional
String
enabled
optional
Boolean
maxPosition
optional
Null or Number
format: double
maxSize
optional
Null or Number
format: double
timeFrame
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
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/delete
code 200
application/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"
id
optional
Number
participant
optional
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
acceptLong
optional
Boolean
acceptShort
optional
Boolean
contract
optional
Null or String
contractType
optional
String
enabled
optional
Boolean
maxPosition
optional
Null or Number
format: double
maxSize
optional
Null or Number
format: double
timeFrame
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Response - application/json

Example response
(Some parts of this example are auto-generated)
GET /assignmentprogram/history
code 200
application/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"
participants
optional
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
deleted
optional
Boolean
participant
optional
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
acceptLong
optional
Boolean
acceptShort
optional
Boolean
contract
optional
Null or String
contractType
optional
String
enabled
optional
Boolean
maxPosition
optional
Null or Number
format: double
maxSize
optional
Null or Number
format: double
timeFrame
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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 /feeschedules
code 200
application/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"
feeSchedules
optional
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
name
optional
Name of schedule. String "PGTMainFees"
tiers
optional
A list containing a structures for each fee tier, see below. Array
array items: [FeeTier]
uid
optional
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
makerFee
optional
Percentage value of maker fee in the tier. Number 0.015
takerFee
optional
Percentage value of taker fee in the tier. Number 0.04
usdVolume
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Response - application/json

Example response: success
GET /feeschedules/volumes
code 200
application/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"
volumesByFeeSchedule
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Response - application/json

Example response: failure
GET /notifications
code 200
application/json

{
  "error": "apiLimitExceeded",
  "result": "error",
  "serverTime": "2016-02-25T09:45:53.818Z"
}

Example response: success
GET /notifications
code 200
application/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"
notifications
optional
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
effectiveTime
optional
The time that notification is taking effect. String
expectedDowntimeMinutes
optional
The expected downtime in minutes or absent if no downtime is expected. Integer
note
optional
The notification note. A short description about the specific notification. String
priority
optional
The notification priorities:

- low - medium - high

If priority == "high" then it implies downtime will occur at effective_time when type == "maintenance".
String
enum: "low", "medium", "high"
type
optional
The notification types:

- market - general - new_feature - bug_fix - maintenance - settlement

If 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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Parameters
Parameter In Description Type
lastFillTime
optional
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 /fills
code 200
application/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"
fills
optional
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
cliOrdId
optional
The unique client order identifier.

This field is returned only if the order has a client order ID.
Null or String
fillTime
optional
The date and time the order was filled. String "2021-11-18T02:39:41.826Z"
fillType
optional
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_id
optional
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_id
optional
The unique identifier of the order. String
format: uuid
price
optional
The price of the fill. Number 47000
side
optional
The direction of the order. String
enum: "buy", "sell"
"buy"
size
optional
The size of the fill. Number 10
symbol
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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/historicalfundingrates
code 200
application/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"
rates
optional
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
fundingRate
optional
The absolute funding rate for the listed time period Number
relativeFundingRate
optional
The relative funding rate for the listed time period Number
timestamp
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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

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 /instruments
code 200
application/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"
instruments
optional
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
category
optional
'Category of the contract: "Layer 1", "Layer 2", "DeFi", or "Privacy" (multi-collateral contracts only).' String
contractSize
optional
For futures: The contract size of the Futures

For indices: Not returned because N/A
Number
contractValueTradePrecision
optional
Trade precision for the contract (e.g. trade precision of 2 means trades are precise to the hundredth decimal place 0.01). Number
feeScheduleUid
optional
Unique identifier of fee schedule associated with the instrument String
fundingRateCoefficient
optional
Number
impactMidSize
optional
Amount of contract used to calculated the mid price for the mark price Number
isin
optional
Single-collateral contracts only: Contract's ISIN code String
lastTradingTime
optional
String
format: date-time
marginLevels
optional
For futures: A list containing the margin schedules

For indices: Not returned because N/A
Array
array items: [MarginLevel]
maxPositionSize
optional
Maximum number of contracts that one can hold in a position Number
maxRelativeFundingRate
optional
Perpetuals only: the absolute value of the maximum permissible funding rate Number
openingDate
optional
When the contract was first available for trading String
format: date-time
postOnly
optional
True if the instrument is in post-only mode, false otherwise. Boolean
retailMarginLevels
optional
Margin levels for retail clients (investor category no longer eligible for trading). Array
array items: [MarginLevel]
tags
optional
Tag for the contract (currently does not return a value). Array
array items: [String]
tickSize
optional
Tick size of the contract being traded. Number
type
optional
The type of the instrument:

- flexible_futures - futures_inverse - futures_vanilla
String
enum: "flexible_futures", "futures_inverse", "futures_vanilla"
underlying
optional
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
contracts
optional
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
initialMargin
optional
For futures: The initial margin requirement for this level

For indices: Not returned because N/A
Number
maintenanceMargin
optional
For futures: The maintenance margin requirement for this level

For indices: Not returned because N/A
Number
numNonContractUnits
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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/status
code 200
application/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"
instrumentStatus
optional
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
extremeVolatilityInitialMarginMultiplier
optional
Integer
isExperiencingDislocation
optional
Boolean
isExperiencingExtremeVolatility
optional
Boolean
priceDislocationDirection
optional
Null or String
enum: "ABOVE_UPPER_BOUND", "BELOW_LOWER_BOUND"
tradeable
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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}/status
code 200
application/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"
extremeVolatilityInitialMarginMultiplier
optional
Integer
isExperiencingDislocation
optional
Boolean
isExperiencingExtremeVolatility
optional
Boolean
priceDislocationDirection
optional
Null or String
enum: "ABOVE_UPPER_BOUND", "BELOW_LOWER_BOUND"
tradeable
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
includeMTFData
optional
query Boolean true
lastTime
optional
query Returns the last 100 trades from the specified lastTime value. String
symbol
optional
query The symbol of the Futures. String
Response - application/json

Example response
(Some parts of this example are auto-generated)
GET /history
code 200
application/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"
history
optional
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_venue
optional
Null or String
instrument_identification_type
optional
Null or String
isin
optional
Null or String
notional_amount
optional
Null or Number
notional_currency
optional
Null or String
price
optional
For futures: The price of a fill

For indices: The calculated value
Number
price_currency
optional
Null or String
price_notation
optional
Null or String
publication_time
optional
Null or String
publication_venue
optional
Null or String
side
optional
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
size
optional
For futures: The size of a fill For indices: Not returned because N/A Null or String
time
optional
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_cleared
optional
Null or Boolean
trade_id
optional
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_code
optional
Null or String
type
optional
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"
uid
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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 /orderbook
code 200
application/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"
orderBook
optional
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
asks
optional
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]
bids
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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 /tickers
code 200
application/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"
tickers
optional
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
ask
optional
For futures: The price of the current best ask

For indices: Not returned because N/A
Number
askSize
optional
For futures: The size of the current best ask

For indices: Not returned because N/A
Number
bid
optional
For futures: The price of the current best bid

For indices: Not returned because N/A
Number
bidSize
optional
For futures: The size of the current best bid

For indices: Not returned because N/A
Number
fundingRate
optional
The current absolute funding rate. Number
fundingRatePrediction
optional
The estimated next absolute funding rate. Number
high24h
optional
For futures: The highest fill price observed in the last 24 hours

For indices: Not returned because N/A
Number
last
optional
For futures: The price of the last fill

For indices: The last calculated value
Number
lastSize
optional
For futures: The size of the last fill

For indices: Not returned because N/A
Number
lastTime
optional
The date and time at which last was observed. String
low24h
optional
For futures: The lowest fill price observed in the last 24 hours

For indices: Not returned because N/A
Number
open24h
optional
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
last
optional
For futures: The price of the last fill

For indices: The last calculated value
Number
lastTime
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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 200
application/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 404
application/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"
ticker
optional
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
ask
optional
For futures: The price of the current best ask

For indices: Not returned because N/A
Number
askSize
optional
For futures: The size of the current best ask

For indices: Not returned because N/A
Number
bid
optional
For futures: The price of the current best bid

For indices: Not returned because N/A
Number
bidSize
optional
For futures: The size of the current best bid

For indices: Not returned because N/A
Number
fundingRate
optional
The current absolute funding rate. Number
fundingRatePrediction
optional
The estimated next absolute funding rate. Number
high24h
optional
For futures: The highest fill price observed in the last 24 hours

For indices: Not returned because N/A
Number
last
optional
For futures: The price of the last fill

For indices: The last calculated value
Number
lastSize
optional
For futures: The size of the last fill

For indices: Not returned because N/A
Number
lastTime
optional
The date and time at which last was observed. String
low24h
optional
For futures: The lowest fill price observed in the last 24 hours

For indices: Not returned because N/A
Number
open24h
optional
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
last
optional
For futures: The price of the last fill

For indices: The last calculated value
Number
lastTime
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Parameters
Parameter In Description Type Example
json
query Contains the request body as a String Batch Order
As a string formatted as application/json
algoId
optional
header ID of the algorithm that is making the request. String
processBefore
optional
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 /batchorder
code 200
application/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:

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
cliOrdId
optional
The order identity that is specified from the user. It must be globally unique. String
max str len: 100
limitPrice
optional
The limit price associated with the order. If placing a trailing_stop order then leave undefined. Number
order
optional
Always send. String
value: "send"
reduceOnly
optional
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
stopPrice
optional
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
trailingStopDeviationUnit
optional
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"
trailingStopMaxDeviation
optional
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
triggerSignal
optional
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
cliOrdId
optional
Unique client order identifier. Null or String
max str len: 100
limitPrice
optional
The limit price associated with the order. Number
order
optional
Always edit. String
value: "edit"
order_id
optional
Order ID. String
format: uuid
size
optional
The size associated with the order. Number
stopPrice
optional
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
trailingStopDeviationUnit
optional
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"
trailingStopMaxDeviation
optional
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
cliOrdId
optional
Unique client order identifier. Null or String
max str len: 100
order
optional
Always cancel. String
value: "cancel"
order_id
optional
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
cliOrdId
optional
The unique client order identifier. This field is returned only if the order has a client order ID. String
dateTimeReceived
optional
The date and time the order was received. Null or String
orderEvents
optional
Array
array items: [OrderEvent]
order_id
optional
The unique identifier of the order. Null or String
order_tag
optional
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
status
optional
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
order
optional
The placed order. OrderJson
reducedQuantity
optional
The amount of quantity that was removed before placement or null if the order is not a reduce only. Null or Number
type
optional
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
algoId
optional
Null or String
cliOrdId
optional
The client order id or null if order does not have one. Null or String
filled
optional
The total amount of the order that has been filled. Number
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Number
orderId
optional
The UID associated with the order. String
quantity
optional
The quantity (size) associated with the order. Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
type
optional
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
order
optional
Schema 2
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
new
optional
The order after the edit was applied. OrderJson
old
optional
The order before the edit was applied. OrderJson
reducedQuantity
optional
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. Null or Number
type
optional
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
order
optional
Schema 3
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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
amount
optional
The executed amount. Number
executionId
optional
The UID associated with the execution. String
orderPriorEdit
optional
Schema 4
orderPriorExecution
optional
The order before it executes. OrderJson
price
optional
The price of the execution. Number
takerReducedQuantity
optional
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
type
optional
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:

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
orderTrigger
optional
OrderTriggerJson
type
optional
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
clientId
optional
The client order id or null if order does not have one. Null or String
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Null or Number
quantity
optional
The quantity (size) associated with the order. Null or Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
startTime
optional
Null or String
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
triggerPrice
optional
Null or Number
triggerSide
optional
Null or String
enum: "trigger_above", "trigger_below"
triggerSignal
optional
Null or String
enum: "mark_price", "last_price", "spot_price"
type
optional
The order type String
enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind"
uid
optional
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
orderTrigger
optional
Schema 5
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
orderTrigger
optional
Schema 6
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Parameters
Parameter In Description Type
algoId
optional
header ID of the algorithm that is making the request. String
symbol
optional
query A futures product to cancel all open orders. String
Response - application/json

Example response: success
POST /cancelallorders
code 200
application/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"
cancelStatus
optional
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
cancelOnly
optional
The symbol of the futures or all. String
cancelledOrders
optional
A list of structures containing all the successfully cancelled orders. Array
array items: [OrderIdElement]
orderEvents
optional
Array
array items: [CancelEvent]
receivedTime
optional
The date and time the order cancellation was received. String
status
optional
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
cliOrdId
optional
Unique client order identifier. Null or String
max str len: 100
order_id
optional
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
order
optional
Schema 2
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
algoId
optional
Null or String
cliOrdId
optional
The client order id or null if order does not have one. Null or String
filled
optional
The total amount of the order that has been filled. Number
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Number
orderId
optional
The UID associated with the order. String
quantity
optional
The quantity (size) associated with the order. Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
type
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Parameters
Parameter In Description Type Example
algoId
optional
header ID of the algorithm that is making the request. String
timeout
optional
query The timeout specified in seconds. Number
format: uint32
60
Response - application/json

Example response: cancel
POST /cancelallordersafter
code 200
application/json

{
  "result": "success",
  "serverTime": "2018-06-19T16:51:23.839Z",
  "status": {
    "currentTime": "2018-06-19T16:51:23.839Z",
    "triggerTime": "0"
  }
}

Example response: failure
POST /cancelallordersafter
code 200
application/json

{
  "error": "apiLimitExceeded",
  "result": "error",
  "serverTime": "2016-02-25T09:45:53.818Z"
}

Example response: success
POST /cancelallordersafter
code 200
application/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"
status
optional
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
currentTime
optional
The server date and time that server received the request. String
triggerTime
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Parameters
Parameter In Description Type Example
algoId
optional
header ID of the algorithm that is making the request. String
cliOrdId
optional
query The client unique identifier of the order to be cancelled. String
order_id
optional
query The unique identifier of the order to be cancelled. String
processBefore
optional
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 /cancelorder
code 200
application/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"
cancelStatus
optional
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
cliOrdId
optional
The client order ID. Shown only if client specified one. Null or String
orderEvents
optional
Array
array items: [OrderEvent]
order_id
optional
The cancelled order UID String
format: uuid
receivedTime
optional
The date and time the order cancellation was received. String
status
optional
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
order
optional
The placed order. OrderJson
reducedQuantity
optional
The amount of quantity that was removed before placement or null if the order is not a reduce only. Null or Number
type
optional
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
algoId
optional
Null or String
cliOrdId
optional
The client order id or null if order does not have one. Null or String
filled
optional
The total amount of the order that has been filled. Number
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Number
orderId
optional
The UID associated with the order. String
quantity
optional
The quantity (size) associated with the order. Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
type
optional
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
order
optional
Schema 2
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
new
optional
The order after the edit was applied. OrderJson
old
optional
The order before the edit was applied. OrderJson
reducedQuantity
optional
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. Null or Number
type
optional
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
order
optional
Schema 3
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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
amount
optional
The executed amount. Number
executionId
optional
The UID associated with the execution. String
orderPriorEdit
optional
Schema 4
orderPriorExecution
optional
The order before it executes. OrderJson
price
optional
The price of the execution. Number
takerReducedQuantity
optional
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
type
optional
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:

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
orderTrigger
optional
OrderTriggerJson
type
optional
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
clientId
optional
The client order id or null if order does not have one. Null or String
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Null or Number
quantity
optional
The quantity (size) associated with the order. Null or Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
startTime
optional
Null or String
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
triggerPrice
optional
Null or Number
triggerSide
optional
Null or String
enum: "trigger_above", "trigger_below"
triggerSignal
optional
Null or String
enum: "mark_price", "last_price", "spot_price"
type
optional
The order type String
enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind"
uid
optional
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
orderTrigger
optional
Schema 5
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
orderTrigger
optional
Schema 6
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Parameters
Parameter In Description Type Example
algoId
optional
header ID of the algorithm that is making the request. String
cliOrdId
optional
query The order identity that is specified from the user. It must be globally unique (Required if orderId is not included) String
limitPrice
optional
query The limit price associated with the order. Must not exceed the tick size of the contract. Number
orderId
optional
query ID of the order you wish to edit. (Required if CliOrdId is not included) String
processBefore
optional
query The time before which the request should be processed, otherwise it is rejected. String "2023-11-08T19:56:35.441899Z"
size
optional
query The size associated with the order Number
stopPrice
optional
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
trailingStopDeviationUnit
optional
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"
trailingStopMaxDeviation
optional
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 /editorder
code 200
application/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"
editStatus
optional
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
cliOrdId
optional
The unique client order identifier.

This field is returned only if the order has a client order ID.
Null or String
orderEvents
optional
Array
array items: [OrderEvent]
orderId
optional
The unique identifier of the order Null or String
receivedTime
optional
The date and time the order was received Null or String
status
optional
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
order
optional
The placed order. OrderJson
reducedQuantity
optional
The amount of quantity that was removed before placement or null if the order is not a reduce only. Null or Number
type
optional
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
algoId
optional
Null or String
cliOrdId
optional
The client order id or null if order does not have one. Null or String
filled
optional
The total amount of the order that has been filled. Number
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Number
orderId
optional
The UID associated with the order. String
quantity
optional
The quantity (size) associated with the order. Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
type
optional
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
order
optional
Schema 2
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
new
optional
The order after the edit was applied. OrderJson
old
optional
The order before the edit was applied. OrderJson
reducedQuantity
optional
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. Null or Number
type
optional
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
order
optional
Schema 3
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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
amount
optional
The executed amount. Number
executionId
optional
The UID associated with the execution. String
orderPriorEdit
optional
Schema 4
orderPriorExecution
optional
The order before it executes. OrderJson
price
optional
The price of the execution. Number
takerReducedQuantity
optional
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
type
optional
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:

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
orderTrigger
optional
OrderTriggerJson
type
optional
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
clientId
optional
The client order id or null if order does not have one. Null or String
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Null or Number
quantity
optional
The quantity (size) associated with the order. Null or Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
startTime
optional
Null or String
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
triggerPrice
optional
Null or Number
triggerSide
optional
Null or String
enum: "trigger_above", "trigger_below"
triggerSignal
optional
Null or String
enum: "mark_price", "last_price", "spot_price"
type
optional
The order type String
enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind"
uid
optional
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
orderTrigger
optional
Schema 5
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
orderTrigger
optional
Schema 6
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
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
limitPrice
optional
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 /initialmargin
code 200
application/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"
error
optional
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"
estimatedLiquidationThreshold
optional
The estimated liquidation price after execution Number
initialMargin
optional
The initial margin requirement or null if there is no market Number
price
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
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
limitPrice
optional
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/maxordersize
code 200
application/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"
buyPrice
optional
The limit price of the buy order or null if the order type was mkt and there is no market Number
maxBuySize
optional
The maximum size of a buy order at the limit price or null if there is no market Number
maxSellSize
optional
The maximum size of a sell order at the limit price or null if there is no market Number
sellPrice
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Response - application/json

Example response: success
GET /openorders
code 200
application/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"
openOrders
optional
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
algoId
optional
ID of the algorithm that placed the order. Null or String
cliOrdId
optional
The unique client order identifier. This field is returned only if the order has a client order ID. Null or String
filledSize
optional
The filled size associated with the order. Null or Number
lastUpdateTime
optional
The date and time the order was last updated. String
limitPrice
optional
The limit price associated with the order. Null or Number
orderType
optional
The order type:

- lmt - limit order - stp - stop order - take_profit - take profit order
String
enum: "lmt", "stop", "take_profit"
order_id
optional
The unique identifier of the order. String
format: uuid
receivedTime
optional
The date and time the order was received. String
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The direction of the order. String
enum: "buy", "sell"
status
optional
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"
stopPrice
optional
If orderType is stp: The stop price associated with the order

If orderType is lmt: Not returned because N/A
Null or Number
symbol
optional
The symbol of the futures to which the order refers. String
triggerSignal
optional
The trigger signal for the stop or take profit order. Null or String
enum: "mark", "last", "spot"
unfilledSize
optional
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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Request body - application/x-www-form-urlencoded

Example request body
POST /orders/status
application/x-www-form-urlencoded

{
  "cliOrdIds": [
    "testOrder1",
    "testOrder2"
  ]
}

Type: Object

Object fields:

Field Description Type
cliOrdIds
optional
Client Order IDs associated with orders or triggers. Array
array items: [String]
orderIds
optional
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/status
code 200
application/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"
orders
optional
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
error
optional
Schema 3
order
optional
CachedOrderJson
status
optional
String
enum: "ENTERED_BOOK", "FULLY_EXECUTED", "REJECTED", "CANCELLED", "TRIGGER_PLACED", "TRIGGER_ACTIVATION_FAILURE"
updateReason
optional
Schema 5
Schema 3

Schema 3 example
(Some parts of this example are auto-generated)

"string"

This is one of:

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
algoId
optional
ID of the algorithm that placed the order. Null or String
cliOrdId
optional
Null or String
filled
optional
Null or Number
lastUpdateTimestamp
optional
String
limitPrice
optional
Null or Number
orderId
optional
String
format: uuid
priceTriggerOptions
optional
Schema 4
quantity
optional
Null or Number
reduceOnly
optional
Boolean
side
optional
String
symbol
optional
String
timestamp
optional
String
triggerTime
optional
Null or String
type
optional
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:

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
triggerPrice
optional
Number
triggerSide
optional
String
enum: "TRIGGER_ABOVE", "TRIGGER_BELOW"
triggerSignal
optional
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:

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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
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
algoId
optional
header ID of the algorithm that is making the request. String
cliOrdId
optional
query The order identity that is specified from the user. It must be globally unique. String
max str len: 100
limitPrice
optional
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
limitPriceOffsetUnit
optional
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"
limitPriceOffsetValue
optional
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
processBefore
optional
query The time before which the request should be processed, otherwise it is rejected. String "2023-11-08T19:56:35.441899Z"
reduceOnly
optional
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
stopPrice
optional
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
trailingStopDeviationUnit
optional
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"
trailingStopMaxDeviation
optional
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
triggerSignal
optional
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 /sendorder
code 200
application/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 /sendorder
code 200
application/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 /sendorder
code 200
application/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"
sendStatus
optional
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
cliOrdId
optional
The unique client order identifier. This field is returned only if the order has a client order ID. Null or String
orderEvents
optional
Array
array items: [OrderEvent]
order_id
optional
The unique identifier of the order String
format: uuid
receivedTime
optional
The date and time the order was received. String
status
optional
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
order
optional
The placed order. OrderJson
reducedQuantity
optional
The amount of quantity that was removed before placement or null if the order is not a reduce only. Null or Number
type
optional
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
algoId
optional
Null or String
cliOrdId
optional
The client order id or null if order does not have one. Null or String
filled
optional
The total amount of the order that has been filled. Number
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Number
orderId
optional
The UID associated with the order. String
quantity
optional
The quantity (size) associated with the order. Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
type
optional
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
order
optional
Schema 2
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
new
optional
The order after the edit was applied. OrderJson
old
optional
The order before the edit was applied. OrderJson
reducedQuantity
optional
The amount of quantity that was removed from the edited order or null if the order is not a reduce only. Null or Number
type
optional
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
order
optional
Schema 3
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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
amount
optional
The executed amount. Number
executionId
optional
The UID associated with the execution. String
orderPriorEdit
optional
Schema 4
orderPriorExecution
optional
The order before it executes. OrderJson
price
optional
The price of the execution. Number
takerReducedQuantity
optional
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
type
optional
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:

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
orderTrigger
optional
OrderTriggerJson
type
optional
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
clientId
optional
The client order id or null if order does not have one. Null or String
lastUpdateTimestamp
optional
The date and time the order was edited. String
limitPrice
optional
The limit price associated with a limit order. Null or Number
quantity
optional
The quantity (size) associated with the order. Null or Number
reduceOnly
optional
Is the order a reduce only order or not. Boolean
side
optional
The side associated with the order String
enum: "buy", "sell"
startTime
optional
Null or String
symbol
optional
The symbol of the Futures. String
timestamp
optional
The date and time the order was placed. String
triggerPrice
optional
Null or Number
triggerSide
optional
Null or String
enum: "trigger_above", "trigger_below"
triggerSignal
optional
Null or String
enum: "mark_price", "last_price", "spot_price"
type
optional
The order type String
enum: "lmt", "ioc", "post", "liquidation", "assignment", "stp", "unwind"
uid
optional
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
orderTrigger
optional
Schema 5
type
optional
Always CANCEL. String
value: "CANCEL"
uid
optional
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:

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
orderTrigger
optional
Schema 6
reason
optional
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"
type
optional
Always REJECT. String
value: "REJECT"
uid
optional
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:

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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
Parameters
Parameter In Type
subaccountUid
path String
format: uuid
Response

Example response
(Some parts of this example are auto-generated)
GET /subaccount/{subaccountUid}/trading-enabled
code 200
application/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"
error
optional
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"
errors
optional
Array
array items: [Error]
Error

Error example

"accountInactive"

Error description.

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
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-enabled
code 200
application/json

{
  "tradingEnabled": false
}
Code Description / Content type Type
200 Trading was successfully enabled/disabled.