Introduction
The Kraken Futures platform provides a number of Application Programming Interfaces (APIs) through HTTP and Websockets (WS).
The HTTP API provides secure access to your Kraken Futures account to perform actions such as:
- request current or historical price information
- check your account balance and PnL
- your margin parameters and estimated liquidation thresholds
- place or cancel orders (individually or in batch)
- see your open orders
- open positions or trade history
- request a digital asset withdrawal
These "endpoints" are explained in the HTTP API section.
The WebSocket API provides real-time data channels to the Kraken Futures 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 keyssuspended
,lastSize
,vol24h
,bid
,bidSize
,ask
,askSize
andmarkPrice
. This is becauserr_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:
- Sign in to your futures account.
- Click on your name on the upper-right corner.
- Select "Settings" from the drop-down menu.
- Select the "Create Key" tab in the API panel.
There are two options when generating API keys with differing levels of access:
General API:
No Access: This key does not allow any access to any endpoints. (This option could be selected if you only wanted a key with access to withdraw digital assets.)
Read Only: This is a read-only key and allows accessing only endpoints that do not write to the server.
Full Access: This is a master key and allows accessing all endpoints, excluding digital asset withdrawals.
Withdrawal API:
No Access: This key is does not allow access to digital asset withdrawals.
Full Access: This key allows access to digital asset withdrawals.
Press the "Create Key" button.
View your Public and Private keys and record them somewhere safe.
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://demo-futures.kraken.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 futures.kraken.com but instead demo-futures.kraken.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://demo-futures.kraken.com/ws/v1
All the feeds are identical to those documented above.
For a similar exercise via the HTTP API you would request:
https://demo-futures.kraken.com/derivatives/api/v3/tickers
Please note that when you have successfully tested in the demo environment, the base URL in the live production platform environment works with
API URLs
To access the HTTP API's endpoints, HTTP calls need to be sent to endpoints under:
https://futures.kraken.com/derivatives/api/v3/
https://futures.kraken.com/api/history/v2/
https://futures.kraken.com/api/charts/v1/
To subscribe to a WebSocket feed, establish a WebSocket connection to:
wss://futures.kraken.com/ws/v1
Note: The direct access URLs for IP whitelisting are different, see IP whitelisting below.
Kraken Futures IP whitelisting for direct access
API/programmatic traders can connect directly to the exchange server to improve latency and performance by whitelisting up to 15 IP addresses.
The servers to connect through whitelisted addresses are as follows:
https://api.futures.kraken.com
wss://api.futures.kraken.com
Kraken Futures 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
, andauthent
are determined as described in this section. For full working examples in different programming languages, see Sample Implementations.
String url = "https://futures.kraken.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
.
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.
Example: /api/v3/orderbook
API Secret
The api_secret
is obtained as described under generate-api-keys.
Example: rttp4AzwRfYEdQ7R7X8Z/04Y4TZPa97pqCypi3xXxAqftygftnI6H9yGV+OcUOOJeFtZkr8mVwbAndU3Kz4Q+eG
Authent
Based on these inputs, Authent
needs to be computed as follows:
- Concatenate
postData
+Nonce
+endpointPath
- Hash the result of step 1 with the SHA-256 algorithm
- Base64-decode your
api_secret
- Use the result of step 3 to hash the result of the step 2 with the HMAC-SHA-512 algorithm
- Base64-encode the result of step 4
Request Limits
Example
The following shows the return of call of the
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 |
recentorders (scheduled to be deprecated 31-Mar-2021) | 10 |
openorders | 2 |
orders/status | 1 |
unwindqueue | 200 |
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:
Endpoint | Cost |
---|---|
historicalorders | 1 |
historicaltriggers | 1 |
historicalexecutions | 1 |
accountlog | 2 |
accounglogcsv | 6 |
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
Other
Check if a subaccount has trading enabled or disabled
GET
https://futures.kraken.com/derivatives/api/v3/subaccount/{subaccountUid}/trading-enabled
Authentication is not required.
Parameters
Parameter | In | Type |
---|---|---|
subaccountUid |
path | string <uuid> |
Response
Example response
(Some parts of this example are auto-generated)
GET /v3/subaccount/{subaccountUid}/trading-enabled
code 200
application/json
{
"tradingEnabled": false
}
Code | Description / Content type | Type |
---|---|---|
200 | Trading enabled status. | |
application/json |
Schema 2 | |
404 | The account or subaccount could not be found |
Enable or disable trading on a subaccount
PUT
https://futures.kraken.com/derivatives/api/v3/subaccount/{subaccountUid}/trading-enabled
Authentication is not required.
Parameters
Parameter | In | Type |
---|---|---|
subaccountUid |
path | string <uuid> |
Request body - application/json
Example request body
(Some parts of this example are auto-generated)
PUT /v3/subaccount/{subaccountUid}/trading-enabled
application/json
{
"tradingEnabled": false
}
Name | Type |
---|---|
tradingEnabled |
bool |
Response
Example response
(Some parts of this example are auto-generated)
PUT /v3/subaccount/{subaccountUid}/trading-enabled
code 200
application/json
{
"tradingEnabled": false
}
Code | Description / Content type | Type |
---|---|---|
200 | Trading was successfully enabled/disabled. | |
application/json |
Schema 2 | |
404 | The account or subaccount could not be found |
Account Information
Get wallets
GET
https://futures.kraken.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
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: success
GET /v3/accounts
code 200
application/json
{
"result": "success",
"serverTime": "2016-02-25T09:45:53.818Z",
"accounts": {
"cash": {
"type": "cashAccount",
"balances": {
"xbt": 141.31756797,
"xrp": 52465.1254
}
},
"fi_xbtusd": {
"type": "marginAccount",
"currency": "xbt",
"balances": {
"fi_xbtusd_171215": 50000,
"fi_xbtusd_180615": -15000,
"xbt": 141.31756797,
"xrp": 0
},
"auxiliary": {
"af": 100.73891563,
"pnl": 12.42134766,
"pv": 153.73891563
},
"marginRequirements": {
"im": 52.8,
"mm": 23.76,
"lt": 39.6,
"tt": 15.84
},
"triggerEstimates": {
"im": 3110,
"mm": 3000,
"lt": 2890,
"tt": 2830
}
},
"flex": {
"type": "multiCollateralMarginAccount",
"currencies": {
"XBT": {
"quantity": 0.1185308247,
"value": 4998.721054420551,
"collateralValue": 4886.49976674881,
"available": 0.1185308247
},
"USD": {
"quantity": 5000.0,
"value": 5000.0,
"collateralValue": 5000.0,
"available": 5000.0
},
"EUR": {
"quantity": 4540.5837374453,
"value": 4999.137289089901,
"collateralValue": 4886.906656949836,
"available": 4540.5837374453
}
},
"balanceValue": 34995.52,
"portfolioValue": 34995.52,
"collateralValue": 34122.66,
"initialMargin": 0.0,
"initialMarginWithOrders": 0.0,
"maintenanceMargin": 0.0,
"pnl": 0.0,
"unrealizedFunding": 0.0,
"totalUnrealized": 0.0,
"totalUnrealizedAsMargin": 0.0,
"marginEquity": 34122.66,
"availableMargin": 34122.66
}
}
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
accounts optional |
A structure containing structures with account-related information for all margin and cash accounts. | Account | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get open positions
GET
https://futures.kraken.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
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: failure
GET /v3/openpositions
code 200
application/json
{
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z",
"error": "apiLimitExceeded"
}
Example response: success
GET /v3/openpositions
code 200
application/json
{
"result": "success",
"openPositions": [
{
"side": "short",
"symbol": "pi_xbtusd",
"price": 9392.749993345933,
"fillTime": "2020-07-22T14:39:12.376Z",
"size": 10000,
"unrealizedFunding": 0.00001045432180096817
},
{
"side": "long",
"symbol": "fi_xbtusd_201225",
"price": 9399.749966754434,
"fillTime": "2020-07-22T14:39:12.376Z",
"size": 20000
},
{
"side": "long",
"symbol": "pf_defiusd",
"price": 570.0,
"fillTime": "2022-04-20T19:15:25.438Z",
"size": 1,
"unrealizedFunding": -0.0073428045972263895,
"pnlCurrency": "BTC",
"maxFixedLeverage": 5.0
}
],
"serverTime": "2020-07-22T14:39:12.376Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
openPositions optional |
A list containing structures with information on open positions. The list is sorted descending by fillTime. |
array of OpenPositionJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get subaccounts
GET
https://futures.kraken.com/derivatives/api/v3/subaccounts
Return information about subaccounts, including balances and UIDs.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: success
GET /v3/subaccounts
code 200
application/json
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
masterAccountUid optional |
Master account UID | string | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
subaccounts optional |
The sub-accounts. | array of SubAccount |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get position percentile of unwind queue
GET
https://futures.kraken.com/derivatives/api/v3/unwindqueue
This endpoint returns the percentile of the open position in case of unwinding.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: success
GET /v3/unwindqueue
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-13T18:01:18.695Z",
"queue": [
{
"symbol": "PF_GMTUSD",
"percentile": 100
},
{
"symbol": "FI_ETHUSD_220624",
"percentile": 20
},
{
"symbol": "PF_UNIUSD",
"percentile": 80
}
]
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
queue optional |
A list containing structures with information on open positions' percentile rank in the unwind/termination queue. | array of UnwindQueueJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Fee Schedules
Get fee schedules
GET
https://futures.kraken.com/derivatives/api/v3/feeschedules
This endpoint lists all fee schedules.
Authentication is not required.
Response - application/json
Example response: success
GET /v3/feeschedules
code 200
application/json
{
"result": "success",
"serverTime": "2022-03-31T20:38:53.677Z",
"feeSchedules": [
{
"uid": "7fc4d7c0-464f-4029-a9bb-55856d0c5247",
"name": "PGTMainFees",
"tiers": [
{
"makerFee": 0.02,
"takerFee": 0.05,
"usdVolume": 0.0
},
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000.0
},
{
"makerFee": 0.0125,
"takerFee": 0.03,
"usdVolume": 1000000.0
},
{
"makerFee": 0.01,
"takerFee": 0.025,
"usdVolume": 5000000.0
},
{
"makerFee": 0.0075,
"takerFee": 0.02,
"usdVolume": 10000000.0
},
{
"makerFee": 0.005,
"takerFee": 0.015,
"usdVolume": 20000000.0
},
{
"makerFee": 0.0025,
"takerFee": 0.0125,
"usdVolume": 50000000.0
},
{
"makerFee": 0.0,
"takerFee": 0.01,
"usdVolume": 100000000.0
}
]
},
{
"uid": "d46c2190-81e3-4370-a333-424f24387829",
"name": "mainfees",
"tiers": [
{
"makerFee": 0.02,
"takerFee": 0.05,
"usdVolume": 0.0
},
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000.0
},
{
"makerFee": 0.0125,
"takerFee": 0.03,
"usdVolume": 1000000.0
},
{
"makerFee": 0.01,
"takerFee": 0.025,
"usdVolume": 5000000.0
},
{
"makerFee": 0.0075,
"takerFee": 0.02,
"usdVolume": 10000000.0
},
{
"makerFee": 0.005,
"takerFee": 0.015,
"usdVolume": 20000000.0
},
{
"makerFee": 0.0025,
"takerFee": 0.0125,
"usdVolume": 50000000.0
},
{
"makerFee": 0.0,
"takerFee": 0.01,
"usdVolume": 100000000.0
}
]
}
]
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
feeSchedules optional |
array of FeeSchedule | ||
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get fee schedule volumes
GET
https://futures.kraken.com/derivatives/api/v3/feeschedules/volumes
Returns your fee schedule volumes for each fee schedule.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: success
GET /v3/feeschedules/volumes
code 200
application/json
{
"result": "success",
"serverTime": "2016-02-25T09:45:53.818Z",
"volumesByFeeSchedule": {
"eef90775-995b-4596-9257-0917f6134766": 53823.0
}
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
volumesByFeeSchedule optional |
List containing the 30-day volume. | FeeScheduleVolumes |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
General
Get notifications
GET
https://futures.kraken.com/derivatives/api/v3/notifications
This endpoint provides the platform's notifications.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: failure
GET /v3/notifications
code 200
application/json
{
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z",
"error": "apiLimitExceeded"
}
Example response: success
GET /v3/notifications
code 200
application/json
{
"result": "success",
"notifications": [
{
"type": "general",
"priority": "low",
"note": "We've launched a new Telegram group."
},
{
"type": "settlement",
"priority": "medium",
"note": "Week contracts with maturity 29/Jun/2018 expire and settle.",
"effectiveTime": "2018-06-29T15:00:00Z"
}
],
"serverTime": "2018-06-29T15:22:05.187Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
notifications optional |
A list containing the notifications. | array of NotificationJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Historical Data
Get your fills
GET
https://futures.kraken.com/derivatives/api/v3/fills
This endpoint returns information on your filled orders for all futures contracts.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
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 /v3/fills
code 200
application/json
{
"result": "success",
"fills": [
{
"fill_id": "3d57ed09-fbd6-44f1-8e8b-b10e551c5e73",
"symbol": "pi_xbtusd",
"side": "buy",
"order_id": "693af756-055e-47ef-99d5-bcf4c456ebc5",
"size": 5490,
"price": 9400,
"fillTime": "2020-07-22T13:37:27.077Z",
"fillType": "maker"
},
{
"fill_id": "56b86ada-73b0-454d-a95a-e29e3e85b349",
"symbol": "pi_xbtusd",
"side": "buy",
"order_id": "3f513c4c-683d-44ab-a73b-d296abbea201",
"size": 5000,
"price": 9456,
"fillTime": "2020-07-21T12:41:52.790Z",
"fillType": "taker"
}
],
"serverTime": "2020-07-22T13:44:24.311Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
fills optional |
A list containing structures with information on filled orders. The list is sorted descending by fillTime . |
array of FillJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Historical Funding Rates
historicalFundingRates
GET
https://futures.kraken.com/derivatives/api/v4/historicalfundingrates
Authentication is not required.
Parameters
Parameter | In | Description | Type |
---|---|---|---|
symbol |
query | The symbol of the Futures. | string |
Response - application/json
Example response: success
GET /v4/historicalfundingrates
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-28T09:29:04.243Z",
"rates": [
{
"timestamp": "2022-06-28T00:00:00.000Z",
"fundingRate": -8.15861558e-10,
"relativeFundingRate": -0.000016898883333333
},
{
"timestamp": "2022-06-28T04:00:00.000Z",
"fundingRate": -2.6115278e-11,
"relativeFundingRate": -5.40935416667e-7
},
{
"timestamp": "2022-06-28T08:00:00.000Z",
"fundingRate": -4.08356853e-10,
"relativeFundingRate": -8.521190625e-6
}
]
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
rates optional |
A list containing structures with historical funding rate information. The list is sorted ascending by timestamp. | array of HistoricalFundingRateJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Instrument Details
- The
/instruments/status
endpoint provides a list of statuses for all instruments. - The
/instruments/{tradeable}/status
endpoint provides the status of a single instrument.
Get instruments
GET
https://futures.kraken.com/derivatives/api/v3/instruments
This endpoint returns specifications for all currently listed Futures contracts and indices.
Authentication is not required.
Response - application/json
Example response: success
GET /v3/instruments
code 200
application/json
{
"result": "success",
"instruments": [
{
"symbol": "pi_xbtusd",
"type": "futures_inverse",
"underlying": "rr_xbtusd",
"tickSize": 0.5,
"contractSize": 1,
"tradeable": true,
"impactMidSize": 1,
"maxPositionSize": 1000000,
"openingDate": "2022-01-01T00: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": 12000000,
"initialMargin": 0.25,
"maintenanceMargin": 0.125
},
{
"contracts": 20000000,
"initialMargin": 0.3,
"maintenanceMargin": 0.15
},
{
"contracts": 50000000,
"initialMargin": 0.4,
"maintenanceMargin": 0.2
}
],
"fundingRateCoefficient": 8,
"maxRelativeFundingRate": 0.001,
"isin": "GB00J62YGL67",
"contractValueTradePrecision": 0,
"postOnly": false,
"feeScheduleUid": "eef90775-995b-4596-9257-0917f6134766",
"retailMarginLevels": [
{
"contracts": 0,
"initialMargin": 0.5,
"maintenanceMargin": 0.25
}
],
"category": "",
"tags": []
},
{
"symbol": "fi_xbtusd_220930",
"type": "futures_inverse",
"underlying": "rr_xbtusd",
"lastTradingTime": "2022-09-30T15:00:00.000Z",
"tickSize": 0.5,
"contractSize": 1,
"tradeable": true,
"impactMidSize": 1,
"maxPositionSize": 1000000,
"openingDate": "2022-01-01T00: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
}
],
"isin": "GB00JVMLP260",
"contractValueTradePrecision": 0,
"postOnly": false,
"feeScheduleUid": "eef90775-995b-4596-9257-0917f6134766",
"retailMarginLevels": [
{
"contracts": 0,
"initialMargin": 0.5,
"maintenanceMargin": 0.25
}
],
"category": "",
"tags": []
},
{
"symbol": "pf_xbtusd",
"type": "flexible_futures",
"tickSize": 1,
"contractSize": 1,
"tradeable": true,
"impactMidSize": 1,
"maxPositionSize": 1000000,
"openingDate": "2022-01-01T00:00:00.000Z",
"marginLevels": [
{
"numNonContractUnits": 0.0,
"initialMargin": 0.02,
"maintenanceMargin": 0.01
},
{
"numNonContractUnits": 500000.0,
"initialMargin": 0.04,
"maintenanceMargin": 0.02
},
{
"numNonContractUnits": 2000000.0,
"initialMargin": 0.1,
"maintenanceMargin": 0.05
},
{
"numNonContractUnits": 5000000.0,
"initialMargin": 0.2,
"maintenanceMargin": 0.1
},
{
"numNonContractUnits": 10000000.0,
"initialMargin": 0.3,
"maintenanceMargin": 0.15
},
{
"numNonContractUnits": 30000000.0,
"initialMargin": 0.5,
"maintenanceMargin": 0.25
}
],
"fundingRateCoefficient": 8,
"maxRelativeFundingRate": 0.001,
"contractValueTradePrecision": 4,
"feeScheduleUid": "5b755fea-c5b0-4307-a66e-b392cd5bd931",
"postOnly": false,
"retailMarginLevels": [
{
"numNonContractUnits": 0.0,
"initialMargin": 0.02,
"maintenanceMargin": 0.01
},
{
"numNonContractUnits": 500000.0,
"initialMargin": 0.04,
"maintenanceMargin": 0.02
},
{
"numNonContractUnits": 2000000.0,
"initialMargin": 0.1,
"maintenanceMargin": 0.05
},
{
"numNonContractUnits": 5000000.0,
"initialMargin": 0.2,
"maintenanceMargin": 0.1
},
{
"numNonContractUnits": 10000000.0,
"initialMargin": 0.3,
"maintenanceMargin": 0.15
},
{
"numNonContractUnits": 30000000.0,
"initialMargin": 0.5,
"maintenanceMargin": 0.25
}
],
"category": "Layer 1",
"tags": []
}
],
"serverTime": "2022-06-28T09:29:04.243Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
instruments optional |
A list containing structures for each available instrument. The list is in no particular order. | array of Instrument | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get instrument status list
GET
https://futures.kraken.com/derivatives/api/v3/instruments/status
Authentication is not required.
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /v3/instruments/status
code 200
application/json
{
"instrumentStatus": [
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"tradeable": "PI_XBTUSD"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
instrumentStatus optional |
array of InstrumentStatus | ||
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get instrument status
GET
https://futures.kraken.com/derivatives/api/v3/instruments/{tradeable}/status
Authentication is not required.
Parameters
Parameter | In | Description | Type |
---|---|---|---|
tradeable |
path | Instrument identifier. | string |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /v3/instruments/{tradeable}/status
code 200
application/json
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z",
"tradeable": "PI_XBTUSD"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
extremeVolatilityInitialMarginMultiplier optional |
integer | ||
isExperiencingDislocation optional |
bool | ||
isExperiencingExtremeVolatility optional |
bool | ||
priceDislocationDirection optional |
null or string (enum: "ABOVE_UPPER_BOUND" , "BELOW_LOWER_BOUND" ) |
||
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
tradeable optional |
string | "PI_XBTUSD" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Market Data
Get trade history
GET
https://futures.kraken.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 |
---|---|---|---|
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 /v3/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": 0.0,
"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"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
history optional |
A list containing structures with historical price information. The list is sorted descending by time. | array of HistoryJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get orderbook
GET
https://futures.kraken.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 optional |
query | The symbol of the Futures. | string |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /v3/orderbook
code 200
application/json
{
"orderBook": {
"bids": [
[
40178,
5
],
[
40174,
4.2
],
[
40170,
7.2
]
],
"asks": [
[
40186,
5.0183
],
[
40190,
0.4183
]
]
},
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
orderBook optional |
A structure containing lists with bid and ask prices and sizes. | OrderBook | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get tickers
GET
https://futures.kraken.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 /v3/tickers
code 200
application/json
{
"result": "success",
"tickers": [
{
"tag": "perpetual",
"pair": "XBT:USD",
"symbol": "pi_xbtusd",
"markPrice": 30209.9,
"bid": 8634,
"bidSize": 1000,
"ask": 49289,
"askSize": 139984,
"vol24h": 15304,
"openInterest": 149655,
"open24h": 49289,
"indexPrice": 21087.8,
"last": 49289,
"lastTime": "2022-06-17T10:46:35.705Z",
"lastSize": 100,
"suspended": false,
"fundingRate": 1.18588737106e-7,
"fundingRatePrediction": 1.1852486794e-7,
"postOnly": false
},
{
"tag": "month",
"pair": "XBT:USD",
"symbol": "fi_xbtusd_211231",
"markPrice": 20478.5,
"bid": 28002,
"bidSize": 900,
"vol24h": 100,
"openInterest": 10087,
"open24h": 28002,
"indexPrice": 21087.8,
"last": 28002,
"lastTime": "2022-06-17T10:45:57.177Z",
"lastSize": 100,
"suspended": false,
"postOnly": false
},
{
"symbol": "in_xbtusd",
"last": 21088,
"lastTime": "2022-06-17T11:00:30.000Z"
},
{
"symbol": "rr_xbtusd",
"last": 20938,
"lastTime": "2022-06-16T15:00:00.000Z"
}
],
"serverTime": "2022-06-17T11:00:31.335Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "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 of TickerJson |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Multi-Collateral
Endpoints pertaining to the multi-collateral (MC) futures markets.
Get the leverage setting for a market
GET
https://futures.kraken.com/derivatives/api/v3/leveragepreferences
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: success
GET /v3/leveragepreferences
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-28T15:01:12.762Z",
"leveragePreferences": [
{
"symbol": "PF_XBTUSD",
"maxLeverage": 10.0
}
]
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
leveragePreferences optional |
array of LeveragePreference | ||
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Set the leverage setting for a market
PUT
https://futures.kraken.com/derivatives/api/v3/leveragepreferences
Calling this API can result in the following error codes:
87: Contract does not exist
88: Contract not a multi-collateral futures contract
41: Would cause liquidation
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
maxLeverage optional |
query | Max leverage to set. | number |
symbol optional |
query | The symbol for the leverage preference. | string |
Response - application/json
Example response: success
PUT /v3/leveragepreferences
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-28T14:48:58.711Z"
}
Response is one of the following:
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get PNL currency preference for a market
GET
https://futures.kraken.com/derivatives/api/v3/pnlpreferences
The PNL currency preference is used to determine which currency to pay out when realizing PNL gains.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: success
GET /v3/pnlpreferences
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-28T15:04:06.710Z",
"preferences": [
{
"symbol": "PF_XBTUSD",
"pnlCurrency": "BTC"
}
]
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
preferences optional |
array of PnlPreference | ||
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Set PNL currency preference for a market
PUT
https://futures.kraken.com/derivatives/api/v3/pnlpreferences
The PNL currency preference is used to determine which currency to pay out when realizing PNL gains. Calling this API can result in the following error codes:
87: Contract does not exist
88: Contract not a multi-collateral futures contract
89: Currency does not exist
90: Currency is not enabled for multi-collateral futures
41: Would cause liquidation
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
pnlPreference |
query | The asset in which profit will be realised for the specific symbol. | string |
symbol |
query | The symbol for the PnL preference. | string |
Response - application/json
Example response: success
PUT /v3/pnlpreferences
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-28T14:48:58.711Z"
}
Response is one of the following:
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Order Management
Batch order management
POST
https://futures.kraken.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.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
json |
query | Contains the request body as a String | string |
Request body - application/json
Example request body
POST /v3/batchorder
application/json
{
"batchOrder": [
{
"order": "send",
"order_tag": "1",
"orderType": "lmt",
"symbol": "PI_XBTUSD",
"side": "buy",
"size": 1,
"limitPrice": 1.0,
"cliOrdId": "my_another_client_id"
},
{
"order": "send",
"order_tag": "2",
"orderType": "stp",
"symbol": "PI_XBTUSD",
"side": "buy",
"size": 1,
"limitPrice": 2.0,
"stopPrice": 3.0
},
{
"order": "cancel",
"order_id": "e35d61dd-8a30-4d5f-a574-b5593ef0c050"
},
{
"order": "cancel",
"cliOrdId": "my_client_id"
}
]
}
Name | Description | Type |
---|---|---|
batchOrder optional |
A list containing structures of order sending and order cancellation instructions. The list is in no particular order. | array of Batch Instruction |
Response - application/json
Example response: success
POST /v3/batchorder
code 200
application/json
{
"result": "success",
"serverTime": "2019-09-05T16:41:40.996Z",
"batchStatus": [
{
"status": "placed",
"order_tag": "1",
"order_id": "022774bc-2c4a-4f26-9317-436c8d85746d",
"dateTimeReceived": "2019-09-05T16:41:35.173Z",
"orderEvents": [
{
"order": {
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 1000,
"filled": 0,
"limitPrice": 9400.0,
"reduceOnly": false,
"timestamp": "2019-09-05T16:41:35.173Z",
"lastUpdateTimestamp": "2019-09-05T16:41:35.173Z"
},
"reducedQuantity": null,
"type": "PLACE"
}
]
},
{
"status": "edited",
"order_id": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"orderEvents": [
{
"old": {
"orderId": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 102.0,
"filled": 0.0,
"limitPrice": 8500.0,
"reduceOnly": false,
"timestamp": "2019-09-04T11:45:48.884Z",
"lastUpdateTimestamp": "2019-09-04T11:45:48.884Z"
},
"new": {
"orderId": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 1000,
"filled": 0.0,
"limitPrice": 9400.0,
"reduceOnly": false,
"timestamp": "2019-09-04T11:45:48.884Z",
"lastUpdateTimestamp": "2019-09-05T16:41:40.996Z"
},
"reducedQuantity": null,
"type": "EDIT"
}
]
},
{
"status": "cancelled",
"order_id": "566942c8-a3b5-4184-a451-622b09493129",
"orderEvents": [
{
"uid": "566942c8-a3b5-4184-a451-622b09493129",
"order": {
"orderId": "566942c8-a3b5-4184-a451-622b09493129",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 100.0,
"filled": 0.0,
"limitPrice": 8500.0,
"reduceOnly": false,
"timestamp": "2019-09-02T12:54:08.005Z",
"lastUpdateTimestamp": "2019-09-02T12:54:08.005Z"
},
"type": "CANCEL"
}
]
}
]
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
batchStatus optional |
A structure containing information on the send order request. | array of BatchInstructionResult | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Cancel all orders
POST
https://futures.kraken.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
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
symbol optional |
query | A futures product to cancel all open orders. | string |
Response - application/json
Example response: success
POST /v3/cancelallorders
code 200
application/json
{
"result": "success",
"cancelStatus": {
"receivedTime": "2019-08-01T15:57:37.518Z",
"cancelOnly": "all",
"status": "cancelled",
"cancelledOrders": [
{
"order_id": "6180adfa-e4b1-4a52-adac-ea5417620dbd"
},
{
"order_id": "89e3edbe-d739-4c52-b866-6f5a8407ff6e"
},
{
"order_id": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7"
}
],
"orderEvents": [
{
"uid": "6180adfa-e4b1-4a52-adac-ea5417620dbd",
"order": {
"orderId": "6180adfa-e4b1-4a52-adac-ea5417620dbd",
"cliOrdId": null,
"type": "stp",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 1000,
"filled": 0,
"limitPrice": 10039,
"stopPrice": 10039,
"reduceOnly": false,
"timestamp": "2019-08-01T15:57:19.482Z"
},
"type": "CANCEL"
},
{
"uid": "89e3edbe-d739-4c52-b866-6f5a8407ff6e",
"order": {
"orderId": "89e3edbe-d739-4c52-b866-6f5a8407ff6e",
"cliOrdId": null,
"type": "post",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 890,
"filled": 0,
"limitPrice": 10040,
"stopPrice": null,
"reduceOnly": false,
"timestamp": "2019-08-01T15:57:08.508Z"
},
"type": "CANCEL"
},
{
"uid": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7",
"order": {
"orderId": "0cd37a77-1644-4960-a7fb-9a1f6e0e46f7",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "sell",
"quantity": 900,
"filled": 0,
"limitPrice": 10145,
"stopPrice": null,
"reduceOnly": true,
"timestamp": "2019-08-01T15:57:14.003Z"
},
"type": "CANCEL"
}
]
},
"serverTime": "2019-08-01T15:57:37.520Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
cancelStatus optional |
A structure containing information on the cancellation request. | CancelAllOrdersStatusJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Dead man's switch
POST
https://futures.kraken.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
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type | Example |
---|---|---|---|---|
timeout optional |
query | The timeout specified in seconds. | string | 60 |
Response - application/json
Example response: cancel
POST /v3/cancelallordersafter
code 200
application/json
{
"result": "success",
"status": {
"currentTime": "2018-06-19T16:51:23.839Z",
"triggerTime": "0"
},
"serverTime": "2018-06-19T16:51:23.839Z"
}
Example response: failure
POST /v3/cancelallordersafter
code 200
application/json
{
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z",
"error": "apiLimitExceeded"
}
Example response: success
POST /v3/cancelallordersafter
code 200
application/json
{
"result": "success",
"status": {
"currentTime": "2018-06-19T16:51:23.839Z",
"triggerTime": "2018-06-19T16:52:23.839Z"
},
"serverTime": "2018-06-19T16:51:23.839Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
status optional |
The status of the switch. | DeadManSwitchStatusJson |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Cancel order
POST
https://futures.kraken.com/derivatives/api/v3/cancelorder
This endpoint allows cancelling an open order for a Futures contract.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
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 |
Response - application/json
Example response: success
POST /v3/cancelorder
code 200
application/json
{
"result": "success",
"cancelStatus": {
"status": "cancelled",
"order_id": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"receivedTime": "2020-07-22T13:26:20.806Z",
"orderEvents": [
{
"uid": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"order": {
"orderId": "cb4e34f6-4eb3-4d4b-9724-4c3035b99d47",
"cliOrdId": "1234568",
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 5500,
"filled": 0,
"limitPrice": 8000,
"reduceOnly": false,
"timestamp": "2020-07-22T13:25:56.366Z",
"lastUpdateTimestamp": "2020-07-22T13:25:56.366Z"
},
"type": "CANCEL"
}
]
},
"serverTime": "2020-07-22T13:26:20.806Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
cancelStatus optional |
A structure containing information on the cancellation request. | CancelOrderStatusJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Edit order
POST
https://futures.kraken.com/derivatives/api/v3/editorder
This endpoint allows editing an existing order for a currently listed Futures contract.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
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 have more than 2 decimal places | number |
orderId optional |
query | ID of the order you wish to edit. (Required if CliOrdId is not included) |
string |
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 have more than 2 decimal places. 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. 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 |
Response - application/json
Example response: success
POST /v3/editorder
code 200
application/json
{
"result": "success",
"serverTime": "2019-09-05T16:47:47.521Z",
"editStatus": {
"status": "edited",
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"receivedTime": "2019-09-05T16:47:47.521Z",
"orderEvents": [
{
"old": {
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 1000,
"filled": 0,
"limitPrice": 9400.0,
"reduceOnly": false,
"timestamp": "2019-09-05T16:41:35.173Z",
"lastUpdateTimestamp": "2019-09-05T16:41:35.173Z"
},
"new": {
"orderId": "022774bc-2c4a-4f26-9317-436c8d85746d",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 1501,
"filled": 0,
"limitPrice": 7200,
"reduceOnly": false,
"timestamp": "2019-09-05T16:41:35.173Z",
"lastUpdateTimestamp": "2019-09-05T16:47:47.519Z"
},
"reducedQuantity": null,
"type": "EDIT"
}
]
}
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
editStatus optional |
A structure containing information on the send order request | EditOrderStatus | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get open orders
GET
https://futures.kraken.com/derivatives/api/v3/openorders
This endpoint returns information on all open orders for all Futures contracts.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response - application/json
Example response: success
GET /v3/openorders
code 200
application/json
{
"result": "success",
"openOrders": [
{
"order_id": "59302619-41d2-4f0b-941f-7e7914760ad3",
"symbol": "pi_xbtusd",
"side": "sell",
"orderType": "lmt",
"limitPrice": 10640,
"unfilledSize": 304,
"receivedTime": "2019-09-05T17:01:17.410Z",
"status": "untouched",
"filledSize": 0,
"reduceOnly": true,
"lastUpdateTime": "2019-09-05T17:01:17.410Z"
},
{
"order_id": "022774bc-2c4a-4f26-9317-436c8d85746d",
"symbol": "pi_xbtusd",
"side": "buy",
"orderType": "lmt",
"limitPrice": 7200,
"unfilledSize": 1501,
"receivedTime": "2019-09-05T16:41:35.173Z",
"status": "untouched",
"filledSize": 0,
"reduceOnly": false,
"lastUpdateTime": "2019-09-05T16:47:47.519Z"
},
{
"order_id": "d08021f7-58cb-4f2c-9c86-da4c60de46bb",
"symbol": "pi_xbtusd",
"side": "sell",
"orderType": "lmt",
"limitPrice": 10640,
"unfilledSize": 10000,
"receivedTime": "2019-09-05T16:38:43.651Z",
"status": "untouched",
"filledSize": 0,
"reduceOnly": true,
"lastUpdateTime": "2019-09-05T16:38:43.651Z"
},
{
"order_id": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"symbol": "pi_xbtusd",
"side": "buy",
"orderType": "lmt",
"limitPrice": 9400,
"unfilledSize": 10000,
"receivedTime": "2019-09-05T16:33:50.734Z",
"status": "untouched",
"filledSize": 0,
"reduceOnly": false,
"lastUpdateTime": "2019-09-05T16:33:50.734Z"
},
{
"order_id": "9c2cbcc8-14f6-42fe-a020-6e395babafd1",
"symbol": "pi_xbtusd",
"side": "buy",
"orderType": "lmt",
"limitPrice": 9400,
"unfilledSize": 1000,
"receivedTime": "2019-09-04T11:45:48.884Z",
"status": "untouched",
"filledSize": 0,
"reduceOnly": false,
"lastUpdateTime": "2019-09-05T16:41:40.996Z"
},
{
"order_id": "3deea5c8-0274-4d33-988c-9e5a3895ccf8",
"symbol": "pi_xbtusd",
"side": "buy",
"orderType": "lmt",
"limitPrice": 8500,
"unfilledSize": 102,
"receivedTime": "2019-09-03T12:52:17.945Z",
"status": "untouched",
"filledSize": 0,
"reduceOnly": false,
"lastUpdateTime": "2019-09-03T12:52:17.945Z"
},
{
"order_id": "fcbb1459-6ed2-4b3c-a58c-67c4df7412cf",
"symbol": "pi_xbtusd",
"side": "buy",
"orderType": "lmt",
"limitPrice": 7200,
"unfilledSize": 1501,
"receivedTime": "2019-09-02T12:54:34.347Z",
"status": "untouched",
"filledSize": 0,
"reduceOnly": false,
"lastUpdateTime": "2019-09-02T12:54:34.347Z"
}
],
"serverTime": "2019-09-05T17:08:18.138Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
openOrders optional |
A list containing structures with information on open orders. The list is sorted descending by receivedTime. | array of OpenOrderJson | |
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Get the current status for specific orders
POST
https://futures.kraken.com/derivatives/api/v3/orders/status
This endpoint returns information on open orders
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Request body - application/x-www-form-urlencoded
Example request body
POST /v3/orders/status
application/x-www-form-urlencoded
body: cliOrdIds=testOrder1&cliOrdIds=testOrder2
Name | Description | Type |
---|---|---|
cliOrdIds optional |
The client order ID associated with an open order. | array of string |
orderIds optional |
The UID associated with an open order. | array of string |
Response - application/json
Example response
(Some parts of this example are auto-generated)
POST /v3/orders/status
code 200
application/json
{
"orders": [
{
"error": "MARKET_SUSPENDED",
"order": {
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"priceTriggerOptions": {
"trailingStopOptions": {
"maxDeviation": 0.0,
"unit": "PERCENT"
},
"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": "LOADING_MARKET"
}
],
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
orders optional |
array of OrderStatusDetailsJson | ||
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Send order
POST
https://futures.kraken.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
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
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 |
cliOrdId optional |
query | The order identity that is specified from the user. It must be globally unique. | string (max. length 100 ) |
limitPrice optional |
query | The limit price associated with the order. If placing a trailing_stop order then leave undefined. |
number |
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. |
bool |
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 stop or take_profit order can get filled at. If no limitPrice is provided the stop 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 .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 |
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 /v3/sendorder
code 200
application/json
{
"result": "success",
"sendStatus": {
"order_id": "61ca5732-3478-42fe-8362-abbfd9465294",
"status": "placed",
"receivedTime": "2019-12-11T17:17:33.888Z",
"orderEvents": [
{
"executionId": "e1ec9f63-2338-4c44-b40a-43486c6732d7",
"price": 7244.5,
"amount": 10,
"orderPriorEdit": null,
"orderPriorExecution": {
"orderId": "61ca5732-3478-42fe-8362-abbfd9465294",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 10,
"filled": 0,
"limitPrice": 7500,
"reduceOnly": false,
"timestamp": "2019-12-11T17:17:33.888Z",
"lastUpdateTimestamp": "2019-12-11T17:17:33.888Z"
},
"takerReducedQuantity": null,
"type": "EXECUTION"
}
]
},
"serverTime": "2019-12-11T17:17:33.888Z"
}
Example response: placed
POST /v3/sendorder
code 200
application/json
{
"result": "success",
"sendStatus": {
"order_id": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"status": "placed",
"receivedTime": "2019-09-05T16:33:50.734Z",
"orderEvents": [
{
"order": {
"orderId": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 10000,
"filled": 0,
"limitPrice": 9400,
"reduceOnly": false,
"timestamp": "2019-09-05T16:33:50.734Z",
"lastUpdateTimestamp": "2019-09-05T16:33:50.734Z"
},
"reducedQuantity": null,
"type": "PLACE"
}
]
},
"serverTime": "2019-09-05T16:33:50.734Z"
}
Example response: rejected
POST /v3/sendorder
code 200
application/json
{
"result": "success",
"sendStatus": {
"order_id": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"status": "wouldNotReducePosition",
"receivedTime": "2019-09-05T16:32:54.076Z",
"orderEvents": [
{
"uid": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"order": {
"orderId": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"cliOrdId": null,
"type": "lmt",
"symbol": "pi_xbtusd",
"side": "buy",
"quantity": 10000,
"filled": 0,
"limitPrice": 9400,
"reduceOnly": true,
"timestamp": "2019-09-05T16:32:54.076Z",
"lastUpdateTimestamp": "2019-09-05T16:32:54.076Z"
},
"reason": "WOULD_NOT_REDUCE_POSITION",
"type": "REJECT"
}
]
},
"serverTime": "2019-09-05T16:32:54.077Z"
}
Response is one of the following:
Success Response
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
sendStatus optional |
A structure containing information on the send order request. | SendOrderJson | |
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Transfers
Initiate wallet transfer
POST
https://futures.kraken.com/derivatives/api/v3/transfer
This endpoint allows you to transfer funds between two margin accounts with the same collateral currency, or between a margin account and your cash account.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type | Example |
---|---|---|---|---|
amount |
query | The amount to transfer | string | 0.1 |
fromAccount |
query | The wallet (cash or margin account) from which funds should be debited | string | "fi_ethusd" |
toAccount |
query | The wallet (cash or margin account) to which funds should be credited | string | "flex" |
unit |
query | The currency unit to transfer | string | "eth" |
Response - application/json
Example response
(Some parts of this example are auto-generated)
POST /v3/transfer
code 200
application/json
{
"result": "success",
"serverTime": "2020-08-27T17:03:33.196Z"
}
Response is one of the following:
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Initiate sub account transfer
POST
https://futures.kraken.com/derivatives/api/v3/transfer/subaccount
This endpoint allows you to transfer funds between the current account and a sub account, between two margin accounts with the same collateral currency, or between a margin account and your cash account.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with full access)
Parameters
Parameter | In | Description | Type |
---|---|---|---|
amount |
query | The amount to transfer | string |
fromAccount |
query | The wallet (cash or margin account) from which funds should be debited | string |
fromUser |
query | The user account (this or a sub account) from which funds should be debited | string |
toAccount |
query | The wallet (cash or margin account) to which funds should be credited | string |
toUser |
query | The user account (this or a sub account) to which funds should be credited | string |
unit |
query | The currency unit to transfer | string |
Response - application/json
Example response: failure
POST /v3/transfer/subaccount
code 200
application/json
{
"result": "error",
"serverTime": "2016-02-25T09:45:53.818Z",
"error": "invalidUnit"
}
Example response: success
POST /v3/transfer/subaccount
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-28T14:48:58.711Z"
}
Response is one of the following:
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Initiate withdrawal to Spot wallet
POST
https://futures.kraken.com/derivatives/api/v3/withdrawal
This endpoint allows you to request to withdraw digital assets to your Kraken Spot wallet.
Authentication
Authent
header (Authentication string)APIKey
header (Withdrawal API key with full access)
Parameters
Parameter | In | Description | Type | Example |
---|---|---|---|---|
amount |
query | The amount of currency that shall be withdrawn back to spot wallet. | string | 0.1 |
currency |
query | The digital asset that shall be withdrawn back to spot wallet. | string | "eth" |
sourceWallet optional |
query | The wallet from which the funds shall be withdrawn back to spot wallet. Default is "cash" wallet. | string | "flex" |
Response - application/json
Example response: failure
POST /v3/withdrawal
code 200
application/json
{
"result": "error",
"serverTime": "2019-05-15T09:24:16.968Z",
"error": "Unavailable"
}
Example response: success
POST /v3/withdrawal
code 200
application/json
{
"result": "success",
"serverTime": "2022-06-28T14:48:58.711Z"
}
Response is one of the following:
Name | Description | Type | Example |
---|---|---|---|
result optional |
string (value: "success" ) |
"success" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
History
Account History
Account History provides account-specific data, including account logs ( history of all balance and position changes) and history for executions, orders, and triggers.
- The
/account-log
endpoint provides a paginated JSON response, with access to all account log history specified by ranges of timestamp or ID. - The
/accountlogcsv
endpoint provides a CSV formatted response of 500,000 rows of most recent account logs. See also the websocket feed of account log snapshots - The
/executions
endpoint provides a paginated JSON response, with access to all private execution history specified by ranges of timestamp or ID - The
/orders
endpoint provides a paginated JSON response, with access to all private order history specified by ranges of timestamp or ID - The
/triggers
endpoint provides a paginated JSON response, with access to all private trigger history specified by ranges of timestamp or ID
Get account log
GET
https://futures.kraken.com/api/history/v2/account-log
Get account log entries, paged by timestamp or by ID.
To request entries by time range, use the since
and before
parameters.
To request entries by ID range, use the from
and to
parameters.
Any combination of since
, before
, from
and to
can be used to restrict the requested range of entries.
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Parameters
Parameter | In | Description | Type | Default | Example |
---|---|---|---|---|---|
before optional |
query | Unix timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
count optional |
query | Amount of entries to be returned. | integer | 500 | |
from optional |
query | ID of the first entry (inclusive). IDs start at 1. | integer | 1 |
|
info optional |
query | Type of entry to filter by. Only this type will be returned. | string | "futures liquidation" |
|
since optional |
query | Unix timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
sort optional |
query | Order of events in response. asc = chronological, desc = reverse-chronological. |
string (enum: "asc" , "desc" ) |
"desc" | |
to optional |
query | ID of the last entry (inclusive). | integer | 100 |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /account-log
code 200
application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"logs": [
{
"asset": "string",
"booking_uid": "string",
"collateral": "string",
"contract": "string",
"conversion_spread_percentage": 0.0,
"date": "2001-07-08T00:34:60.026490+09:30",
"execution": "string",
"fee": 0.0,
"funding_rate": 0.0,
"id": 0,
"info": "string",
"margin_account": "string",
"mark_price": 0.0,
"new_average_entry_price": 0.0,
"new_balance": 0.0,
"old_average_entry_price": 0.0,
"old_balance": 0.0,
"realized_funding": 0.0,
"realized_pnl": 0.0,
"trade_price": 0.0
}
]
}
Name | Type |
---|---|
accountUid |
string <uuid> |
logs |
array of AccountLogEntry |
Get recent account log (CSV)
GET
https://futures.kraken.com/api/history/v2/accountlogcsv
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Response
Code | Description / Content type |
---|---|
200 | A CSV formatted response of most recent account log entries. |
401 | Credentials required. |
429 | Rate limited. Check Rate-Limit-Reset header for how long until next access is allowed in seconds. |
Get execution events
GET
https://futures.kraken.com/api/history/v2/executions
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Parameters
Parameter | In | Description | Type | Default | Example |
---|---|---|---|---|---|
before optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
continuation_token optional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> | ||
since optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
sort optional |
query | Determines the order of events in response and the direction of listing when using continuation_token . asc = chronological, desc = reverse-chronological |
string (enum: "asc" , "desc" ) |
"desc" | |
tradeable optional |
query | If present events of other tradeables are filtered out. | string |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /executions
code 200
application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0,
"serverTime": "2022-03-31T20:38:53.677Z"
}
Name | Description | Type |
---|---|---|
accountUid optional |
string <uuid> | |
continuationToken optional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> |
elements optional |
array of ExecutionElement | |
len optional |
integer <uint64> | |
serverTime optional |
string <date-time> |
Get order events
GET
https://futures.kraken.com/api/history/v2/orders
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Parameters
Parameter | In | Description | Type | Default | Example |
---|---|---|---|---|---|
before optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
continuation_token optional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> | ||
since optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
sort optional |
query | Determines the order of events in response and the direction of listing when using continuation_token . asc = chronological, desc = reverse-chronological |
string (enum: "asc" , "desc" ) |
"desc" | |
tradeable optional |
query | If present events of other tradeables are filtered out. | string |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /orders
code 200
application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"OrderPlaced": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0,
"serverTime": "2022-03-31T20:38:53.677Z"
}
Name | Description | Type |
---|---|---|
accountUid optional |
string <uuid> | |
continuationToken optional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> |
elements optional |
array of OrderElement | |
len optional |
integer <uint64> | |
serverTime optional |
string <date-time> |
Get trigger events
GET
https://futures.kraken.com/api/history/v2/triggers
Authentication
Authent
header (Authentication string)APIKey
header (General API key with at least read-only access)
Parameters
Parameter | In | Description | Type | Default | Example |
---|---|---|---|---|---|
before optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
continuation_token optional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> | ||
since optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
sort optional |
query | Determines the order of events in response and the direction of listing when using continuation_token . asc = chronological, desc = reverse-chronological |
string (enum: "asc" , "desc" ) |
"desc" | |
tradeable optional |
query | If present events of other tradeables are filtered out. | string |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /triggers
code 200
application/json
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"OrderTriggerPlaced": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0,
"serverTime": "2022-03-31T20:38:53.677Z"
}
Name | Description | Type |
---|---|---|
accountUid optional |
string <uuid> | |
continuationToken optional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> |
elements optional |
array of TriggerElement | |
len optional |
integer <uint64> | |
serverTime optional |
string <date-time> |
Market History
Get public execution events
GET
https://futures.kraken.com/api/history/v2/market/{tradeable}/executions
Authentication is not required.
Parameters
Parameter | In | Description | Type | Default | Example |
---|---|---|---|---|---|
tradeable |
path | string | |||
before optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
continuation_token optional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> | ||
since optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
sort optional |
query | Determines the order of events in response and the direction of listing when using continuation_token . asc = chronological, desc = reverse-chronological |
string (enum: "asc" , "desc" ) |
"desc" |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /market/{tradeable}/executions
code 200
application/json
{
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0
}
Name | Description | Type |
---|---|---|
continuationToken optional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> |
elements optional |
array of ExecutionElementSanitized | |
len optional |
integer <uint64> |
Get public order events
GET
https://futures.kraken.com/api/history/v2/market/{tradeable}/orders
Authentication is not required.
Parameters
Parameter | In | Description | Type | Default | Example |
---|---|---|---|---|---|
tradeable |
path | string | |||
before optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
continuation_token optional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> | ||
since optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
sort optional |
query | Determines the order of events in response and the direction of listing when using continuation_token . asc = chronological, desc = reverse-chronological |
string (enum: "asc" , "desc" ) |
"desc" |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /market/{tradeable}/orders
code 200
application/json
{
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"OrderPlaced": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0
}
Name | Description | Type |
---|---|---|
continuationToken optional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> |
elements optional |
array of OrderElementSanitized | |
len optional |
integer <uint64> |
Get public mark price events
GET
https://futures.kraken.com/api/history/v2/market/{tradeable}/price
Authentication is not required.
Parameters
Parameter | In | Description | Type | Default | Example |
---|---|---|---|---|---|
tradeable |
path | string | |||
before optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
continuation_token optional |
query | Opaque token from the Next-Continuation-Token header used to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> | ||
since optional |
query | Timestamp in milliseconds. | integer <timestamp-milliseconds> | 1604937694000 |
|
sort optional |
query | Determines the order of events in response and the direction of listing when using continuation_token . asc = chronological, desc = reverse-chronological |
string (enum: "asc" , "desc" ) |
"desc" |
Response - application/json
Example response
(Some parts of this example are auto-generated)
GET /market/{tradeable}/price
code 200
application/json
{
"continuationToken": "c3RyaW5n",
"elements": [
{
"event": {
"price": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "string"
}
],
"len": 0
}
Name | Description | Type |
---|---|---|
continuationToken optional |
Opaque token to pass to the next request to continue listing events. The sort parameter must be the same as in the previous request to continue listing in the same direction. |
string <base64> |
elements optional |
array of PriceElement | |
len optional |
integer <uint64> |
Charts
Analytics
Get analytics data divided into time buckets
GET
https://futures.kraken.com/api/charts/v1/analytics/{tradeable}/{analytics_type}
Authentication is not required.
Parameters
Parameter | In | Description | Type | Example |
---|---|---|---|---|
analytics_type |
path | Type of analytics | string (enum: "open-interest" , "aggressor-differential" , "trade-volume" , "trade-count" , "liquidation-volume" ) |
|
tradeable |
path | string | ||
interval |
query | Resolution in seconds | integer (enum: 60 , 300 , 900 , 1800 , 3600 , 14400 , 43200 , 86400 , 604800 ) |
|
since |
query | epoch time in seconds | integer | "1676556478" |
to optional |
query | epoch time in seconds, default now | integer | 1676556478 |
Response
Example response
(Some parts of this example are auto-generated)
GET /analytics/{tradeable}/{analytics_type}
code 200
application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [
0.0
],
"timestamp": [
0
]
}
}
Example response
(Some parts of this example are auto-generated)
GET /analytics/{tradeable}/{analytics_type}
code 400
application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [
0.0
],
"timestamp": [
0
]
}
}
Example response
(Some parts of this example are auto-generated)
GET /analytics/{tradeable}/{analytics_type}
code 404
application/json
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [
0.0
],
"timestamp": [
0
]
}
}
Code | Description / Content type | Type |
---|---|---|
200 | Available analytics by type and tradeable | |
application/json |
Analytics response | |
400 | Query has invalid arguments | |
application/json |
Analytics response | |
404 | Tradeable or analytics type could not be found | |
application/json |
Analytics response |
OHLC
Get tick types
GET
https://futures.kraken.com/api/charts/v1/
Authentication is not required.
Response - application/json
All tick types available
Example response
GET /
code 200
application/json
[
"mark",
"spot",
"trade"
]
This is an array of: string (enum: "spot"
, "mark"
, "trade"
).
Get tradeable products
GET
https://futures.kraken.com/api/charts/v1/{tick_type}
Authentication is not required.
Parameters
Parameter | In | Description | Type |
---|---|---|---|
tick_type |
path | Tick Types | string (enum: "spot" , "mark" , "trade" ) |
Response - application/json
All tradeable products for the given tick_type
Example response
GET /{tick_type}
code 200
application/json
[
"PI_XRPUSD",
"FI_XRPUSD_210625",
"FI_XBTUSD_210528",
"PI_XBTUSD"
]
This is an array of: string.
Get resolutions
GET
https://futures.kraken.com/api/charts/v1/{tick_type}/{tradeable}
Authentication is not required.
Parameters
Parameter | In | Description | Type |
---|---|---|---|
tick_type |
path | Tick Types | string (enum: "spot" , "mark" , "trade" ) |
tradeable |
path | string |
Response - application/json
All resolutions for the given tick_type
and tradeable
Example response
GET /{tick_type}/{tradeable}
code 200
application/json
[
"30m",
"15m",
"5m",
"1m",
"1w",
"1h",
"12h",
"4h",
"1d"
]
This is an array of: string (enum: "1m"
, "5m"
, "15m"
, "30m"
, "1h"
, "4h"
, "12h"
, "1d"
, "1w"
).
Get OHLC
GET
https://futures.kraken.com/api/charts/v1/{tick_type}/{tradeable}/{resolution}
Authentication is not required.
Parameters
Parameter | In | Description | Type |
---|---|---|---|
resolution |
path | Resolution | string (enum: "1m" , "5m" , "15m" , "30m" , "1h" , "4h" , "12h" , "1d" , "1w" ) |
tick_type |
path | Tick Types | string (enum: "spot" , "mark" , "trade" ) |
tradeable |
path | string | |
from optional |
query | From date in epoch seconds | number |
to optional |
query | To date in epoch seconds | number |
Response - application/json
Candles for the tick_type
, tradeable
and resolution
, within the given period if provided
Example response
(Some parts of this example are auto-generated)
GET /{tick_type}/{tradeable}/{resolution}
code 200
application/json
{
"candles": [
{
"close": "56250.00000000000",
"high": "56475.00000000000",
"low": "55935.00000000000",
"open": "56294.00000000000",
"time": 1620816960000,
"volume": 10824
}
],
"more_candles": false
}
Name | Type |
---|---|
candles optional |
array of Candlestick |
more_candles optional |
bool |
Schemas
Account
Information for all margin and cash accounts
Account example
(Some parts of this example are auto-generated)
{
"cash": {
"balances": {
"<property>": 0.0
},
"type": "cashAccount"
},
"flex": {
"availableMargin": 0.0,
"balanceValue": 0.0,
"collateralValue": 0.0,
"currencies": {
"<property>": {
"available": 0.0,
"collateral": 0.0,
"quantity": 0.0,
"value": 0.0
}
},
"initialMargin": 0.0,
"initialMarginWithOrders": 0.0,
"maintenanceMargin": 0.0,
"marginEquity": 0.0,
"pnl": 0.0,
"portfolioValue": 0.0,
"totalUnrealized": 0.0,
"totalUnrealizedAsMargin": 0.0,
"type": "multiCollateralMarginAccount",
"unrealizedFunding": 0.0
},
"<property>": {
"auxiliary": [
{
"af": 0.0,
"funding": 0.0,
"pnl": 0.0,
"pv": 0.0,
"usd": 0.0
}
],
"balances": {
"<property>": 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"
}
}
Name | Description | Type |
---|---|---|
cash optional |
CashAccount | |
flex optional |
Structure showing multi-collateral wallet details. | FlexBalanceSummary |
<other> | MarginAccount |
AccountLogEntry
AccountLogEntry example
(Some parts of this example are auto-generated)
{
"asset": "string",
"booking_uid": "string",
"collateral": "string",
"contract": "string",
"conversion_spread_percentage": 0.0,
"date": "2001-07-08T00:34:60.026490+09:30",
"execution": "string",
"fee": 0.0,
"funding_rate": 0.0,
"id": 0,
"info": "string",
"margin_account": "string",
"mark_price": 0.0,
"new_average_entry_price": 0.0,
"new_balance": 0.0,
"old_average_entry_price": 0.0,
"old_balance": 0.0,
"realized_funding": 0.0,
"realized_pnl": 0.0,
"trade_price": 0.0
}
Name | Description | Type | Example |
---|---|---|---|
asset |
string | ||
booking_uid |
string | ||
collateral |
null or string | ||
contract |
null or string | ||
conversion_spread_percentage |
null or number | ||
date |
RFC 3339 formatted datetime. | string | "2001-07-08T00:34:60.026490+09:30" |
execution |
null or string | ||
fee |
null or number | ||
funding_rate |
null or number | ||
id |
Log entry ID. Starts at 1. | integer | |
info |
string | ||
margin_account |
string | ||
mark_price |
null or number | ||
new_average_entry_price |
null or number | ||
new_balance |
number | ||
old_average_entry_price |
null or number | ||
old_balance |
number | ||
realized_funding |
null or number | ||
realized_pnl |
null or number | ||
trade_price |
null or number |
Analytics response
Analytics response example
(Some parts of this example are auto-generated)
{
"errors": [
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
],
"result": {
"data": [
0.0
],
"timestamp": [
0
]
}
}
Name | Type |
---|---|
errors optional |
array of Analytics response error |
result optional |
Result container for analytics response |
Analytics response error
Analytics response error example
(Some parts of this example are auto-generated)
{
"error_class": "string",
"field": "string",
"msg": "string",
"severity": "string",
"type": "string",
"value": "string"
}
Name | Type |
---|---|
error_class |
string |
severity |
string |
type |
string |
field optional |
string |
msg optional |
string |
value optional |
string |
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
}
Name | 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 |
Batch Instruction
Batch Instruction example
(Some parts of this example are auto-generated)
{
"order": "send",
"order_tag": "1",
"orderType": "lmt",
"symbol": "PI_XBTUSD",
"side": "buy",
"size": 1,
"limitPrice": 1.0,
"cliOrdId": "my_another_client_id"
}
One of the following, depending on the value of order
:
For order
= send
:
BatchOrderSend example
{
"order": "send",
"order_tag": "1",
"orderType": "lmt",
"symbol": "PI_XBTUSD",
"side": "buy",
"size": 1,
"limitPrice": 1.0,
"cliOrdId": "my_another_client_id"
}
Name | Description | Type | Default |
---|---|---|---|
cliOrdId optional |
The order identity that is specified from the user. It must be globally unique. | string (max. length 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" ) |
|
orderType optional |
* 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 optional |
Yes An arbitrary string provided client-side to tag the order for the purpose of mapping order sending instructions to the API's response. | string | |
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'. | bool | false |
side optional |
The direction of the order. | string (enum: "buy" , "sell" ) |
|
size optional |
The size associated with the order. | number | |
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 | |
symbol optional |
The symbol of the Futures. | string | |
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" ) |
For order
= edit
:
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.0
}
Provide either order_id
or cliOrdId
.
Name | Description | Type |
---|---|---|
cliOrdId optional |
Unique client order identifier. | null or string (max. length 100 ) |
limitPrice optional |
The limit price associated with the order. | number |
order optional |
Always edit . |
string (value: "edit" ) |
order_id optional |
Order ID. | string <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. 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 |
For order
= cancel
:
BatchOrderCancel example
{
"order": "cancel",
"order_id": "e35d61dd-8a30-4d5f-a574-b5593ef0c050"
}
Provide either order_id
or cliOrdId
.
Name | Description | Type |
---|---|---|
cliOrdId optional |
Unique client order identifier. | null or string (max. length 100 ) |
order optional |
Always cancel . |
string (value: "cancel" ) |
order_id optional |
Order ID. | string <uuid> |
BatchInstructionResult
BatchInstructionResult example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"dateTimeReceived": "string",
"orderEvents": [
{
"order": {
"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",
"orderTag": "string",
"status": "placed"
}
Name | 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 |
dateTimeReceived optional |
The date and time the order was received. | null or string |
orderEvents optional |
array of OrderEvent | |
orderId optional |
The unique identifier of the order. | null or string |
orderTag 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" , "cancelled" , "invalidOrderType" , "invalidSide" , "invalidSize" , "invalidPrice" , "insufficientAvailableFunds" , "selfFill" , "tooManySmallOrders" , "marketSuspended" , "marketInactive" , "clientOrderIdAlreadyExist" , "clientOrderIdTooLong" , "outsidePriceCollar" , "postWouldExecute" , "iocWouldNotExecute" ) |
CachedOrderJson
CachedOrderJson example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"priceTriggerOptions": {
"trailingStopOptions": {
"maxDeviation": 0.0,
"unit": "PERCENT"
},
"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"
}
Name | Type |
---|---|
cliOrdId optional |
null or string |
filled optional |
null or number |
lastUpdateTimestamp optional |
string |
limitPrice optional |
null or number |
orderId optional |
string <uuid> |
priceTriggerOptions optional |
TriggerOptions |
quantity optional |
null or number |
reduceOnly optional |
bool |
side optional |
string |
symbol optional |
string |
timestamp optional |
string |
triggerTime optional |
null or string |
type optional |
string (enum: "TRIGGER_ORDER" , "ORDER" ) |
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": {
"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": "place",
"uid": "string"
}
],
"receivedTime": "string",
"status": "noOrdersToCancel"
}
Name | 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 of OrderIdElement |
orderEvents optional |
array of 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" ) |
CancelEvent
CancelEvent example
(Some parts of this example are auto-generated)
{
"order": {
"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": "place",
"uid": "string"
}
Name | Description | Type |
---|---|---|
order optional |
The cancelled order. | OrderJson |
type optional |
Always cancel . |
string (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
uid optional |
The uid associated with the order. | string |
CancelOrderStatusJson
CancelOrderStatusJson example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"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"
}
Name | Description | Type |
---|---|---|
cliOrdId optional |
The client order id. Shown only if client specified one. | null or string |
orderEvents optional |
array of OrderEvent | |
order_id optional |
The cancelled order id | string <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" ) |
Candlestick
Candlestick example
(Some parts of this example are auto-generated)
{
"close": "56250.00000000000",
"high": "56475.00000000000",
"low": "55935.00000000000",
"open": "56294.00000000000",
"time": 1620816960000,
"volume": 10824
}
Name | Description | Type | Example |
---|---|---|---|
close optional |
string <double> | "56250.00000000000" |
|
high optional |
string <double> | "56475.00000000000" |
|
low optional |
string <double> | "55935.00000000000" |
|
open optional |
string <double> | "56294.00000000000" |
|
time optional |
Epoch in ms | integer <int32> | 1620816960000 |
volume optional |
number <int32> | 10824 |
CashAccount
CashAccount example
(Some parts of this example are auto-generated)
{
"balances": {
"<property>": 0.0
},
"type": "cashAccount"
}
Name | 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)
{
"<property>": 0.0
}
Name | Type |
---|---|
<property> | number |
DeadManSwitchStatusJson
DeadManSwitchStatusJson example
(Some parts of this example are auto-generated)
{
"currentTime": "string",
"triggerTime": "string"
}
Name | 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 |
EditOrderStatus
EditOrderStatus example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"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"
}
Name | 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 of 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" ) |
Error
Error description.
accountInactive
: The Futures account the request refers to is inactiveapiLimitExceeded
: The API limit for the calling IP address has been exceededauthenticationError
: The request could not be authenticatedinsufficientFunds
: The amount requested for transfer is below the amount of funds availableinvalidAccount
: The Futures account the transfer request refers to is invalidinvalidAmount
: The amount the transfer request refers to is invalidinvalidArgument
: One or more arguments provided are invalidinvalidUnit
: The unit the transfer request refers to is invalidJson Parse Error
: The request failed to pass valid JSON as an argumentmarketUnavailable
: The market is currently unavailablenonceBelowThreshold
: The provided nonce is below the thresholdnonceDuplicate
: The provided nonce is a duplicate as it has been used in a previous requestnotFound
: The requested information could not be foundrequiredArgumentMissing
: One or more required arguments are missingServer Error
: There was an error processing the requestUnavailable
: The endpoint being called is unavailableunknownError
: An unknown error has occurred
Error example
(Some parts of this example are auto-generated)
"accountInactive"
This is a 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"
Execution
Execution example
(Some parts of this example are auto-generated)
{
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
}
Name | Type | Example |
---|---|---|
limitFilled optional |
bool | |
makerOrder optional |
Order | |
makerOrderData optional |
MakerOrderData | |
markPrice optional |
string <big-decimal> | "1234.56789" |
oldTakerOrder optional |
Order | |
price optional |
string <big-decimal> | "1234.56789" |
quantity optional |
string <big-decimal> | "1234.56789" |
takerOrder optional |
Order | |
takerOrderData optional |
TakerOrderData | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
uid optional |
string <uuid> | |
usdValue optional |
string <big-decimal> | "1234.56789" |
ExecutionDetails
ExecutionDetails example
(Some parts of this example are auto-generated)
{
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
Name | Description | Type |
---|---|---|
execution optional |
Execution | |
takerReducedQuantity optional |
sometimes empty string | string |
ExecutionElement
ExecutionElement example
(Some parts of this example are auto-generated)
{
"event": {
"execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Name | Type | Example |
---|---|---|
event optional |
ExecutionEvent | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
uid optional |
string |
ExecutionElementSanitized
ExecutionElementSanitized example
(Some parts of this example are auto-generated)
{
"event": {
"execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Name | Type | Example |
---|---|---|
event optional |
ExecutionEventSanitized | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
uid optional |
string |
ExecutionEvent
ExecutionEvent example
(Some parts of this example are auto-generated)
{
"execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
}
Name | Type |
---|---|
execution optional |
ExecutionDetails |
ExecutionEventSanitized
ExecutionEventSanitized example
(Some parts of this example are auto-generated)
{
"execution": {
"execution": {
"limitFilled": false,
"makerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"makerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"markPrice": "1234.56789",
"oldTakerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"price": "1234.56789",
"quantity": "1234.56789",
"takerOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"takerOrderData": {
"fee": "1234.56789",
"positionSize": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"usdValue": "1234.56789"
},
"takerReducedQuantity": "string"
}
}
Name | Type |
---|---|
execution optional |
ExecutionDetails |
FeeSchedule
FeeSchedule example
{
"uid": "7fc4d7c0-464f-4029-a9bb-55856d0c5247",
"name": "PGTMainFees",
"tiers": [
{
"makerFee": 0.02,
"takerFee": 0.05,
"usdVolume": 0.0
},
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000.0
},
{
"makerFee": 0.0125,
"takerFee": 0.03,
"usdVolume": 1000000.0
},
{
"makerFee": 0.01,
"takerFee": 0.025,
"usdVolume": 5000000.0
},
{
"makerFee": 0.0075,
"takerFee": 0.02,
"usdVolume": 10000000.0
},
{
"makerFee": 0.005,
"takerFee": 0.015,
"usdVolume": 20000000.0
},
{
"makerFee": 0.0025,
"takerFee": 0.0125,
"usdVolume": 50000000.0
},
{
"makerFee": 0.0,
"takerFee": 0.01,
"usdVolume": 100000000.0
}
]
}
Name | Description | Type | Example |
---|---|---|---|
name optional |
Name of schedule. | string | "PGTMainFees" |
tiers optional |
A list containing a structures for each fee tier, see below. | array of FeeTier | |
uid optional |
Unique identifier of fee schedule. | string | "7fc4d7c0-464f-4029-a9bb-55856d0c5247" |
FeeScheduleVolumes
The 30-day volume for your account.
FeeScheduleVolumes example
{
"d46c2190-81e3-4370-a333-424f24387829": 10.0,
"7fc4d7c0-464f-4029-a9bb-55856d0c5247": 10.0
}
Name | Type |
---|---|
<property> | number |
FeeTier
FeeTier example
(Some parts of this example are auto-generated)
{
"makerFee": 0.015,
"takerFee": 0.04,
"usdVolume": 100000.0
}
Name | 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.0 |
FillJson
FillJson example
{
"fill_id": "98e3deeb-0385-4b25-b15e-7e8453512cb2",
"fillTime": "2021-11-18T02:39:41.826Z",
"fillType": "maker",
"order_id": "06b9d509-965c-4788-b317-0e5ca11d56fb",
"price": 47000,
"side": "buy",
"size": 10,
"symbol": "pi_xbtusd"
}
Name | 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 <uuid> | |
order_id optional |
The unique identifier of the order. | string <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" |
FlexAccountBalance
FlexAccountBalance example
(Some parts of this example are auto-generated)
{
"availableMargin": 0.0,
"balanceValue": 0.0,
"collateralValue": 0.0,
"currencies": [
{
"available": 0.0,
"collateral": 0.0,
"currency": "string",
"quantity": 0.0,
"value": 0.0
}
],
"initialMargin": 0.0,
"initialMarginWithOrders": 0.0,
"maintenanceMargin": 0.0,
"marginEquity": 0.0,
"pnl": 0.0,
"portfolioValue": 0.0,
"totalUnrealized": 0.0,
"totalUnrealizedAsMargin": 0.0,
"unrealizedFunding": 0.0
}
Name | Description | Type |
---|---|---|
availableMargin optional |
Account-wide margin available to create new orders (Margin Equity - Total Initial Margin). | number |
balanceValue optional |
The total balance value for the multi-collateral account in USD. | number |
collateralValue optional |
The USD value of balances in account usable for margin [(Balance Value * (1-Haircut)]. | number |
currencies optional |
array of FlexCurrencyBalance | |
initialMargin optional |
The total initial margin for the multi-collateral account in USD. | number |
initialMarginWithOrders optional |
The total initial margin of open positions without the margin held by open orders for the multi-collateral account in USD. | number |
maintenanceMargin optional |
The total maintenance margin for the multi-collateral account in USD. | number |
marginEquity optional |
The Balance Value multiplied by the dollar rate and with haircuts applied to non-USD currencies, plus unrealised profit or loss as Margin. [Balance Value in USD * (1-Haircut)] + (Total Unrealised Profit/Loss as Margin in USD) |
number |
pnl optional |
The unrealised pnl for the multi-collateral account. | number |
portfolioValue optional |
The total value of the portfolio in USD (Balance Value + Total Unrealised Profit/Loss). | number |
totalUnrealized optional |
Total unrealised Profit/Loss and unrealised funding of open positions in USD (Unrealised Position(s) Profit/Loss + Unrealised Funding Rate Profit/Loss) * USD rate. | number |
totalUnrealizedAsMargin optional |
Unrealised Profit/Loss and unrealised funding that is usable as margin (Unrealised Profit/Loss + Unrealised Funding Rate) * Haircut - Conversion Fee. | number |
unrealizedFunding optional |
The total unrealised funding for the multi-collateral account in USD. | number |
FlexBalanceSummary
FlexBalanceSummary example
(Some parts of this example are auto-generated)
{
"availableMargin": 0.0,
"balanceValue": 0.0,
"collateralValue": 0.0,
"currencies": {
"<property>": {
"available": 0.0,
"collateral": 0.0,
"quantity": 0.0,
"value": 0.0
}
},
"initialMargin": 0.0,
"initialMarginWithOrders": 0.0,
"maintenanceMargin": 0.0,
"marginEquity": 0.0,
"pnl": 0.0,
"portfolioValue": 0.0,
"totalUnrealized": 0.0,
"totalUnrealizedAsMargin": 0.0,
"type": "multiCollateralMarginAccount",
"unrealizedFunding": 0.0
}
Name | Description | Type |
---|---|---|
availableMargin optional |
Margin Equity - Total Initial Margin. | number |
balanceValue optional |
USD value of all collateral in multi-collateral wallet. | number |
collateralValue optional |
USD value of balances in account usable for margin (Balance Value * Haircut). | number |
currencies optional |
Structure with collateral currency details. | FlexCurrencies |
initialMargin optional |
Total initial margin held for open positions (USD). | number |
initialMarginWithOrders optional |
Total initial margin held for open positions and open orders (USD). | number |
maintenanceMargin optional |
Total maintenance margin held for open positions (USD). | number |
marginEquity optional |
[Balance Value in USD * (1-Haircut)] + (Total Unrealised Profit/Loss as Margin in USD). | number |
pnl optional |
Unrealised PnL in USD. | number |
portfolioValue optional |
Balance value plus unrealised PnL in USD. | number |
totalUnrealized optional |
Total USD value of unrealised funding and unrealised PnL. | number |
totalUnrealizedAsMargin optional |
Unrealised pnl and unrealised funding that is usable as margin [(Unrealised Profit/Loss + Unrealised Funding Rate) * Haircut - Conversion Fee]. | number |
type optional |
The type of the account (always multiCollateralMarginAccount) | string (value: "multiCollateralMarginAccount" ) |
unrealizedFunding optional |
Unrealised funding from funding rate (USD). | number |
FlexCurrencies
FlexCurrencies example
(Some parts of this example are auto-generated)
{
"<property>": {
"available": 0.0,
"collateral": 0.0,
"quantity": 0.0,
"value": 0.0
}
}
Name | Type |
---|---|
<property> | FlexCurrencySummary |
FlexCurrencyBalance
FlexCurrencyBalance example
(Some parts of this example are auto-generated)
{
"available": 0.0,
"collateral": 0.0,
"currency": "string",
"quantity": 0.0,
"value": 0.0
}
Name | Description | Type |
---|---|---|
available optional |
The available currency (quantity - margin requirement) | number |
collateral optional |
The collateral value of the currency quantity (value * haircut). | number |
currency optional |
The name of the currency. | string |
quantity optional |
The amount of currency in the multi-collateral account. | number |
value optional |
The value of the currency quantity. | number |
FlexCurrencySummary
FlexCurrencySummary example
(Some parts of this example are auto-generated)
{
"available": 0.0,
"collateral": 0.0,
"quantity": 0.0,
"value": 0.0
}
Name | Description | Type |
---|---|---|
available optional |
Margin (in base currency) available for trading. | number |
collateral optional |
USD value of the asset usable for margin (Asset Value * Haircut). | number |
quantity optional |
Quantity of asset. | number |
value optional |
USD value of asset. | number |
FutureAccountBalance
FutureAccountBalance example
(Some parts of this example are auto-generated)
{
"availableMargin": 0.0,
"name": "string"
}
Name | Description | Type |
---|---|---|
availableMargin optional |
The amount of currency in the holding account in the quote currency of the name pair. | number |
name optional |
The name of the futures account as the account pair. | string |
HistoricalFundingRateJson
HistoricalFundingRateJson example
(Some parts of this example are auto-generated)
{
"fundingRate": 0.0,
"relativeFundingRate": 0.0,
"timestamp": "2022-03-31T20:38:53.677Z"
}
Name | 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 <date-time> |
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": 0.0,
"time": "string",
"to_be_cleared": false,
"trade_id": 0,
"transaction_identification_code": "string",
"type": "fill",
"uid": "string"
}
Name | 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 number |
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 bool | |
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 <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 |
HoldingAccountBalance
HoldingAccountBalance example
(Some parts of this example are auto-generated)
{
"amount": 0.0,
"currency": "string"
}
Name | Description | Type |
---|---|---|
amount optional |
The amount of currency in the holding account. | number |
currency optional |
The currency of the account. All figures shown in this currency. | string |
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"
}
Name | Description | Type |
---|---|---|
category optional |
Category of the contract: "Layer 1", "Layer 2", "DeFi", or "Privacy" (multi-collateral contracts only). | null or string |
contractSize optional |
For Futures: The contract size of the Futures For indices: Not returned because N/A |
null or 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). | null or number |
feeScheduleUid optional |
Unique identifier of fee schedule associated with the instrument | null or string |
fundingRateCoefficient optional |
null or number | |
impactMidSize optional |
Amount of contract used to calculated the mid price for the mark price | null or number |
isin optional |
Single-collateral contracts only: Contract's ISIN code | null or string |
lastTradingTime optional |
null or string <date-time> | |
marginLevels optional |
For Futures: A list containing the margin schedules For indices: Not returned because N/A |
null or array of MarginLevel |
maxPositionSize optional |
Maximum number of contracts that one can hold in a position | null or number |
maxRelativeFundingRate optional |
Perpetuals only: the absolute value of the maximum permissible funding rate | null or number |
openingDate optional |
When the contract was first available for trading | null or string <date-time> |
postOnly optional |
True if the instrument is in post-only mode, false otherwise. | null or bool |
retailMarginLevels optional |
Margin levels for retail clients (investor category no longer eligible for trading). | null or array of MarginLevel |
symbol optional |
null or string | |
tags optional |
Tag for the contract (currently does not return a value). | null or array of string |
tickSize optional |
Tick size of the contract being traded. | null or number |
tradeable optional |
True if the instrument can be traded, False otherwise. | bool |
type optional |
The type of the instrument: * flexible_futures * futures_inverse * futures_vanilla |
null or string (enum: "flexible_futures" , "futures_inverse" , "futures_vanilla" ) |
underlying optional |
For Futures: The underlying of the Futures For indices: Not returned because N/A |
null or string |
InstrumentStatus
InstrumentStatus example
(Some parts of this example are auto-generated)
{
"extremeVolatilityInitialMarginMultiplier": 0,
"isExperiencingDislocation": false,
"isExperiencingExtremeVolatility": false,
"priceDislocationDirection": "ABOVE_UPPER_BOUND",
"tradeable": "PI_XBTUSD"
}
Name | Type | Example |
---|---|---|
extremeVolatilityInitialMarginMultiplier optional |
integer | |
isExperiencingDislocation optional |
bool | |
isExperiencingExtremeVolatility optional |
bool | |
priceDislocationDirection optional |
null or string (enum: "ABOVE_UPPER_BOUND" , "BELOW_LOWER_BOUND" ) |
|
tradeable optional |
string | "PI_XBTUSD" |
LeveragePreference
LeveragePreference example
(Some parts of this example are auto-generated)
{
"maxLeverage": 0.0,
"symbol": "string"
}
Name | Type |
---|---|
maxLeverage optional |
number |
symbol optional |
string |
MakerOrderData
MakerOrderData example
(Some parts of this example are auto-generated)
{
"fee": "1234.56789",
"positionSize": "1234.56789"
}
Name | Type | Example |
---|---|---|
fee optional |
string <big-decimal> | "1234.56789" |
positionSize optional |
string <big-decimal> | "1234.56789" |
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": {
"<property>": 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"
}
Name | Description | Type |
---|---|---|
auxiliary optional |
A structure containing auxiliary account information. | array of 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. | array of MarginRequirements |
triggerEstimates optional |
A structure containing the account’s margin trigger estimates. | array of MarginRequirements |
type optional |
The type of the account (always marginAccount) | string (value: "marginAccount" ) |
MarginAccountBalances
MarginAccountBalances example
(Some parts of this example are auto-generated)
{
"<property>": 0.0
}
Name | Type |
---|---|
<property> | number |
MarginLevel
MarginLevel example
(Some parts of this example are auto-generated)
{
"contracts": 0,
"initialMargin": 0.0,
"maintenanceMargin": 0.0,
"numNonContractUnits": 0.0
}
Name | 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 <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 <double> |
MarginRequirements
MarginRequirements example
(Some parts of this example are auto-generated)
{
"im": 0.0,
"lt": 0.0,
"mm": 0.0,
"tt": 0.0
}
Name | 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 |
MarkPriceChanged
MarkPriceChanged example
(Some parts of this example are auto-generated)
{
"price": "1234.56789"
}
Name | Type | Example |
---|---|---|
price optional |
string <big-decimal> | "1234.56789" |
NotificationJson
NotificationJson example
(Some parts of this example are auto-generated)
{
"effectiveTime": "string",
"note": "string",
"priority": "low",
"type": "new_feature"
}
Name | Description | Type |
---|---|---|
effectiveTime optional |
The time that notification is taking effect. | string |
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 * ettlement 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" ) |
OpenOrderJson
OpenOrderJson example
(Some parts of this example are auto-generated)
{
"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
}
Name | 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 |
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 <uuid> |
receivedTime optional |
The date and time the order was received. | string |
reduceOnly optional |
Is the order a reduce only order or not. | bool |
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 orderIf 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 |
OpenPositionJson
OpenPositionJson example
(Some parts of this example are auto-generated)
{
"fillTime": "string",
"maxFixedLeverage": 0.0,
"pnlCurrency": "USD",
"price": 0.0,
"side": "long",
"size": 0.0,
"symbol": "string",
"unrealizedFunding": 0.0
}
Name | Description | Type |
---|---|---|
fillTime optional |
The date and time the position was entered into (Deprecated field, fills endpoint for fill time is recommended). | string |
maxFixedLeverage optional |
Max leverage selected for isolated position. | null or number <double> |
pnlCurrency optional |
Selected pnl currency for the position (default: USD) | null or string (enum: "USD" , "EUR" , "GBP" , "USDC" , "USDT" , "BTC" , "ETH" ) |
price optional |
The average price at which the position was entered into. | number <double> |
side optional |
The direction of the position. | string (enum: "long" , "short" ) |
size optional |
The size of the position. | number <double> |
symbol optional |
The symbol of the Futures. | string |
unrealizedFunding optional |
Unrealised funding on the position. | null or number <double> |
Order
Order example
(Some parts of this example are auto-generated)
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Name | Type | Example |
---|---|---|
accountUid optional |
string <uuid> | |
clientId optional |
string | |
direction optional |
string (enum: "Buy" , "Sell" ) |
|
filled optional |
string <big-decimal> | "1234.56789" |
lastUpdateTimestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
limitPrice optional |
string <big-decimal> | "1234.56789" |
orderType optional |
string | |
quantity optional |
string <big-decimal> | "1234.56789" |
reduceOnly optional |
bool | |
spotData optional |
null or string | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
tradeable optional |
string | |
uid optional |
string <uuid> |
OrderBook
OrderBook example
{
"bids": [
[
40178,
5
],
[
40174,
4.2
],
[
40170,
7.2
]
],
"asks": [
[
40186,
5.0183
],
[
40190,
0.4183
]
]
}
Name | 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 of Schema 1 |
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 of Schema 1 |
OrderCancelled
OrderCancelled example
(Some parts of this example are auto-generated)
{
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Name | Type |
---|---|
order optional |
Order |
reason optional |
string |
OrderCancelledSanitized
OrderCancelledSanitized example
(Some parts of this example are auto-generated)
{
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Name | Type |
---|---|
order optional |
OrderSanitized |
reason optional |
string |
OrderEditRejected
OrderEditRejected example
(Some parts of this example are auto-generated)
{
"attemptedOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string"
}
Name | Type |
---|---|
attemptedOrder optional |
Order |
oldOrder optional |
Order |
orderError optional |
string |
OrderElement
OrderElement example
(Some parts of this example are auto-generated)
{
"event": {
"OrderPlaced": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Name | Type | Example |
---|---|---|
event optional |
OrderEvent | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
uid optional |
string |
OrderElementSanitized
OrderElementSanitized example
(Some parts of this example are auto-generated)
{
"event": {
"OrderPlaced": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Name | Type | Example |
---|---|---|
event optional |
OrderEventSanitized | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
uid optional |
string |
OrderEvent
OrderEvent example
(Some parts of this example are auto-generated)
{
"order": {
"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"
}
Response is one of the following:
Name | 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 (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
Name | Description | Type |
---|---|---|
order optional |
The cancelled order. | OrderJson |
type optional |
Always cancel . |
string (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
uid optional |
The uid associated with the order. | string |
Name | 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 (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
Name | Description | Type |
---|---|---|
order optional |
The rejected order or null. | OrderJson |
reason optional |
The rejection reason: * postWouldExecute - The post-only order would be filled upon placement, thus is cancelled.* iocWouldNotExecute - The immediate-or-cancel order would not execute.* wouldNotReducePosition - The reduce only order would not reduce position.* orderForEditNotFound - The order for edit was not found. The order field will be null in this case. |
string (enum: "postWouldExecute" , "iocWouldNotExecute" , "wouldNotReducePosition" , "orderForEditNotFound" ) |
type optional |
Always reject . |
string (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
uid optional |
The UID associated with the order. | string |
Name | Description | Type |
---|---|---|
amount optional |
The executed amount. | number |
executionId optional |
The UID associated with the execution. | string |
orderPriorEdit optional |
The order before the edit was applied (if the execution is a result of an order edit) or null. | OrderJson |
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 (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
Name | Description | Type |
---|---|---|
orderTrigger optional |
OrderTriggerJson | |
type optional |
Always place . |
string (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
Name | Description | Type |
---|---|---|
orderTrigger optional |
OrderTriggerJson | |
type optional |
Always cancel . |
string (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
uid optional |
string |
Name | Description | Type |
---|---|---|
orderTrigger optional |
OrderTriggerJson | |
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" ) |
|
type optional |
Always reject . |
string (enum: "place" , "cancel" , "edit" , "reject" , "execution" ) |
uid optional |
string |
OrderEvent
OrderEvent example
(Some parts of this example are auto-generated)
{
"OrderPlaced": {
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
}
Response is one of the following:
Name | Type |
---|---|
OrderPlaced optional |
OrderPlaced |
Name | Type |
---|---|
OrderUpdated optional |
OrderUpdated |
Name | Type |
---|---|
OrderRejected optional |
OrderRejected |
Name | Type |
---|---|
OrderCancelled optional |
OrderCancelled |
Name | Type |
---|---|
OrderNotFound optional |
OrderNotFound |
Name | Type |
---|---|
OrderEditRejected optional |
OrderEditRejected |
OrderEventSanitized
OrderEventSanitized example
(Some parts of this example are auto-generated)
{
"OrderPlaced": {
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
}
Response is one of the following:
Name | Type |
---|---|
OrderPlaced optional |
OrderPlacedSanitized |
Name | Type |
---|---|
OrderUpdated optional |
OrderUpdatedSanitized |
Name | Type |
---|---|
OrderCancelled optional |
OrderCancelledSanitized |
OrderIdElement
Provide either order_id
or cliOrdId
.
OrderIdElement example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"order_id": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Name | Description | Type |
---|---|---|
cliOrdId optional |
Unique client order identifier. | null or string (max. length 100 ) |
order_id optional |
Order ID. | string <uuid> |
OrderJson
OrderJson example
(Some parts of this example are auto-generated)
{
"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"
}
Name | Description | Type |
---|---|---|
cliOrdId optional |
The client order id or null if order does not have one. | null or string |
filled optional |
The 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. | bool |
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" ) |
OrderNotFound
OrderNotFound example
(Some parts of this example are auto-generated)
{
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"orderId": "Uuid(uuid=2ceb1d31-f619-457b-870c-fd4ddbb10d45)"
}
Name | Type |
---|---|
accountUid optional |
string <uuid> |
orderId optional |
string |
OrderPlaced
OrderPlaced example
(Some parts of this example are auto-generated)
{
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
Name | Description | Type |
---|---|---|
order optional |
Order | |
reason optional |
string | |
reducedQuantity optional |
always empty string | string |
OrderPlacedSanitized
OrderPlacedSanitized example
(Some parts of this example are auto-generated)
{
"order": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "string"
}
Name | Description | Type |
---|---|---|
order optional |
OrderSanitized | |
reason optional |
string | |
reducedQuantity optional |
always empty string | string |
OrderRejected
OrderRejected example
(Some parts of this example are auto-generated)
{
"order": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string",
"reason": "string"
}
Name | Type |
---|---|
order optional |
Order |
orderError optional |
string |
reason optional |
string |
OrderSanitized
OrderSanitized example
(Some parts of this example are auto-generated)
{
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Name | Type | Example |
---|---|---|
direction optional |
string (enum: "Buy" , "Sell" ) |
|
lastUpdateTimestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
limitPrice optional |
string <big-decimal> | "1234.56789" |
orderType optional |
string | |
quantity optional |
string <big-decimal> | "1234.56789" |
reduceOnly optional |
bool | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
tradeable optional |
string | |
uid optional |
string <uuid> |
OrderStatusDetailsJson
OrderStatusDetailsJson example
(Some parts of this example are auto-generated)
{
"error": "MARKET_SUSPENDED",
"order": {
"cliOrdId": "string",
"filled": 0.0,
"lastUpdateTimestamp": "string",
"limitPrice": 0.0,
"orderId": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"priceTriggerOptions": {
"trailingStopOptions": {
"maxDeviation": 0.0,
"unit": "PERCENT"
},
"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": "LOADING_MARKET"
}
Name | Type |
---|---|
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" ) |
order optional |
CachedOrderJson |
status optional |
string (enum: "ENTERED_BOOK" , "FULLY_EXECUTED" , "REJECTED" , "CANCELLED" , "TRIGGER_PLACED" , "TRIGGER_ACTIVATION_FAILURE" ) |
updateReason optional |
string (enum: "LOADING_MARKET" , "NEW_USER_ORDER" , "LIQUIDATION_ORDER" , "STOP_ORDER_TRIGGERED" , "LIMIT_FROM_STOP" , "PARTIAL_FILL" , "FULL_FILL" , "CANCELLED_BY_USER" , "CONTRACT_EXPIRED" , "NOT_ENOUGH_MARGIN" , "MARKET_INACTIVE" , "DEAD_MAN_SWITCH" , "CANCELLED_BY_ADMIN" , "POST_WOULD_EXECUTE_REASON" , "IOC_WOULD_NOT_EXECUTE_REASON" , "WOULD_EXECUTE_SELF_REASON" , "WOULD_NOT_REDUCE_POSITION" , "EDITED_BY_USER" , "ORDER_FOR_EDIT_NOT_FOUND_REASON" , "EXPIRED" , "TRAILING_STOP_PRICE_UPDATED" , "TRAILING_STOP_CANCELLED_AND_REPLACED_BY_ADMIN" ) |
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"
}
Name | 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. | bool |
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 |
OrderUpdated
OrderUpdated example
(Some parts of this example are auto-generated)
{
"newOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"filled": "1234.56789",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"spotData": "string",
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "1234.56789"
}
Name | Type | Example |
---|---|---|
newOrder optional |
Order | |
oldOrder optional |
Order | |
reason optional |
string | |
reducedQuantity optional |
string <big-decimal> | "1234.56789" |
OrderUpdatedSanitized
OrderUpdatedSanitized example
(Some parts of this example are auto-generated)
{
"newOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrder": {
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string",
"reducedQuantity": "1234.56789"
}
Name | Type | Example |
---|---|---|
newOrder optional |
OrderSanitized | |
oldOrder optional |
OrderSanitized | |
reason optional |
string | |
reducedQuantity optional |
string <big-decimal> | "1234.56789" |
PnlPreference
PnlPreference example
(Some parts of this example are auto-generated)
{
"pnlCurrency": "USD",
"symbol": "string"
}
Name | Type | Example |
---|---|---|
pnlCurrency optional |
string | "USD" |
symbol optional |
string |
PriceElement
PriceElement example
(Some parts of this example are auto-generated)
{
"event": {
"price": "1234.56789"
},
"timestamp": 1604937694000,
"uid": "string"
}
Name | Type | Example |
---|---|---|
event optional |
MarkPriceChanged | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
uid optional |
string |
Result container for analytics response
Result container for analytics response example
(Some parts of this example are auto-generated)
{
"data": [
0.0
],
"timestamp": [
0
]
}
Name | Type |
---|---|
data optional |
array of Schema 3 |
timestamp optional |
array of integer |
Schema 1
An array of two floats. The first value is the price. The second value is the size.
Example
[
40178.0,
5.0
]
This is an array of: number.
The array contains 2 items.
Schema 2
Example
(Some parts of this example are auto-generated)
{
"tradingEnabled": false
}
Response is one of the following:
Name | Type |
---|---|
tradingEnabled |
bool |
Name | Description | Type | Example |
---|---|---|---|
errors optional |
array of Error | ||
result optional |
string (value: "error" ) |
"error" |
|
serverTime optional |
Server time in Coordinated Universal Time (UTC) | string | "2020-08-27T17:03:33.196Z" |
Schema 3
Example
(Some parts of this example are auto-generated)
0.0
Response is one of the following:
This is a number.
Decimal string
This is a string.
Ohlc
This is an array of: number.
The array contains 4 items.
SendOrderJson
SendOrderJson example
(Some parts of this example are auto-generated)
{
"cliOrdId": "string",
"orderEvents": [
{
"order": {
"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"
}
Name | 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 of OrderEvent | |
order_id optional |
The unique identifier of the order | string <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. |
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" ) |
SubAccount
SubAccount example
(Some parts of this example are auto-generated)
{
"accountUid": "string",
"email": "string",
"flexAccount": {
"availableMargin": 0.0,
"balanceValue": 0.0,
"collateralValue": 0.0,
"currencies": [
{
"available": 0.0,
"collateral": 0.0,
"currency": "string",
"quantity": 0.0,
"value": 0.0
}
],
"initialMargin": 0.0,
"initialMarginWithOrders": 0.0,
"maintenanceMargin": 0.0,
"marginEquity": 0.0,
"pnl": 0.0,
"portfolioValue": 0.0,
"totalUnrealized": 0.0,
"totalUnrealizedAsMargin": 0.0,
"unrealizedFunding": 0.0
},
"fullName": "string",
"futuresAccounts": [
{
"availableMargin": 0.0,
"name": "string"
}
],
"holdingAccounts": [
{
"amount": 0.0,
"currency": "string"
}
]
}
Name | Description | Type |
---|---|---|
accountUid optional |
The account UID | string |
email optional |
The email associated with the account | string |
flexAccount optional |
Multi-collateral account structure. | FlexAccountBalance |
fullName optional |
The name of the account | null or string |
futuresAccounts optional |
Structure containing structures with single-collateral accounts information for a specific futures account asset. | array of FutureAccountBalance |
holdingAccounts optional |
Structure containing structures with holding accounts information for a specific holding account asset. | array of HoldingAccountBalance |
TakerOrderData
TakerOrderData example
(Some parts of this example are auto-generated)
{
"fee": "1234.56789",
"positionSize": "1234.56789"
}
Name | Type | Example |
---|---|---|
fee optional |
string <big-decimal> | "1234.56789" |
positionSize optional |
string <big-decimal> | "1234.56789" |
TickerJson
TickerJson example
(Some parts of this example are auto-generated)
{
"last": 0.0,
"lastTime": "string",
"symbol": "string"
}
Response is one of the following:
Name | Description | Type |
---|---|---|
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 |
symbol optional |
The symbol of the index. | string |
Name | Description | Type |
---|---|---|
ask optional |
For Futures: The price of the current best ask For indices: Not returned because N/A |
null or number |
askSize optional |
For Futures: The size of the current best ask For indices: Not returned because N/A |
null or number |
bid optional |
For Futures: The price of the current best bid For indices: Not returned because N/A |
null or number |
bidSize optional |
For Futures: The size of the current best bid For indices: Not returned because N/A |
null or number |
fundingRate optional |
The current absolute funding rate. | null or number |
fundingRatePrediction optional |
The estimated next absolute funding rate. | null or number |
indexPrice optional |
null or number | |
last optional |
For Futures: The price of the last fill For indices: The last calculated value |
null or number |
lastSize optional |
For Futures: The size of the last fill For indices: Not returned because N/A |
null or number |
lastTime optional |
The date and time at which last was observed. | null or string |
markPrice optional |
For Futures: The price to which Kraken Futures currently marks the Futures for margining purposes 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 |
null or number |
openInterest optional |
For Futures: The current open interest of the instrument For indices: Not returned because N/A |
number |
pair optional |
For Futures: The currency pair of the instrument For indices: Not returned because N/A |
string |
postOnly optional |
bool | |
suspended optional |
True if the market is suspended, False otherwise. | bool |
symbol optional |
The symbol of the Futures. | string |
tag optional |
For Futures: Currently can be 'perpetual', 'month' or 'quarter'. Other tags may be added without notice For indices: Not returned because N/A |
null or string |
vol24h optional |
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 optional |
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 |
TrailingStopOptions
TrailingStopOptions example
(Some parts of this example are auto-generated)
{
"maxDeviation": 0.0,
"unit": "PERCENT"
}
Name | Description | Type |
---|---|---|
maxDeviation optional |
number | |
unit optional |
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" ) |
TrailingStopOptions
TrailingStopOptions example
(Some parts of this example are auto-generated)
{
"maxDeviation": "1234.56789",
"unit": "Percent"
}
Name | Type | Example |
---|---|---|
maxDeviation optional |
string <big-decimal> | "1234.56789" |
unit optional |
string (enum: "Percent" , "QuoteCurrency" ) |
Trigger
Trigger example
(Some parts of this example are auto-generated)
{
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
Name | Type | Example |
---|---|---|
accountId optional |
number <uint64> | |
accountUid optional |
string <uuid> | |
clientId optional |
string | |
direction optional |
string (enum: "Buy" , "Sell" ) |
|
lastUpdateTimestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
limitPrice optional |
string <big-decimal> | "1234.56789" |
orderType optional |
string | |
quantity optional |
string <big-decimal> | "1234.56789" |
reduceOnly optional |
bool | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
tradeable optional |
string | |
triggerOptions optional |
TriggerOptions | |
uid optional |
string <uuid> |
TriggerActivated
TriggerActivated example
(Some parts of this example are auto-generated)
{
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
}
}
Name | Type |
---|---|
order optional |
Trigger |
TriggerCancelled
TriggerCancelled example
(Some parts of this example are auto-generated)
{
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Name | Type |
---|---|
order optional |
Trigger |
reason optional |
string |
TriggerEditRejected
TriggerEditRejected example
(Some parts of this example are auto-generated)
{
"attemptedOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"orderError": "string",
"reason": "string"
}
Name | Type |
---|---|
attemptedOrderTrigger optional |
Trigger |
oldOrderTrigger optional |
Trigger |
orderError optional |
string |
reason optional |
string |
TriggerElement
TriggerElement example
(Some parts of this example are auto-generated)
{
"event": {
"OrderTriggerPlaced": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
},
"timestamp": 1604937694000,
"uid": "string"
}
Name | Type | Example |
---|---|---|
event optional |
TriggerEvent | |
timestamp optional |
integer <timestamp-milliseconds> | 1604937694000 |
uid optional |
string |
TriggerEvent
TriggerEvent example
(Some parts of this example are auto-generated)
{
"OrderTriggerPlaced": {
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
}
Response is one of the following:
Name | Type |
---|---|
OrderTriggerPlaced optional |
TriggerPlaced |
Name | Type |
---|---|
OrderTriggerCancelled optional |
TriggerCancelled |
Name | Type |
---|---|
OrderTriggerUpdated optional |
TriggerUpdated |
Name | Type |
---|---|
OrderTriggerActivated optional |
TriggerActivated |
Name | Type |
---|---|
OrderTriggerEditRejected optional |
TriggerEditRejected |
TriggerOptions
TriggerOptions example
(Some parts of this example are auto-generated)
{
"trailingStopOptions": {
"maxDeviation": 0.0,
"unit": "PERCENT"
},
"triggerPrice": 0.0,
"triggerSide": "TRIGGER_ABOVE",
"triggerSignal": "MARK_PRICE"
}
Name | Type |
---|---|
trailingStopOptions optional |
TrailingStopOptions |
triggerPrice optional |
number |
triggerSide optional |
string (enum: "TRIGGER_ABOVE" , "TRIGGER_BELOW" ) |
triggerSignal optional |
string (enum: "MARK_PRICE" , "LAST_PRICE" , "SPOT_PRICE" ) |
TriggerOptions
TriggerOptions example
(Some parts of this example are auto-generated)
{
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
}
Name | Type | Example |
---|---|---|
trailingStopOptions optional |
TrailingStopOptions | |
triggerPrice optional |
string <big-decimal> | "1234.56789" |
triggerSide optional |
string | |
triggerSignal optional |
string |
TriggerPlaced
TriggerPlaced example
(Some parts of this example are auto-generated)
{
"order": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Name | Type |
---|---|
order optional |
Trigger |
reason optional |
string |
TriggerUpdated
TriggerUpdated example
(Some parts of this example are auto-generated)
{
"newOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"oldOrderTrigger": {
"accountId": 0.0,
"accountUid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45",
"clientId": "string",
"direction": "Buy",
"lastUpdateTimestamp": 1604937694000,
"limitPrice": "1234.56789",
"orderType": "string",
"quantity": "1234.56789",
"reduceOnly": false,
"timestamp": 1604937694000,
"tradeable": "string",
"triggerOptions": {
"trailingStopOptions": {
"maxDeviation": "1234.56789",
"unit": "Percent"
},
"triggerPrice": "1234.56789",
"triggerSide": "string",
"triggerSignal": "string"
},
"uid": "2ceb1d31-f619-457b-870c-fd4ddbb10d45"
},
"reason": "string"
}
Name | Type |
---|---|
newOrderTrigger optional |
Trigger |
oldOrderTrigger optional |
Trigger |
reason optional |
string |
UnwindQueueJson
UnwindQueueJson example
(Some parts of this example are auto-generated)
{
"percentile": 0.0,
"symbol": "string"
}
Name | 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 |
WebSocket API
WebSocket API Introduction
Sign challenge
The subscribe and unsubscribe requests to WebSocket private feeds require a signed challenge message with the user api_secret
.
The challenge is obtained as is shown in Section WebSocket API Public (using the api_key
).
Authenticated requests must include both the original challenge message (original_challenge
) and the signed (signed_challenge
) in JSON format.
Challenge
Challenge example
c100b894-1729-464d-ace1-52dbce11db42
The challenge is a UUID string.
The steps to sign the challenge are the same as the steps to generate an authenticated HTTP request except for step 1 which now is just the challenge
string:
- Hash the challenge with the SHA-256 algorithm
- Base64-decode your
api_secret
- Use the result of step 2 to hash the result of step 1 with the HMAC-SHA-512 algorithm
- Base64-encode the result of step 3
The result of the step 4 is the signed challenge which will be included in the subscribe request.
The table below shows the expected output from example inputs:
Name | Value |
---|---|
challenge |
c100b894-1729-464d-ace1-52dbce11db42 |
api_secret |
7zxMEF5p/Z8l2p2U7Ghv6x14Af+Fx+92tPgUdVQ748FOIrEoT9bgT+bTRfXc5pz8na+hL/QdrCVG7bh9KpT0eMTm |
signed output | 4JEpF3ix66GA2B+ooK128Ift4XQVtc137N9yeg4Kqsn9PI0Kpzbysl9M1IeCEdjg0zl00wkVqcsnG4bmnlMb3A== |
Subscriptions
Subscriptions requests are sent through a web socket connection.
To subscribe to a feed, a web socket connection is required to establish a connection using the following URL:
wss://futures.kraken.com/ws/v1
Keeping the connection alive
In order to keep the websocket connection alive, you will need to make a ping request at least every 60 seconds. You can see this in our sample implementation.
Snapshots and updates
For ease of use, most web socket feeds first send a snapshot of the history or current state and subsequently send real-time updates.
Authentication
In order to subscription to a private feed, clients must pass a challenge which involves signing a message (see Section Sign Challenge) with the private API key. First, a message must be sent to request the challenge. Second, the solved challenge has to be passed in every subscribe and unsubscribe message that is sent.
Limits
There are limits to both the number of connections a client can have open concurrently and the number of requests an individual connection can make. Limit values are subject to change and additional limits may be added in the future.
The current limits are:
Resource | Allowance | Replenish Period |
---|---|---|
Connections | 100 | N/A |
Requests | 100 | 1 second |
Public Feeds
Ticker
The ticker feed returns ticker information about listed products. Only tradeable markets are available via individual WebSocket market data feeds. Delta messages are throttled such that they are published every 1s.
Authentication is not required.
Feed | Event Type | Permissible API Keys |
---|---|---|
ticker |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "ticker",
"product_ids": [
"PI_XBTUSD"
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed",
"feed": "ticker",
"product_ids": [
"PI_XBTUSD"
]
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
product_ids |
list of strings | A list of strings which represent the products that user will receive information upon |
The subscription data will return values for all fields even if the value of only a single field has changed since the last payload.
Sample Subscription Data
{
"time":1676393235406,
"product_id": "PI_XBTUSD",
"funding_rate": -6.2604214e-11,
"funding_rate_prediction": -3.65989977e-10,
"relative_funding_rate": -1.380384722222e-6,
"relative_funding_rate_prediction": -8.047629166667e-6,
"next_funding_rate_time": 1676394000000,
"feed": "ticker",
"bid": 21978.5,
"ask": 21987.0,
"bid_size": 2536.0,
"ask_size": 13948.0,
"volume": 31403908.0,
"dtm": 0,
"leverage": "50x",
"index": 21984.54,
"premium": -0.0,
"last": 21983.5,
"change": 1.9974017538161748,
"suspended": false,
"tag": "perpetual",
"pair": "XBT:USD",
"openInterest": 30072580.0,
"markPrice": 21979.68641534714,
"maturityTime": 0,
"post_only": false,
"volumeQuote": 31403908.0
}
Field | Type | Description |
---|---|---|
time |
positive integer | The UTC time of the server in milliseconds |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
funding_rate (Perpetuals only) |
float | The current funding rate. If zero, field is not populated. |
funding_rate_prediction (Perpetuals only) |
float | The estimated next funding rate. If zero, field is not populated. |
relative_funding_rate (Perpetuals only) |
float | The absolute funding rate relative to the spot price at the time of funding rate calculation. If zero, field is not populated. |
relative_funding_rate_prediction (Perpetuals only) |
float | The estimated next absolute funding rate relative to the current spot price. If zero, field is not populated. |
next_funding_rate_time (Perpetuals only) |
float | The time until next funding rate in milliseconds. |
feed |
string | The subscribed feed |
bid |
positive float | The price of the current best bid |
ask |
positive float | The price of the current best ask |
bid_size |
positive float | The size of the current best bid |
ask_size |
positive float | The size of the current best ask |
volume |
positive float | The sum of the sizes of all fills observed in the last 24 hours |
dtm |
positive integer | The days until maturity |
leverage |
string | The leverage of the product |
index |
positive float | The real time index of the product |
premium |
float | The premium associated with the product |
last |
positive float | The price of the last trade of the product |
change |
float | The 24h change in price |
suspended |
string | True if the market is suspended, false otherwise |
tag |
string | Currently can be perpetual , month or quarter . Other tags may be added without notice. |
pair |
string | The currency pair of the instrument |
openInterest |
float | The current open interest of the instrument |
markPrice |
float | The market price of the instrument |
maturityTime |
positive integer | The UTC time, in milliseconds, at which the contract will stop trading |
post_only |
string | True if the market is in post-only, false otherwise |
volumeQuote |
positive float | The same as volume except that, for multi-collateral futures, it is converted to the non-base currency |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid product id Invalid feed Json Error |
Trade
The trade feed returns information about executed trades
Authentication is not required.
Feed | Event Type | Permissible API Keys |
---|---|---|
trade |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "trade",
"product_ids": [
"PI_XBTUSD",
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed ",
"feed": "trade",
"product_ids": [
"PI_XBTUSD"
]
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
product_ids |
list of strings | A list of strings which represent the products that user will receive information upon |
Sample Subscription Snapshot Data
{
"feed": "trade_snapshot",
"product_id": "PI_XBTUSD",
"trades": [
{
"feed": "trade",
"product_id": "PI_XBTUSD",
"uid": "caa9c653-420b-4c24-a9f1-462a054d86f1",
"side": "sell",
"type": "fill",
"seq": 655508,
"time": 1612269657781,
"qty": 440,
"price": 34893
},
{
"feed": "trade",
"product_id": "PI_XBTUSD",
"uid": "45ee9737-1877-4682-bc68-e4ef818ef88a",
"side": "sell",
"type": "fill",
"seq": 655507,
"time": 1612269656839,
"qty": 9643,
"price": 34891
}
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed snapshot feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
uid |
string | Unique identifier for the matched trade |
side |
string | The classification of the taker side in the matched trade: buy if the taker is a buyer, sell if the taker is a seller. |
type |
string | The classification of the matched trade in an orderbook: fill if it is a normal buyer and seller, liquidation if it is a result of a user being liquidated from their position, termination if it is a result of a user being terminated, or block if it is a component of a block trade. |
seq |
positive integer | The subscription message sequence number |
time |
positive integer | The UTC or GMT time of the trade in milliseconds |
qty |
positive float | The quantity of the traded product |
price |
positive float | The price that the product got traded |
Sample Subscription Delta Data
{
"feed": "trade",
"product_id": "PI_XBTUSD",
"uid": "05af78ac-a774-478c-a50c-8b9c234e071e",
"side": "sell",
"type": "fill",
"seq": 653355,
"time": 1612266317519,
"qty": 15000,
"price": 34969.5
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
side |
string | The classification of the taker side in the matched trade: buy if the taker is a buyer, sell if the taker is a seller. |
type |
string | The classification of the matched trade in an orderbook: fill if it is a normal buyer and seller, liquidation if it is a result of a user being liquidated from their position, termination if it is a result of a user being terminated, or block if it is a component of a block trade. |
seq |
positive integer | The subscription message sequence number |
time |
positive integer | The UTC or GMT time of the trade in milliseconds |
qty |
positive float | The quantity of the traded product |
price |
positive float | The price that the product got traded |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event | string | Always error |
message | string | An error message out of:Invalid product id Invalid feed Json Error |
Heartbeat
The heartbeat feed publishes a heartbeat message at timed intervals.
Authentication is not required.
Feed | Event Type | Permissible API Keys |
---|---|---|
heartbeat |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "heartbeat"
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "heartbeat"
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
Sample Subscription Data
{
"feed": "heartbeat",
"time": 1534262350627
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
time |
positive integer | The UTC time of the server in milliseconds |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Json Error"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feed Json Error |
Ticker Lite
The ticker lite feed returns ticker information about listed products. Delta messages are throttled such that they are published every 1s.
Authentication is not required.
Feed | Event Type | Permissible API Keys |
---|---|---|
ticker_lite |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "ticker_lite",
"product_ids": [
"PI_XBTUSD",
"FI_ETHUSD_210625"
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed ",
"feed": "ticker_lite",
"product_ids": [
"PI_XBTUSD"
]
}
{
"event": "subscribed",
"feed": "ticker_lite",
"product_ids": [
"FI_ETHUSD_210625"
]
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
product_ids |
list of strings | A list of strings which represent the products that user will receive information upon |
Sample Subscription Data
{
"feed": "ticker_lite",
"product_id": "PI_XBTUSD",
"bid": 34932,
"ask": 34949.5,
"change": 3.3705205220015966,
"premium": 0.1,
"volume": 264126741,
"tag": "perpetual",
"pair": "XBT:USD",
"dtm": 0,
"maturityTime": 0,
"volumeQuote": 264126741
}
{
"feed": "ticker_lite",
"product_id": "FI_ETHUSD_210625",
"bid": 1753.45,
"ask": 1760.35,
"change": 13.448175559936647,
"premium": 9.1,
"volume": 6899673.0,
"tag": "semiannual",
"pair": "ETH:USD",
"dtm": 141,
"maturityTime": 1624633200000,
"volumeQuote": 6899673.0
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
bid |
positive float | The price of the current best bid |
ask |
positive float | The price of the current best ask |
change |
float | The 24h change in price |
premium |
float | The premium associated with the product |
volume |
positive float | The sum of the sizes of all fills observed in the last 24 hours |
tag |
string | Currently can be week , month or quarter . Other tags may be added without notice. |
pair |
string | The currency pair of the instrument |
dtm |
integer | The days until maturity |
maturityTime |
positive integer | Maturity time in milliseconds |
volumeQuote |
positive float | The same as volume except that, for multi-collateral futures, it is converted to the non-base currency |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event | string | Always error |
message | string | An error message out of:Invalid product id Invalid feed Json Error |
Challenge
This request returns a challenge to be used in handshake for user authentication.
Authentication is not required.
Event Type | Permissible API Keys |
---|---|
challenge | Read-only, Read-write, Master |
Sample Sent Message
{
"event": "challenge",
"api_key": "CMl2SeSn09Tz+2tWuzPfdaJdsahq6qv5UaexXuQ3SnahDQU/gO3aT+"
}
Field | Type | Description |
---|---|---|
event |
string | The request event type |
api_key |
string | The user API key. |
Sample Return if Successful
{
"event": "challenge",
"message": "226aee50-88fc-4618-a42a-34f7709570b2"
}
Field | Type | Description |
---|---|---|
event |
string | Always challenge |
message |
string | The message that user will have to sign for authentication reasons |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Json Error"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | Json Error |
Book
This feed returns information about the order book.
Authentication is not required.
Feed | Event Type | Permissible API Keys |
---|---|---|
book |
subscribe / unsubscribe |
N/A |
Sample Sent Message
{
"event": "subscribe",
"feed": "book",
"product_ids": [
"PI_XBTUSD",
]
}
Sample Return if Successful. (A result message is received per product id)
{
"event": "subscribed",
"feed": "book",
"product_ids": [
"PI_XBTUSD"
]
}
Field | Type | Description |
---|---|---|
event | string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed | string | The requested subscription feed |
product_ids | list of strings | A list of strings which represent the products that user will receive information upon |
Sample Subscription Snapshot Data
{
"feed": "book_snapshot",
"product_id": "PI_XBTUSD",
"timestamp": 1612269825817,
"seq": 326072249,
"tickSize": null,
"bids": [
{
"price": 34892.5,
"qty": 6385
},
{
"price": 34892,
"qty": 10924
},
],
"asks": [
{
"price": 34911.5,
"qty": 20598
},
{
"price": 34912,
"qty": 2300
},
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed snapshot feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
timestamp |
positive integer | Timestamp in milliseconds |
seq |
positive integer | The subscription message sequence number |
tickSize |
string | Always null |
bids |
list of structures | A list containing buy / bid order structures |
asks |
list of structures | A list containing sell / ask order structures |
Sample Subscription Delta Data
{
"feed": "book",
"product_id": "PI_XBTUSD",
"side": "sell",
"seq": 326094134,
"price": 34981,
"qty": 0,
"timestamp": 1612269953629
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
product_id |
string | The subscribed product (referred also as instrument or symbol) |
side |
string | The order side, either buy or sell |
seq |
positive integer | The subscription message sequence number |
price |
positive float | The price of the order |
qty |
non-negative float | The updated total quantity of the orders at the price level. Value is set to 0 if all orders at this price level have been cancelled |
timestamp |
positive integer | Timestamp in milliseconds |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event | string | Always error |
message | string | An error message out of:Invalid feed Json Error |
Private Feeds
Open Orders (Verbose)
This subscription feed publishes information about user open orders. This feed adds extra information about all the post-only orders that failed to cross the book.
Authentication is required.
Feed | Event Type | API Keys | Original & Signed Challenge |
---|---|---|---|
open_orders_verbose |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "open_orders_verbose",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "open_orders_verbose",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "open_orders_verbose_snapshot",
"account": "0f9c23b8-63e2-40e4-9592-6d5aa57c12ba",
"orders": [
{
"instrument": "PI_XBTUSD",
"time": 1567428848005,
"last_update_time": 1567428848005,
"qty": 100.0,
"filled": 0.0,
"limit_price": 8500.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "566942c8-a3b5-4184-a451-622b09493129",
"direction": 0,
"reduce_only": false
},
{
"instrument": "PI_XBTUSD",
"time": 1567428874347,
"last_update_time": 1567428874347,
"qty": 1501.0,
"filled": 0.0,
"limit_price": 7200.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "fcbb1459-6ed2-4b3c-a58c-67c4df7412cf",
"direction": 0,
"reduce_only": false
},
{
"instrument": "PI_XBTUSD",
"time": 1567515137945,
"last_update_time": 1567515137945,
"qty": 102.0,
"filled": 0.0,
"limit_price": 8500.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "3deea5c8-0274-4d33-988c-9e5a3895ccf8",
"direction": 0,
"reduce_only": false
}
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account |
orders |
list of structures | A list containing the user open orders |
instrument |
string | The instrument (referred also as symbol or product_id) of the order |
time |
positive integer | The UTC time in milliseconds |
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated |
qty |
positive float | The remaining quantity of the order |
filled |
positive float | The amount of the order that has been filled |
limit_price |
positive float | The limit price of the order |
stop_price |
positive float | The stop price of the order |
type |
string | The order type, limit or stop |
order_id |
UUID | The order id |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
reduce_only |
boolean | If true, the order can only reduce open positions, it cannot increase or open new positions |
triggerSignal |
string | Trigger signal selected for take profit or stop loss order. Options are last , mark , or spot . Returned only for take profit or stop loss orders |
Sample Subscription Delta Data
{
"feed": "open_orders_verbose",
"order": {
"instrument": "PI_XBTUSD",
"time": 1567597581495,
"last_update_time": 1567597581495,
"qty": 102.0,
"filled": 0.0,
"limit_price": 10601.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "fa9806c9-cba9-4661-9f31-8c5fd045a95d",
"direction": 0,
"reduce_only": false
},
"is_cancel": true,
"reason": "post_order_failed_because_it_would_be_filled"
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
order |
structure | The user new order |
instrument |
string | The instrument (referred also as symbol or product_id) of the order |
time |
positive integer | The UTC time in milliseconds |
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated |
qty |
positive float | The quantity or the order |
filled |
positive float | The amount of the order that is filled |
limit_price |
positive float | The limit price of the order |
stop_price |
positive float | The stop price of the order |
type |
string | The order type, limit , take_profit , or stop |
order_id |
UUID | The order id |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
reduce_only |
boolean | If true, the order can only reduce open positions, it cannot increase or open new positions |
triggerSignal |
string | Trigger signal selected for take profit or stop loss order. Options are last , mark , or spot . Returned only for take profit or stop loss orders |
is_cancel |
boolean | If false the open order has been either placed or partially filled and needs to be updated. If true the open order was either fully filled, cancelled or rejected (for post-only). If it was filled or cancelled it must be removed from open orders snapshot. |
reason |
string | Reason behind the received delta.new_placed_order_by_user : User placed a new orderliquidation : User position liquidated. The order cancelledstop_order_triggered : A stop order triggered. The system removed the stop orderlimit_order_from_stop : The system created a limit order because an existing stop order triggeredpartial_fill : The order filled partiallyfull_fill : The order filled fully and removedcancelled_by_user : The order cancelled by the user and removedcontract_expired : The order contract expired. All open orders of that contract removednot_enough_margin : The order removed due to insufficient marginmarket_inactive : The order removed because market became inactivecancelled_by_admin : The order removed by administrator's actiondead_man_switch : The order removed because dead man's switch was triggeredioc_order_failed_because_it_would_not_be_executed : The immediate or cancel order was rejected due to insufficient liquiditypost_order_failed_because_it_would_filled : The post only order was rejected as it crosses the spread and would be immediately filledwould_execute_self : The order was rejected as it would execute against another order from the same accountwould_not_reduce_position : The order was rejected as it the reduce-only option was selected and it would not reduce the positionorder_for_edit_not_found : The order edit was rejected as the order to be edited could not be found |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feed Json Error |
Open Positions
This subscription feed publishes the open positions of the user account.
Authentication is required.
Feed | Event Type | API Keys | Original & Signed Challenge |
---|---|---|---|
open_positions |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "open_positions",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "open_positions",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed . |
feed |
string | The requested subscription feed. |
api_key |
string | The user api key. |
original_challenge |
string | The message that is received from a challenge request. |
signed_challenge |
string | The signed challenge message with user api secret. |
Sample Subscription Data
{
"feed": "open_positions",
"account": "DemoUser",
"positions": [
{
"instrument": "fi_xbtusd_180316",
"balance": 2000.0,
"entry_price": 11675.86541981,
"mark_price": 11090.0,
"index_price": 12290.550000000001,
"pnl": -0.00905299
} …,
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed. |
account |
string | The user account. |
positions |
list of structures | A list containing the user open positions. |
instrument |
string | The instrument (referred also as symbol or product_id) of the position. |
balance |
float | The size of the position. |
entry_price |
positive float | The average entry price of the instrument. |
mark_price |
positive float | The market price of the position instrument. |
index_price |
positive float | The index price of the position instrument. |
pnl |
float | The profit and loss of the position. |
liquidation_threshold |
float | The mark price of the contract at which the position will be liquidated. |
return_on_equity |
float | The percentage gain or loss relative to the initial margin used in the position. Formula: PnL/IM |
effective_leverage |
float | How leveraged the net position is in a given margin account. Formula: Position Value at Market / Portfolio Value. |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid product id Invalid feed Json Error |
Account Log
This subscription feed publishes account information.
Authentication is required.
Feed | Event Type | API Keys | Original & Signed Challenge |
---|---|---|---|
account_log |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "account_log",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful.
{
"event": "subscribed",
"feed": "account_log",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "account_log_snapshot",
"logs": [
{
"id": 1690,
"date": "2019-07-11T08:00:00.000Z",
"asset": "bch",
"info": "funding rate change",
"booking_uid": "86fdc252-1b6e-40ec-ac1d-c7bd46ddeebf",
"margin_account": "f-bch:usd",
"old_balance": 0.01215667051,
"new_balance": 0.01215736653,
"old_average_entry_price": 0.0,
"new_average_entry_price": 0.0,
"trade_price": 0.0,
"mark_price": 0.0,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "",
"collateral": "bch",
"funding_rate": -8.7002552653e-08,
"realized_funding": 6.9602e-07,
"conversion_spread_percentage": 0.0
},
{
"id": 1689,
"date": "2019-07-11T04:00:00.000Z",
"asset": "bch",
"info": "funding rate change",
"booking_uid": "680d3973-5774-4a9d-b807-ab8aa73f95c3",
"margin_account": "f-bch:usd",
"old_balance": 0.01215715298,
"new_balance": 0.01215667051,
"old_average_entry_price": 0.0,
"new_average_entry_price": 0.0,
"trade_price": 0.0,
"mark_price": 0.0,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "",
"collateral": "bch",
"funding_rate": 6.0309345058e-08,
"realized_funding": -4.8247e-07,
"conversion_spread_percentage": 0.0
},
{
"id": 1688,
"date": "2019-07-11T00:00:00.000Z",
"asset": "bch",
"info": "funding rate change",
"booking_uid": "72e3396e-8fc4-4bd9-9379-8e2b2225af85",
"margin_account": "f-bch:usd",
"old_balance": 0.01215847263,
"new_balance": 0.01215715298,
"old_average_entry_price": 0.0,
"new_average_entry_price": 0.0,
"trade_price": 0.0,
"mark_price": 0.0,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "",
"collateral": "bch",
"funding_rate": 1.64955714332e-07,
"realized_funding": -1.31965e-06,
"conversion_spread_percentage": 0.0
}
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
logs |
list of structures | A list containing the account logs |
id |
positive integer | The identifier of the log |
date |
ISO8601 datetime | The creation time of the log according to server date and time |
asset |
string | The asset related of the booking |
info |
string | A description of the booking |
booking_uid |
string | The unique id of the booking |
margin_account |
string | The account name |
old_balance |
float | The account balance before the described in info action |
new_balance |
float | The portfolio value calculated as balance plus unrealized pnl value |
old_average_entry_price |
positive float | The average entry price of the position prior to this trade |
new_average_entry_price |
positive float | The average entry price of the position after this trade |
trade_price |
positive float | The price the trade was executed at |
mark_price |
positive float | The mark price at the time the trade was executed |
realized_pnl |
float | The pnl that is realized by reducing the position |
fee |
float | The fee paid |
execution |
string | The uid of the associated execution |
collateral |
string | The currency of the associated entry |
funding_rate |
float | The absolute funding rate |
realized_funding |
float | The funding rate realized due to change in position size or end of funding rate period |
conversion_spread_percentage |
float | The percentage conversion spread used in a currency conversion |
Sample Subscription Delta Data
{
"feed": "account_log",
"new_entry": {
"id": 1697,
"date": "2019-07-11T13: 00: 27.632Z",
"asset": "pi_bchusd",
"info": "futures trade",
"booking_uid": "55a02b5b-2c90-4d43-b0eb-eb3801d50e3f",
"margin_account": "f-bch:usd",
"old_balance": 1.0,
"new_balance": 2.0,
"old_average_entry_price": 413.3,
"new_average_entry_price": 374.3445326979084,
"trade_price": 342.1,
"mark_price": 342.4,
"realized_pnl": 0.0,
"fee": 0.0,
"execution": "fc49fea9-8827-4a2e-8e36-c047523ddc30",
"collateral": "bch"
}
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
logs |
list of structures | A list containing the account logs |
id |
positive integer | The identifier of the log |
date |
ISO8601 datetime | The creation time of the log according to server date and time |
asset |
string | The asset related of the booking |
info |
string | A description of the booking |
booking_uid |
string | The unique id of the booking |
margin_account |
string | The account name |
old_balance |
float | The account balance before the described in info action |
new_balance |
float | The portfolio value calculated as balance plus unrealized pnl value |
old_average_entry_price |
positive float | The average entry price of the position prior to this trade |
new_average_entry_price |
positive float | The average entry price of the position after this trade |
trade_price |
positive float | The price the trade was executed at |
mark_price |
positive float | The mark price at the time the trade was executed |
realized_pnl |
float | The pnl that is realized by reducing the position |
fee |
float | The fee paid |
execution |
string | The uid of the associated execution |
collateral |
string | The currency of the associated entry |
funding_rate |
float | The absolute funding rate |
realized_funding |
float | The funding rate realized due to change in position size or end of funding rate period |
conversion_spread_percentage |
float | The percentage conversion spread used in a currency conversion |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feed Json Error |
Fills
This subscription feed publishes fills information.
Authentication is required.
Feed | Event Type | API Keys | Original & Signed Challenge |
---|---|---|---|
fills |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "fills",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful
{
"event": "subscribed",
"feed": "fills",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed . |
feed |
string | The requested subscription feed. |
api_key |
string | The user api key. |
original_challenge |
string | The message that is received from a challenge request. |
signed_challenge |
string | The signed challenge message with user api secret. |
Sample Subscription Snapshot Data
{
"feed": "fills_snapshot",
"account": "DemoUser",
"fills": [
{
"instrument": "FI_XBTUSD_200925",
"time": 1600256910739,
"price": 10937.5,
"seq": 36,
"buy": true,
"qty": 5000.0,
"order_id": "9e30258b-5a98-4002-968a-5b0e149bcfbf",
"fill_id": "cad76f07-814e-4dc6-8478-7867407b6bff",
"fill_type": "maker",
"fee_paid": -0.00009142857,
"fee_currency": "BTC",
"taker_order_type": "ioc",
"order_type": "limit"
},
{
"instrument": "PI_ETHUSD",
"time": 1600256945531,
"price": 364.65,
"seq": 39,
"buy": true,
"qty": 5000.0,
"order_id": "7e60b6e8-e4c2-4ce8-bbd0-ef81e18b65bb",
"fill_id": "b1aa44b2-4f2a-4031-999c-ae1175c91580",
"fill_type": "taker",
"fee_paid": 0.00685588921,
"fee_currency": "ETH",
"taker_order_type": "market",
"order_type": "limit"
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed. |
account |
string | The user account. |
fills |
list of structures | A list containing fill elements of the user account. |
instrument |
string | The fill instrument (referred also as symbol or product_id). |
time |
positive integer | The server UTC date and time in milliseconds. |
price |
positive float | The price at which the order was filled. |
seq |
positive integer | The subscription message sequence number. |
buy |
boolean | A flag that shows if filled order was a buy. |
qty |
positive float | The quantity that was filled. |
order_id |
UUID | The order id that was filled. |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id. |
fill_id |
UUID | The fill id. |
fill_type |
string | The classification of the fill:maker if the user has a limit order that gets filled,taker if the user makes an execution that crosses the spread,liquidation if an execution is the result of a liquidation,assignee if an execution is a result of a counterparty receiving an Assignment in PAS,assignor if an execution is a result of the user assigning their position due to a failed liquidation,unwindBankrupt any portion of a liquidated position cannot be filled or assigned, the remaining contracts are unwound.unwindCounterparty any portion of your counterparty's position is liquidated and cannot be filled or assigned the remaining contracts are unwound. More information on our Equity Protection Process.takerAfterEdit if the user edits the order and it is instantly executed. |
fee_paid |
positive float | Fee paid on fill |
fee_currency |
string | Currency in which the fee was charged. See "Currencies" on Ticker Symbols |
taker_order_type |
string | The order type of the taker execution side. |
order_type |
string | The order type. |
Sample Subscription Delta Data
{
"feed": "fills",
"username": "DemoUser",
"fills": [
{
"instrument": "PI_XBTUSD",
"time": 1600256966528,
"price": 364.65,
"seq": 100,
"buy": true,
"qty": 5000.0,
"order_id": "3696d19b-3226-46bd-993d-a9a7aacc8fbc",
"cli_ord_id": "8b58d9da-fcaf-4f60-91bc-9973a3eba48d",
"fill_id": "c14ee7cb-ae25-4601-853a-d0205e576099",
"fill_type": "taker",
"fee_paid": 0.00685588921,
"fee_currency": "ETH",
"taker_order_type": "liquidation",
"order_type": "limit"
} …,
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed. |
username |
string | The user name. |
fills |
list of structures | A list containing fill elements of the user account. |
instrument |
string | The fill instrument (referred also as symbol or product_id). |
time |
positive | The server UTC date and time in milliseconds. |
price |
positive float | The price at which the order was filled. |
seq |
positive integer | The subscription message sequence number. |
buy |
boolean | A flag that shows if filled order was a buy. |
qty |
positive float | The quantity that was filled. |
order_id |
UUID | The order id that was filled. |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id. |
fill_id |
UUID | The fill id. |
fill_type |
string | The classification of the fill:maker if the user has a limit order that gets filled,taker if the user makes an execution that crosses the spread,liquidation if an execution is the result of a liquidation,assignee if an execution is a result of a counterparty receiving an Assignment in PAS,assignor if an execution is a result of the user assigning their position due to a failed liquidation,takerAfterEdit if the user edits the order and it is instantly executed. |
fee_paid |
positive float | Fee paid on fill |
fee_currency |
string | Currency in which the fee was charged. See "Currencies" on Ticker Symbols |
taker_order_type |
string | The order type of the taker execution side. |
order_type |
string | The order type |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feed Json Error |
Open Orders
This subscription feed publishes information about user open orders.
Authentication is required.
Feed | Event Type | API Keys | Original & Signed Challenge |
---|---|---|---|
open_orders |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "open_orders",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful
{
"event": "subscribed",
"feed": "open_orders",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "open_orders_snapshot",
"account": "e258dba9-4dd4-4da5-bfef-75beb91c098e",
"orders": [
{
"instrument": "PI_XBTUSD",
"time": 1612275024153,
"last_update_time": 1612275024153,
"qty": 1000,
"filled": 0,
"limit_price": 34900,
"stop_price": 13789,
"type": "stop",
"order_id": "723ba95f-13b7-418b-8fcf-ab7ba6620555",
"direction": 1,
"reduce_only": false,
"triggerSignal": "last"
},
{
"instrument": "PI_XBTUSD",
"time": 1612275209430,
"last_update_time": 1612275209430,
"qty": 1000,
"filled": 0,
"limit_price": 35058,
"stop_price": 0,
"type": "limit",
"order_id": "7a2f793e-26f3-4987-a938-56d296a11560",
"direction": 1,
"reduce_only": false
}
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account |
orders |
list of structures | A list containing the user open orders |
instrument |
string | The instrument (referred also as symbol or product_id) of the order |
time |
positive integer | The UTC time in milliseconds |
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated |
qty |
positive float | The remaining quantity of the order |
filled |
positive float | The amount of the order that has been filled |
limit_price |
positive float | The limit price of the order |
stop_price |
positive float | The stop price of the order |
type |
string | The order type, limit, stop, or take_profit |
order_id |
UUID | The order id |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
reduce_only |
boolean | If true, the order can only reduce open positions, it cannot increase or open new positions |
triggerSignal |
string | Trigger signal selected for take profit or stop loss order. Options are last , mark , or spot . Returned only for take profit or stop loss orders |
Sample Subscription Delta Data
{
"feed": "open_orders",
"order": {
"instrument": "PI_XBTUSD",
"time": 1567702877410,
"last_update_time": 1567702877410,
"qty": 304.0,
"filled": 0.0,
"limit_price": 10640.0,
"stop_price": 0.0,
"type": "limit",
"order_id": "59302619-41d2-4f0b-941f-7e7914760ad3",
"direction": 1,
"reduce_only": true
},
"is_cancel": false,
"reason": "new_placed_order_by_user"
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
order |
structure | The user new order |
instrument |
string | The instrument (referred also as symbol or product_id) of the order |
time |
positive integer | The UTC time in milliseconds |
last_update_time |
positive integer | The UTC time in milliseconds that the order was last updated |
qty |
positive float | The quantity or the order |
filled |
positive float | The amount of the order that is filled |
limit_price |
positive float | The limit price of the order |
stop_price |
positive float | The stop price of the order |
type |
string | The order type, limit or stop |
order_id |
UUID | The order id |
cli_ord_id |
UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction |
integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
reduce_only |
boolean | If true, the order can only reduce open positions, it cannot increase or open new positions |
triggerSignal |
string | Trigger signal selected for take profit or stop loss order. Options are last , mark , or spot . Returned only for take profit or stop loss orders |
is_cancel |
boolean | If false the open order has been either placed or partially filled and needs to be updated. If true the open order was either fully filled or cancelled and must be removed from open orders snapshot |
reason |
string | Reason behind the received delta.new_placed_order_by_user : User placed a new orderliquidation : User position liquidated. The order cancelledstop_order_triggered : A stop order triggered. The system removed the stop orderlimit_order_from_stop : The system created a limit order because an existing stop order triggeredpartial_fill : The order filled partiallyfull_fill : The order filled fully and removedcancelled_by_user : The order cancelled by the user and removedcontract_expired : The order contract expired. All open orders of that contract removednot_enough_margin : The order removed due to insufficient marginmarket_inactive : The order removed because market became inactivecancelled_by_admin : The order removed by administrator's action |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feed Json Error |
Balances
This feed returns balance information for holding wallets, single collateral wallets and multi-collateral wallets.
Authentication is required.
Feed | Event Type | API Keys | Original & Signed Challenge |
---|---|---|---|
balances |
subscribe / unsubscribe |
Any | Yes |
Subscription request
Sample sent message
{
"event": "subscribe",
"feed": "balances",
"api_key": "drUfSSmBbDpcIpwpqK0OBTcGLdAYZJU+NlPIsHaKspu/8feT2YSKl+Jw",
"original_challenge": "c094497e-9b5f-40da-a122-3751c39b107f",
"signed_challenge": "Ds0wtsHaXlAby/Vnoil59Q+yJIrJwZGUlgECD3+qEvFcTFfacJi2LrSRzAoqwBAeZk4pGXSmyyIW0uDymZ3olw=="
}
Sample return if successful
{
"event": "subscribed",
"feed": "balances",
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Balances Snapshot Data
Sample Subscription Snapshot Data
{
"feed": "balances_snapshot",
"account": "4a012c31-df95-484a-9473-d51e4a0c4ae7",
"holding": {
"USDT": 4997.5012493753,
"XBT": 0.1285407184,
"ETH": 1.8714395862,
"LTC": 47.6462740614,
"GBP": 3733.488646461,
"USDC": 5001.00020004,
"USD": 5000.0,
"BCH": 16.8924625832,
"EUR": 4459.070194683,
"XRP": 7065.5399485629
},
"futures": {
"F-ETH:EUR": {
"name": "F-ETH:EUR",
"pair": "ETH/EUR",
"unit": "EUR",
"portfolio_value": 0.0,
"balance": 0.0,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.0,
"unrealized_funding": 0.0,
"pnl": 0.0
},
"F-XBT:USD": {
"name": "F-XBT:USD",
"pair": "XBT/USD",
"unit": "XBT",
"portfolio_value": 0.0,
"balance": 0.0,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.0,
"unrealized_funding": 0.0,
"pnl": 0.0
},
},
"flex_futures": {
"currencies": {
"USDT": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"GBP": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"USDC": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"XBT": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"USD": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"EUR": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"ETH": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 }
},
"balance_value":0.0,
"portfolio_value":0.0,
"collateral_value":0.0,
"initial_margin":0.0,
"initial_margin_without_orders":0.0,
"maintenance_margin":0.0,
"pnl":0.0,
"unrealized_funding":0.0,
"total_unrealized":0.0,
"total_unrealized_as_margin":0.0,
"margin_equity":0.0,
"available_margin":0.0
"isolated":{
},
"cross":{
"balance_value":9963.66,
"portfolio_value":9963.66,
"collateral_value":9963.66,
"initial_margin":0.0,
"initial_margin_without_orders":0.0,
"maintenance_margin":0.0,
"pnl":0.0,
"unrealized_funding":0.0,
"total_unrealized":0.0,
"total_unrealized_as_margin":0.0,
"margin_equity":9963.66,
"available_margin":9963.66,
"effective_leverage":0.0
},
"timestamp":1640995200000,
"seq":0
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account name |
timestamp |
positive integer | The unix timestamp of the balance state in milliseconds |
seq |
positive integer | The subscription message sequence number |
holding | map of floats | A map from currency names to balance quantity |
futures | map of structures | A map from single collateral wallet names to collateral wallet structure |
flex_futures | structure | The multi-collateral wallet structure |
Holding Wallet
Field | Type | Description |
---|---|---|
currency | positive float | The balance in the holding wallet |
Futures Wallet
Field | Type | Description |
---|---|---|
name |
string | The name of the account |
pair |
string | The wallet currency pair |
unit |
string | The wallet settlement unit |
portfolio_value |
float | The current balance with haircuts and any unrealized margin from open positions in settlement units |
balance |
float | The current balance in settlement units |
maintenance_margin |
positive float | The maintenance margin for open positions |
initial_margin |
float | The initial margin for open positions and open orders |
available |
float | The current portfolio value minus initial margin |
unrealized_funding |
positive float | The total unrealized funding for open positions |
pnl |
positive float | The total profit and loss for open positions |
Multi-collateral Wallet
Field | Type | Description |
---|---|---|
balance_value |
float | The current USD balance of the account |
portfolio_value |
float | The current collateral value with unrealized margin from any open positions |
collateral_value |
float | The current USD balance with haircuts |
initial_margin |
float | The total initial margin for open positions and open orders |
initial_margin_without_orders |
float | The total initial margin for open positions |
maintenance_margin |
float | The total maintenance margin for open positions |
pnl |
float | The total profit and loss for open positions |
unrealized_funding |
float | The total unrealized funding for open positions |
total_unrealized |
float | The total unrealized funding and pnl |
total_unrealized_as_margin |
float | The total unrealized in USD |
margin_equity |
float | The current collateral value and unrealized margin |
available_margin |
float | The margin equity minus initial margin |
isolated |
map of structures | The current margin information for isolated position(s) |
cross |
map of structures | The current margin information for cross position(s) |
currencies | map of structures | A map from collateral wallet names to collateral wallet structure |
Multi-collateral Currencies
Field | Type | Description |
---|---|---|
quantity |
float | The currency quantity |
value |
float | The USD value of the currency balance |
collateral_value |
float | The current USD balance with haircuts |
available |
float | The total available margin valued in the wallet currency |
haircut |
float | The rate of reduction in the value of a collateral asset that may be used as margin |
conversion_spread |
float | The conversion spread is used to calculate conversion fee for multi-collateral wallets |
Balances Delta Data
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
account |
string | The user account name |
timestamp |
positive integer | The unix timestamp of the balance state in milliseconds |
seq |
positive integer | The subscription message sequence number |
holding | optional map of floats | A map from currency names to balance quantity |
futures | optional map of structures | A map from single collateral wallet names to collateral wallet structure |
flex_futures | optional structure | The multi-collateral wallet structure |
Sample Holding Wallet Balance Delta
{
"feed": "balances",
"account": "7a641082-55c7-4411-a85f-930ec2e09617",
"holding": {
"USD": 5000.0
},
"futures": {},
"timestamp": 1640995200000,
"seq": 83
}
Sample Multi-Collateral Balance Delta
{
"feed": "balances"
"account": "7a641082-55c7-4411-a85f-930ec2e09617"
"flex_futures": {
"currencies": {
"USDT": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"GBP": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"USDC": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"XBT": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"USD": { "quantity": 5000.0, "value": 5000.0, "collateral_value": 5000.0, "available": 5000.0, "haircut": 0.0, "conversion_spread": 0.0 },
"EUR": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 },
"ETH": { "quantity": 0.0, "value": 0.0, "collateral_value": 0.0, "available": 0.0, "haircut": 0.0, "conversion_spread": 0.0 }
},
"balance_value": 5000.0,
"portfolio_value": 5000.0,
"collateral_value": 5000.0,
"initial_margin": 0.0,
"initial_margin_without_orders": 0.0,
"maintenance_margin": 0.0,
"pnl": 0.0,
"unrealized_funding": 0.0,
"total_unrealized": 0.0,
"total_unrealized_as_margin": 0.0,
"margin_equity": 5000.0,
"available_margin": 5000.0
},
"timestamp": 1640995200000,
"seq": 1
}
Sample Single-Collateral Balance Delta
{
"feed": "balances",
"account": "7a641082-55c7-4411-a85f-930ec2e09617",
"holding": {},
"futures": {
"F-XBT:USD": {
"name": "F-XBT:USD",
"pair": "XBT/USD",
"unit": "XBT",
"portfolio_value": 0.1219368845,
"balance": 0.1219368845,
"maintenance_margin": 0.0,
"initial_margin": 0.0,
"available": 0.1219368845,
"unrealized_funding": 0.0,
"pnl": 0.0
}
},
"timestamp": 1640995200000,
"seq": 2
}
Sample return if unsuccessful
{
"event": "error",
"message": "Invalid product id"
}
Unsuccessful subscription result
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feed Json Error |
Notifications
This subscription feed publishes notifications to the client.
Authentication is required.
Feed | Event Type | API Keys | Original & Signed Challenge |
---|---|---|---|
notifications_auth |
subscribe / unsubscribe |
Any | Yes |
Sample Sent Message
{
"event": "subscribe",
"feed": "notifications_auth",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Sample Return if Successful
{
"event": "subscribed",
"feed": "notifications_auth",
"api_key": "CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+",
"original_challenge": "226aee50-88fc-4618-a42a-34f7709570b2",
"signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+
Z9DQILm7qxncswMmJyvP/2vgzqqh+g=="
}
Field | Type | Description |
---|---|---|
event |
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed |
string | The requested subscription feed |
api_key |
string | The user api key |
original_challenge |
string | The message that is received from a challenge request |
signed_challenge |
string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data
{
"feed": "notifications_auth",
"notifications": [
{
"id": 5,
"type": "market",
"priority": "low",
"note": "A note describing the notification.",
"effective_time": 1520288300000
},
...
]
}
Field | Type | Description |
---|---|---|
feed |
string | The subscribed feed |
notifications |
list of structures | A list containing the notifications. |
id |
positive integer | The notification id |
type |
string | The notification type. Existing types are market , general , new_feature , bug_fix , maintenance , settlement .If type is maintenance then it implies downtime will occur at effective_time if priority is high |
priority |
string | The notification priority. Existing priorities are low , medium , high .If priority is high then it implies downtime will occur at effective_time when type is maintenance . |
note |
string | The notification note. A short description about the specific notification. |
effective_time |
integer | The time that notification is taking effect. |
Sample Return if Unsuccessful
{
"event": "error",
"message": "Json Error"
}
Field | Type | Description |
---|---|---|
event |
string | Always error |
message |
string | An error message out of:Invalid feed Json Error |
Additional Resources
Support and malfunction reporting
If you require assistance regarding your API implementation, or if you have questions regarding the API’s functionalities or suggestions for improvements, contact our support team by opening a ticket. We also appreciate any feedback regarding unexpected behaviour of the API or possible shortcomings of the API documentation.
Sample implementations
Sample implementations of the API in Java, Python, C# and Visual Basic .NET can be found on our GitHub page:
https://github.com/cryptofacilities
If you have implemented the API in a language that is not listed here and would like to share your code, contact our support team by opening a ticket.