Anboto Trading API v2.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Anboto Trading API
Authentication
Please visit Anboto's website to generate an API key
Mainnet:
- https://api.trade.anboto.xyz
Testnet:
- https://api.testnet.anboto.xyz
(All trades are simulated on testnet and will not trade on any real exchange)
Select Your API Key Type
1) System-generated API Keys: The API key generated by Anboto use HMAC encryption. You will be provided with a an API key and a secret key, that can be used to trade, please keep the keys safe.
2) Self-generated API keys operate with RSA encryption. You must create your public and private keys and only provide the public key to Anboto, we will never hold your private key.
Parameters for Authenticated EndpointsThe following HTTP header keys must be used for authentication on any endpoint annotated with 'ApiKeyAuth':
- X-API-KEY - API key
- X-TIMESTAMP - timestamp in milliseconds from epoch
- X-SIGN - a signature derived from the request's parameters
- X-RECV-WINDOW (unit in millisecond and default value is 5,000) to specify how long an HTTP request is valid. A smaller X-RECV-WINDOW is more secure, but your request may fail if the transmission time is greater than your X-RECV-WINDOW.
Basic steps:
1. The string to sign should be a concatenation of 'timestamp + API key + (recv_window) + (queryString | jsonBodyString)' The queryString should be assembled in alphabetical order.
2. Take your secret key and decode from Base664 into a byte array and then use the HMAC_SHA256 (for system generated keys) or RSA_SHA256 algorithm to sign the string in step 1.
3. Convert the signed value to a hex string (HMAC_SHA256) / base64 (RSA_SHA256) to obtain the sign parameter.
4. Append the sign parameter to request header, and send the HTTP request.
Examples can be found here: https://github.com/anbotolabs/examples
The OpenAPI spec can be found here: https://anbotolabs.github.io/anboto-api-docs/anboto-trading-api-2.0.yml
Default
status
Code samples
# You can also use wget
curl -X GET /status/ping \
-H 'Accept: application/json'
GET /status/ping HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/status/ping',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/status/ping',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/status/ping', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/status/ping', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/status/ping");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/status/ping", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /status/ping
Example responses
200 Response
"string"
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | status 200 response | string |
Data Rest API
exchanges
Code samples
# You can also use wget
curl -X GET /api/v2/data/exchanges \
-H 'Accept: application/json'
GET /api/v2/data/exchanges HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/data/exchanges',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/data/exchanges',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/data/exchanges', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/data/exchanges', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/data/exchanges");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/data/exchanges", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/data/exchanges
Returns a list of exchanges supported
Return a list of exchanges availablel to trade
Example responses
200 Response
"string"
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The exchanges. | string |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
fundingRateHistory
Code samples
# You can also use wget
curl -X GET /api/v2/data/fundingRateHistory \
-H 'Accept: application/json'
GET /api/v2/data/fundingRateHistory HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/data/fundingRateHistory',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/data/fundingRateHistory',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/data/fundingRateHistory', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/data/fundingRateHistory', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/data/fundingRateHistory");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/data/fundingRateHistory", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/data/fundingRateHistory
Returns funding rates histroy
Return all funding rates history based on filter parameters
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | string | false | Return last funding rates on this exchange for each asset |
| symbol | query | string | false | Return last funding rates for this asset on each exchange |
Example responses
200 Response
{
"exchange": "string",
"symbol": "string",
"time": "2019-08-24T14:15:22Z",
"nextTime": "2019-08-24T14:15:22Z",
"rate": 0.1,
"nextRate": 0.1,
"markPrice": 0.1
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The last funding rates. | FundingRate |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
instruments
Code samples
# You can also use wget
curl -X GET /api/v2/data/instruments \
-H 'Accept: application/json'
GET /api/v2/data/instruments HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/data/instruments',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/data/instruments',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/data/instruments', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/data/instruments', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/data/instruments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/data/instruments", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/data/instruments
Returns list of instruments
Return all instruments based on filter parameters
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | string | false | Return all instruments on this exchange for each asset |
| symbol | query | string | false | Return instrument with this symbol |
Example responses
200 Response
{
"exchange": "BINANCE",
"symbol": "string",
"baseAsset": "string",
"quoteAsset": "string",
"exchangeSymbol": "string",
"exchangeAssetClass": "string",
"assetClass": "UNDEFINED",
"quantityPrecision": 0,
"pricePrecision": 0,
"maxQuantityLimit": 0.1,
"minQuantityLimit": 0.1,
"minCostLimit": 0.1,
"maxCostLimit": 0.1,
"contractSize": 0.1,
"minMarketLimit": 0.1,
"maxMarketLimit": 0.1,
"minPriceLimit": 0.1,
"maxPriceLimit": 0.1,
"enabled": true,
"timestamp": "2019-08-24T14:15:22Z",
"priceSignificantFigure": 0,
"quantitySignificantFigure": 0,
"assetId": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The instruments | Instrument |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
lastFundingRates
Code samples
# You can also use wget
curl -X GET /api/v2/data/lastFundingRates \
-H 'Accept: application/json'
GET /api/v2/data/lastFundingRates HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/data/lastFundingRates',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/data/lastFundingRates',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/data/lastFundingRates', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/data/lastFundingRates', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/data/lastFundingRates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/data/lastFundingRates", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/data/lastFundingRates
Returns last funding rates
Return all funding rates based on filter parameters
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | string | false | Return last funding rates on this exchange for each asset |
| symbol | query | string | false | Return last funding rates for this asset on each exchange |
Example responses
200 Response
{
"exchange": "string",
"symbol": "string",
"time": "2019-08-24T14:15:22Z",
"nextTime": "2019-08-24T14:15:22Z",
"rate": 0.1,
"nextRate": 0.1,
"markPrice": 0.1
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The last funding rates. | FundingRate |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
Rest API
getBalance
Code samples
# You can also use wget
curl -X GET /api/v2/trading/balance?exchange=BINANCE \
-H 'Accept: application/json'
GET /api/v2/trading/balance?exchange=BINANCE HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/trading/balance?exchange=BINANCE',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/trading/balance',
params: {
'exchange' => '[Exchange](#schemaexchange)'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/trading/balance', params={
'exchange': 'BINANCE'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/trading/balance', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/balance?exchange=BINANCE");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/trading/balance", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/trading/balance
Returns the balance of assets in an exchange on default account
shows the asset balance > 0
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | Exchange | true | The exchange |
| subaccount | query | string | false | Sub-account |
Enumerated Values
| Parameter | Value |
|---|---|
| exchange | BINANCE |
| exchange | HUOBI |
| exchange | COINBASE_ADV |
| exchange | GATEIO |
| exchange | KRAKEN |
| exchange | KUCOIN |
| exchange | OKX |
| exchange | BYBIT |
| exchange | WOO |
| exchange | MEXC |
| exchange | BITGET |
| exchange | BULLISH |
| exchange | B2C2 |
| exchange | HYPERLIQUID |
| exchange | COINBASE_PRIME |
| exchange | COINBASE_INTL |
| exchange | EXTENDED |
Example responses
200 Response
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The list of asset balance > 0 | OrderDetailsList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
getOrders
Code samples
# You can also use wget
curl -X GET /api/v2/trading/order/byId \
-H 'Accept: application/json'
GET /api/v2/trading/order/byId HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/trading/order/byId',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/trading/order/byId',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/trading/order/byId', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/trading/order/byId', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/byId");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/trading/order/byId", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/trading/order/byId
Returns the order details for all matching orders
Either orderIds or clientOrderIds has to be provided for matching
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| orderIds | query | array[integer] | false | The list of anboto generated order ids |
| clientOrderIds | query | array[string] | false | The list of client generated order ids |
Example responses
200 Response
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | return a list of matching orders | OrderDetailsList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
cancelOrder
Code samples
# You can also use wget
curl -X POST /api/v2/trading/order/cancel \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/trading/order/cancel HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzzz"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/trading/order/cancel',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v2/trading/order/cancel',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v2/trading/order/cancel', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v2/trading/order/cancel', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/cancel");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v2/trading/order/cancel", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v2/trading/order/cancel
Cancels the parent order
This will initiate a cancellation request and set the order state to pending cancel. For the finalized state call /order/id?orderId=xxx
Body parameter
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzzz"
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CancelUpstreamOrderRequest | true | none |
Example responses
200 Response
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Cancellation request processed and in progress. | OrderSummary |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
cancelAllOpenOrders
Code samples
# You can also use wget
curl -X GET /api/v2/trading/order/cancelAll \
-H 'Accept: application/json'
GET /api/v2/trading/order/cancelAll HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/trading/order/cancelAll',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/trading/order/cancelAll',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/trading/order/cancelAll', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/trading/order/cancelAll', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/cancelAll");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/trading/order/cancelAll", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/trading/order/cancelAll
Cancels all open orders
All orders that are not in a terminal state will be cancelled
Example responses
200 Response
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The list of open orders that will be cancelled. | OrderDetailsList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
cancelMany
Code samples
# You can also use wget
curl -X POST /api/v2/trading/order/cancelMany \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/trading/order/cancelMany HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzzz"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/trading/order/cancelMany',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v2/trading/order/cancelMany',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v2/trading/order/cancelMany', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v2/trading/order/cancelMany', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/cancelMany");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v2/trading/order/cancelMany", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v2/trading/order/cancelMany
Cancels all of the parent orders specified in the batch request
This will initiate the order cancellations and set the status of all orders to pending cancel. For the finalized state call /order?orderId=xxx
Body parameter
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzzz"
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CancelManyUpstreamOrdersRequest | true | none |
Example responses
200 Response
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Cancellation request processed and in progress. | OrderSummary |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
createOrder
Code samples
# You can also use wget
curl -X POST /api/v2/trading/order/create \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/trading/order/create HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"client_order_id": "ABC-12345^12-10-23",
"exchange": "BINANCE",
"subaccount": "string",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"quantity": "string",
"strategy": "TWAP",
"limit_price": "2205.10",
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"reduce_only": true
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/trading/order/create',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v2/trading/order/create',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v2/trading/order/create', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v2/trading/order/create', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/create");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v2/trading/order/create", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v2/trading/order/create
Create a new order
Process a new order request and return order response
Body parameter
{
"client_order_id": "ABC-12345^12-10-23",
"exchange": "BINANCE",
"subaccount": "string",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"quantity": "string",
"strategy": "TWAP",
"limit_price": "2205.10",
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"reduce_only": true
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CreateParentOrderRequest | true | none |
Example responses
201 Response
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Order created successfully | OrderSummary |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
createManyOrders
Code samples
# You can also use wget
curl -X POST /api/v2/trading/order/createMany \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/trading/order/createMany HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"orders": [
{
"client_order_id": "ABC-12345^12-10-23",
"exchange": "BINANCE",
"subaccount": "string",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"quantity": "string",
"strategy": "TWAP",
"limit_price": "2205.10",
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"reduce_only": true
}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/trading/order/createMany',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v2/trading/order/createMany',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v2/trading/order/createMany', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v2/trading/order/createMany', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/createMany");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v2/trading/order/createMany", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v2/trading/order/createMany
Creates many new orders in a single request.
Process a set of new order request and returns a summary for each order, the orders are not linked during execution and this endpoint is for convenience only
Body parameter
{
"orders": [
{
"client_order_id": "ABC-12345^12-10-23",
"exchange": "BINANCE",
"subaccount": "string",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"quantity": "string",
"strategy": "TWAP",
"limit_price": "2205.10",
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"reduce_only": true
}
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CreateManyParentOrdersRequest | true | none |
Example responses
201 Response
{
"orders": [
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Order processed. | OrderSummaryList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
createManyMultiLegsOrders
Code samples
# You can also use wget
curl -X POST /api/v2/trading/order/createMany/multilegs \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/trading/order/createMany/multilegs HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"orders": [
{
"client_order_id": "ABC-12345^12-10-23",
"subaccount": "string",
"algo": "PAIR",
"legs": [
{
"exchange": "BINANCE",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"target_value": "12.0",
"ccy": "USD",
"limit_price": "2205.10",
"strategy": "TWAP",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
}
],
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"params": {}
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/trading/order/createMany/multilegs',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v2/trading/order/createMany/multilegs',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v2/trading/order/createMany/multilegs', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v2/trading/order/createMany/multilegs', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/createMany/multilegs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v2/trading/order/createMany/multilegs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v2/trading/order/createMany/multilegs
Creates many new multilegs orders in a single request.
Process a set of new order request and returns a summary for each order, the orders are not linked during execution and this endpoint is for convenience only
Body parameter
{
"orders": [
{
"client_order_id": "ABC-12345^12-10-23",
"subaccount": "string",
"algo": "PAIR",
"legs": [
{
"exchange": "BINANCE",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"target_value": "12.0",
"ccy": "USD",
"limit_price": "2205.10",
"strategy": "TWAP",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
}
],
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"params": {}
}
]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CreateManyMultiLegsParentOrdersRequest | true | none |
Example responses
201 Response
{
"orders": [
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Order processed. | OrderSummaryList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
createMultiLegsOrder
Code samples
# You can also use wget
curl -X POST /api/v2/trading/order/create_multiLegs \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /api/v2/trading/order/create_multiLegs HTTP/1.1
Content-Type: application/json
Accept: application/json
const inputBody = '{
"client_order_id": "ABC-12345^12-10-23",
"subaccount": "string",
"algo": "PAIR",
"legs": [
{
"exchange": "BINANCE",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"target_value": "12.0",
"ccy": "USD",
"limit_price": "2205.10",
"strategy": "TWAP",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
}
],
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"params": {}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/trading/order/create_multiLegs',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post '/api/v2/trading/order/create_multiLegs',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('/api/v2/trading/order/create_multiLegs', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','/api/v2/trading/order/create_multiLegs', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/create_multiLegs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "/api/v2/trading/order/create_multiLegs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /api/v2/trading/order/create_multiLegs
Create a new multilegs order
Process a new order request and return order response
Body parameter
{
"client_order_id": "ABC-12345^12-10-23",
"subaccount": "string",
"algo": "PAIR",
"legs": [
{
"exchange": "BINANCE",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"target_value": "12.0",
"ccy": "USD",
"limit_price": "2205.10",
"strategy": "TWAP",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
}
],
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"params": {}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CreateMultiLegsParentOrderRequest | true | none |
Example responses
201 Response
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Order created successfully | OrderSummary |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
findOrders
Code samples
# You can also use wget
curl -X GET /api/v2/trading/order/find \
-H 'Accept: application/json'
GET /api/v2/trading/order/find HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/trading/order/find',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/trading/order/find',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/trading/order/find', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/trading/order/find', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/find");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/trading/order/find", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/trading/order/find
Returns the order details for all matching orders
Only matched order within 3 days will be return
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| startMs | query | integer(int64) | false | The start time for the query as ms since epoch |
| endMs | query | integer(int64) | false | The end time for the query as ms since epoch |
| limit | query | integer(int32) | false | The maximum number of orders to return in the results |
Example responses
200 Response
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The list of matching orders. | OrderDetailsList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
getOpenOrders
Code samples
# You can also use wget
curl -X GET /api/v2/trading/order/open \
-H 'Accept: application/json'
GET /api/v2/trading/order/open HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/trading/order/open',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/trading/order/open',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/trading/order/open', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/trading/order/open', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/order/open");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/trading/order/open", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/trading/order/open
Returns all open orders
All orders that are not in a terminal state will be returned
Example responses
200 Response
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The list of open orders. | OrderDetailsList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
getPosition
Code samples
# You can also use wget
curl -X GET /api/v2/trading/position?exchange=BINANCE \
-H 'Accept: application/json'
GET /api/v2/trading/position?exchange=BINANCE HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/trading/position?exchange=BINANCE',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/trading/position',
params: {
'exchange' => '[Exchange](#schemaexchange)'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/trading/position', params={
'exchange': 'BINANCE'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/trading/position', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/position?exchange=BINANCE");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/trading/position", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/trading/position
Returns the position of assets in an exchange on default account
shows the asset position != 0
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | Exchange | true | The exchange |
| subaccount | query | string | false | Sub-account |
Enumerated Values
| Parameter | Value |
|---|---|
| exchange | BINANCE |
| exchange | HUOBI |
| exchange | COINBASE_ADV |
| exchange | GATEIO |
| exchange | KRAKEN |
| exchange | KUCOIN |
| exchange | OKX |
| exchange | BYBIT |
| exchange | WOO |
| exchange | MEXC |
| exchange | BITGET |
| exchange | BULLISH |
| exchange | B2C2 |
| exchange | HYPERLIQUID |
| exchange | COINBASE_PRIME |
| exchange | COINBASE_INTL |
| exchange | EXTENDED |
Example responses
200 Response
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The list of matching orders. | OrderDetailsList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
getUserTrades
Code samples
# You can also use wget
curl -X GET /api/v2/trading/userTrades?exchange=BINANCE \
-H 'Accept: application/json'
GET /api/v2/trading/userTrades?exchange=BINANCE HTTP/1.1
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('/api/v2/trading/userTrades?exchange=BINANCE',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/api/v2/trading/userTrades',
params: {
'exchange' => '[Exchange](#schemaexchange)'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('/api/v2/trading/userTrades', params={
'exchange': 'BINANCE'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','/api/v2/trading/userTrades', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("/api/v2/trading/userTrades?exchange=BINANCE");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "/api/v2/trading/userTrades", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /api/v2/trading/userTrades
Returns the trades of orders in an exchange on default account by a list of order Ids/client order Ids
Either orderIds or clientOrderIds has to be provided for matching
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| exchange | query | Exchange | true | The exchange |
| subaccount | query | string | false | Sub-account |
| orderIds | query | array[integer] | false | The list of anboto generated order ids |
| clientOrderIds | query | array[string] | false | The list of client generated order ids |
Enumerated Values
| Parameter | Value |
|---|---|
| exchange | BINANCE |
| exchange | HUOBI |
| exchange | COINBASE_ADV |
| exchange | GATEIO |
| exchange | KRAKEN |
| exchange | KUCOIN |
| exchange | OKX |
| exchange | BYBIT |
| exchange | WOO |
| exchange | MEXC |
| exchange | BITGET |
| exchange | BULLISH |
| exchange | B2C2 |
| exchange | HYPERLIQUID |
| exchange | COINBASE_PRIME |
| exchange | COINBASE_INTL |
| exchange | EXTENDED |
Example responses
200 Response
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | A list of matching trades. | OrderDetailsList |
| 401 | Unauthorized | Unauthorized, Invalid Signature | None |
Schemas
ApiErrorCode
"OTHER"
The error code used to describe why an order was rejected.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The error code used to describe why an order was rejected. |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | OTHER |
| anonymous | QUANTITY_EXCEED |
| anonymous | AUTHENTICATION_ERROR |
| anonymous | INSUFFICIENT_FUNDS |
| anonymous | RATE_LIMIT_EXCEEDED |
| anonymous | DDOS_PROTECTION |
| anonymous | EXCHANGE_NOT_AVAILABLE |
| anonymous | NETWORK_ERROR |
| anonymous | INVALID_ORDER |
| anonymous | EXCHANGE_ERROR |
| anonymous | EMS_INSTANCES_DOWN |
| anonymous | SLIPPAGE_EXCEEDED |
| anonymous | EXPIRY_REACHED |
| anonymous | MAX_FEE_PER_GAS_IS_TOO_LOW |
| anonymous | PARENT_ORDER_WAS_TERMINATED |
| anonymous | MAX_PRIORITY_FEE_PER_GAS_IS_TOO_LOW |
| anonymous | INVALID_QUANTITY |
| anonymous | INVALID_END_TIME |
| anonymous | INVALID_TRADE_TIME |
| anonymous | INVALID_FEE |
| anonymous | INVALID_SYMBOL |
| anonymous | INVALID_TRADE_STRATEGY |
| anonymous | INVALID_LIMIT_PRICE |
| anonymous | INVALID_WOULD_PRICE |
| anonymous | INVALID_TRIGGER_PRICE |
| anonymous | INVALID_PARAM |
| anonymous | INVALID_EXCHANGE |
| anonymous | INVALID_SIGNATURE |
| anonymous | INVALID_API_KEY |
| anonymous | INVALID_TIMESTAMP |
| anonymous | BATCH_OVERSIZE |
| anonymous | SYSTEM_ERROR |
| anonymous | INVALID_REQUEST |
| anonymous | SYSTEM_BUSY |
AssetCategory
"SPOT"
The Asset category of the order.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The Asset category of the order. |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | SPOT |
| anonymous | FUTURE |
AssetClass
"UNDEFINED"
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | UNDEFINED |
| anonymous | SPOT |
| anonymous | FUTURE |
| anonymous | OPTION |
| anonymous | CFD |
CancelManyUpstreamOrdersRequest
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzzz"
}
]
}
Used for cancelling many parent orders at the same time
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| orders | [CancelUpstreamOrderRequest] | true | none | The list of parent cancellation requests |
CancelUpstreamOrderRequest
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzzz"
}
Used for cancelling a parent order
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| order_id | integer(int64)¦null | false | none | The Anboto generated order id |
| client_order_id | string¦null | false | none | The client provided order id |
ClipSizeType
"ABSOLUTE"
The clip size for the child orders. The default is AUTOMATIC
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The clip size for the child orders. The default is AUTOMATIC |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | ABSOLUTE |
| anonymous | PERCENTAGE |
| anonymous | AUTOMATIC |
CreateManyMultiLegsParentOrdersRequest
{
"orders": [
{
"client_order_id": "ABC-12345^12-10-23",
"subaccount": "string",
"algo": "PAIR",
"legs": [
{
"exchange": "BINANCE",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"target_value": "12.0",
"ccy": "USD",
"limit_price": "2205.10",
"strategy": "TWAP",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
}
],
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"params": {}
}
]
}
A request to create many multilegs orders in a single request.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| orders | [CreateMultiLegsParentOrderRequest] | true | none | [Used for creating a parent order.] |
CreateManyParentOrdersRequest
{
"orders": [
{
"client_order_id": "ABC-12345^12-10-23",
"exchange": "BINANCE",
"subaccount": "string",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"quantity": "string",
"strategy": "TWAP",
"limit_price": "2205.10",
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"reduce_only": true
}
}
]
}
A request to create many parent orders in a single request.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| orders | [CreateParentOrderRequest] | true | none | [Used for creating a parent order.] |
CreateMultiLegsParentOrderRequest
{
"client_order_id": "ABC-12345^12-10-23",
"subaccount": "string",
"algo": "PAIR",
"legs": [
{
"exchange": "BINANCE",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"target_value": "12.0",
"ccy": "USD",
"limit_price": "2205.10",
"strategy": "TWAP",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
}
],
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"params": {}
}
Used for creating a parent order.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| client_order_id | string¦null | false | none | A custom string to identify the order |
| subaccount | string¦null | false | none | The sub-account under which to trade the order |
| algo | MultiLegsAlgo | true | none | The algo to execute the order |
| legs | [CreateOrderLegRequest] | true | none | The order legs |
| start_time | string¦null | false | none | The start time in UTC |
| end_time | string¦null | false | none | The end time in UTC |
| params | MultiLegsOrderParams¦null | false | none | The advanced order parameters to modify the execution behavior. |
CreateOrderLegRequest
{
"exchange": "BINANCE",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"target_value": "12.0",
"ccy": "USD",
"limit_price": "2205.10",
"strategy": "TWAP",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
}
Used for creating a parent order.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| exchange | Exchange | true | none | The execution exchange, e.g. BINANCE |
| symbol | string | true | none | The symbol using Anboto symbology, e.g. BTC/USDT |
| asset_category | any | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | AssetCategory | false | none | The Asset category of the order. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The asset category |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| side | Side | true | none | The side of the book to trade. |
| target_value | string | true | none | The target value to be filled |
| ccy | string | true | none | The currency of target value |
| limit_price | string¦null | false | none | The exchange valid limit price for the order leg |
| strategy | ExecutionStrategy | true | none | The execution strategy for the order. |
| clip_size_type | any | false | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | ClipSizeType | false | none | The clip size for the child orders. The default is AUTOMATIC |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The clip size type |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| clip_size_val | string¦null | false | none | The clip size value, required if the type is ABSOLUTE or PERCENTAGE |
| params | OrderLegParams¦null | false | none | The advanced order parameters to modify the execution behavior. |
CreateParentOrderRequest
{
"client_order_id": "ABC-12345^12-10-23",
"exchange": "BINANCE",
"subaccount": "string",
"symbol": "string",
"asset_category": "SPOT",
"side": "BUY",
"quantity": "string",
"strategy": "TWAP",
"limit_price": "2205.10",
"start_time": "2024-01-22T22:05:00Z",
"end_time": "2024-04-22T22:05:00Z",
"clip_size_type": "AUTOMATIC",
"clip_size_val": "0.01",
"params": {
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"reduce_only": true
}
}
Used for creating a parent order.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| client_order_id | string¦null | false | none | A custom string to identify the order |
| exchange | Exchange | true | none | The execution exchange, e.g. BINANCE |
| subaccount | string¦null | false | none | The sub-account under which to trade the order |
| symbol | string | true | none | The symbol using Anboto symbology, e.g. BTC/USDT |
| asset_category | any | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | AssetCategory | false | none | The Asset category of the order. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The asset category |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| side | Side | true | none | The side of the book to trade. |
| quantity | string | true | none | The quantity to trade as a exchange trade-able decimal value, e.g. 0.015 |
| strategy | ExecutionStrategy | true | none | The execution strategy for the order. |
| limit_price | string¦null | false | none | The exchange valid limit price for the order |
| start_time | string¦null | false | none | The start time in UTC |
| end_time | string¦null | false | none | The end time in UTC |
| clip_size_type | any | false | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | ClipSizeType | false | none | The clip size for the child orders. The default is AUTOMATIC |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The clip size type |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| clip_size_val | string¦null | false | none | The clip size value, required if the type is ABSOLUTE or PERCENTAGE |
| params | OrderParams¦null | false | none | The advanced order parameters to modify the execution behavior. |
Exchange
"BINANCE"
The exchange where to trade the order.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The exchange where to trade the order. |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | BINANCE |
| anonymous | HUOBI |
| anonymous | COINBASE_ADV |
| anonymous | GATEIO |
| anonymous | KRAKEN |
| anonymous | KUCOIN |
| anonymous | OKX |
| anonymous | BYBIT |
| anonymous | WOO |
| anonymous | MEXC |
| anonymous | BITGET |
| anonymous | BULLISH |
| anonymous | B2C2 |
| anonymous | HYPERLIQUID |
| anonymous | COINBASE_PRIME |
| anonymous | COINBASE_INTL |
| anonymous | EXTENDED |
ExecutionStrategy
"TWAP"
The execution strategy for the order.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The execution strategy for the order. |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | TWAP |
| anonymous | VWAP |
| anonymous | ICEBERG |
| anonymous | POV |
| anonymous | MARKET |
| anonymous | LIMIT |
| anonymous | IS |
FundingRate
{
"exchange": "string",
"symbol": "string",
"time": "2019-08-24T14:15:22Z",
"nextTime": "2019-08-24T14:15:22Z",
"rate": 0.1,
"nextRate": 0.1,
"markPrice": 0.1
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| exchange | string | true | none | none |
| symbol | string | true | none | none |
| time | string(date-time) | true | none | none |
| nextTime | string(date-time) | true | none | none |
| rate | number(double) | true | none | none |
| nextRate | number(double)¦null | false | none | none |
| markPrice | number(double)¦null | false | none | none |
Instrument
{
"exchange": "BINANCE",
"symbol": "string",
"baseAsset": "string",
"quoteAsset": "string",
"exchangeSymbol": "string",
"exchangeAssetClass": "string",
"assetClass": "UNDEFINED",
"quantityPrecision": 0,
"pricePrecision": 0,
"maxQuantityLimit": 0.1,
"minQuantityLimit": 0.1,
"minCostLimit": 0.1,
"maxCostLimit": 0.1,
"contractSize": 0.1,
"minMarketLimit": 0.1,
"maxMarketLimit": 0.1,
"minPriceLimit": 0.1,
"maxPriceLimit": 0.1,
"enabled": true,
"timestamp": "2019-08-24T14:15:22Z",
"priceSignificantFigure": 0,
"quantitySignificantFigure": 0,
"assetId": "string"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| exchange | Exchange | true | none | The exchange where to trade the order. |
| symbol | string | true | none | none |
| baseAsset | string | true | none | none |
| quoteAsset | string | true | none | none |
| exchangeSymbol | string | true | none | none |
| exchangeAssetClass | string | true | none | none |
| assetClass | AssetClass | true | none | none |
| quantityPrecision | integer(int32)¦null | false | none | none |
| pricePrecision | integer(int32)¦null | false | none | none |
| maxQuantityLimit | number(double)¦null | false | none | none |
| minQuantityLimit | number(double)¦null | false | none | none |
| minCostLimit | number(double)¦null | false | none | none |
| maxCostLimit | number(double)¦null | false | none | none |
| contractSize | number(double)¦null | false | none | none |
| minMarketLimit | number(double)¦null | false | none | none |
| maxMarketLimit | number(double)¦null | false | none | none |
| minPriceLimit | number(double)¦null | false | none | none |
| maxPriceLimit | number(double)¦null | false | none | none |
| enabled | boolean | true | none | none |
| timestamp | string(date-time) | true | none | none |
| priceSignificantFigure | integer(int32)¦null | false | none | none |
| quantitySignificantFigure | integer(int32)¦null | false | none | none |
| assetId | string¦null | false | none | none |
MultiLegsAlgo
"PAIR"
The execution strategy for the order.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The execution strategy for the order. |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | PAIR |
MultiLegsOrderParams
{}
The advanced order parameters to modify the execution behavior.
Properties
None
OrderDetails
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| order_id | integer(int64)¦null | false | none | The Anboto generated order id |
| client_order_id | string¦null | false | none | The client provided order id |
| symbol | string | true | none | The order symbol using Anboto symbology |
| status | OrderStatus | true | none | The order status |
| filled_quantity | number | true | none | The absolute amount of the order quantity filled |
| leaves_quantity | number | true | none | The absolute amount of the order quantity remaining to be filled |
| side | Side¦null | false | none | The side of the book to trade. |
| last_quantity | number | true | none | The last qty received in a fill from the exchange |
| last_price | number | true | none | The last price executed on the exchange |
| average_price | number | true | none | The average execution price of the order |
OrderDetailsList
{
"orders": [
{
"order_id": 123456,
"client_order_id": "xxx-yyy-zzz",
"symbol": "string",
"status": "PENDING_NEW",
"filled_quantity": 0,
"leaves_quantity": 0,
"side": "BUY",
"last_quantity": 0,
"last_price": 0,
"average_price": 0
}
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| orders | [OrderDetails] | true | none | The list of order details for separate orders. |
OrderLegParams
{
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"is_leading": true
}
The advanced order parameters to modify the execution behavior.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| duration_seconds | string¦null | false | none | The duration of the order in seconds, this is a required field for TWAP and VWAP. |
| trading_style | any | false | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TradingStyle | false | none | The trading style of the order, the default is HYBRID |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The trading style to use for the order |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| urgency | any | false | none | IS strategy |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | Urgency | false | none | The Urgency or Risk Aversion of the IS strategy, the default is MEDIUM. The parameter is not case-sensitive. Each risk aversion levels correspond to a lambda value, "that is, how much we penalize variance relative to expected cost" Low : 0.2e-6 Medium: 1e-6 High: 5e-6 Based on the paper from Almgren Chriss https://www.smallake.kr/wp-content/uploads/2016/03/optliq.pdf |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The urgency level to use for the IS strategy. Default: MEDIUM |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| randomize_amount | boolean¦null | false | none | Whether to randomize the slice amount |
| would | WouldInfo¦null | false | none | Information to instruct how to execute a Would price trigger. |
| trigger | TriggerInfo¦null | false | none | Information related to how the order should be triggered. |
| placement_infos | any | false | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | PlacementInfo | false | none | How to place an order into the book |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none | The placement information for the order |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| is_leading | boolean | false | none | true if this is a leading leg |
OrderParams
{
"duration_seconds": "120",
"trading_style": "string",
"urgency": "string",
"randomize_amount": true,
"would": {
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
},
"trigger": {
"trigger_price": "string",
"trigger_condition": "string"
},
"placement_infos": {
"placement_mode": "string",
"placement": "string",
"cancel": "string"
},
"reduce_only": true
}
The advanced order parameters to modify the execution behavior.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| duration_seconds | string¦null | false | none | The duration of the order in seconds, this is a required field for TWAP and VWAP. |
| trading_style | any | false | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TradingStyle | false | none | The trading style of the order, the default is HYBRID |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The trading style to use for the order |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| urgency | any | false | none | IS strategy |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | Urgency | false | none | The Urgency or Risk Aversion of the IS strategy, the default is MEDIUM. The parameter is not case-sensitive. Each risk aversion levels correspond to a lambda value, "that is, how much we penalize variance relative to expected cost" Low : 0.2e-6 Medium: 1e-6 High: 5e-6 Based on the paper from Almgren Chriss https://www.smallake.kr/wp-content/uploads/2016/03/optliq.pdf |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The urgency level to use for the IS strategy. Default: MEDIUM |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| randomize_amount | boolean¦null | false | none | Whether to randomize the slice amount |
| would | WouldInfo¦null | false | none | Information to instruct how to execute a Would price trigger. |
| trigger | TriggerInfo¦null | false | none | Information related to how the order should be triggered. |
| placement_infos | any | false | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | PlacementInfo | false | none | How to place an order into the book |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | object | false | none | The placement information for the order |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| reduce_only | boolean | false | none | Reduce Only for future positions |
OrderStatus
"PENDING_NEW"
The order status
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The order status |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | PENDING_NEW |
| anonymous | ACCEPTED |
| anonymous | REJECTED |
| anonymous | PARTIALLY_FILLED |
| anonymous | FILLED |
| anonymous | PENDING_CANCEL |
| anonymous | CANCELLED |
| anonymous | PENDING_PAUSE |
| anonymous | PAUSED |
| anonymous | PENDING_UNPAUSE |
| anonymous | EXPIRED |
| anonymous | CANCEL_REJECTED |
OrderSummary
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
Summarizes the state of the parent order
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| order_id | integer(int64)¦null | false | none | The Anboto assigned order identifier |
| client_order_id | string¦null | false | none | A custom string to identify the order |
| status | OrderStatus¦null | false | none | The status of the order, e.g. PENDING_NEW |
| created_at | string(date-time)¦null | true | none | The time in UTC when the order was created |
| message | string¦null | false | none | Any additional information, usually if the order was rejected |
| error_code | any | false | none | The error code if the order was rejected |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | ApiErrorCode | false | none | The error code used to describe why an order was rejected. |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The error code if the order was rejected |
OrderSummaryList
{
"orders": [
{
"order_id": 0,
"client_order_id": "ABC-12345^12-10-23",
"status": "PENDING_NEW",
"created_at": "2024-01-22T22:05:00Z",
"message": "string",
"error_code": "INVALID_ORDER"
}
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| orders | [OrderSummary] | true | none | The list of order summaries for separate orders. |
PlacementInfo
{
"placement_mode": "string",
"placement": "string",
"cancel": "string"
}
How to place an order into the book
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| placement_mode | any | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | PlacementMode | false | none | The style used to place an order in the book. DEFAULT is the default and will be at the discretion of the trading strategy |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | How to place an order into the book |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| placement | string¦null | false | none | Where to place new orders in the book, e.g. 2 would slice at the second best observed price. |
| cancel | string¦null | false | none | At what level to cancel an existing order on the book, e.g. 6 would cancel the order when it got to level 6 in the book |
PlacementMode
"DEFAULT"
The style used to place an order in the book. DEFAULT is the default and will be at the discretion of the trading strategy
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The style used to place an order in the book. DEFAULT is the default and will be at the discretion of the trading strategy |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | DEFAULT |
| anonymous | TIGHT |
| anonymous | CUSTOM |
Side
"BUY"
The side of the book to trade.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The side of the book to trade. |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | BUY |
| anonymous | SELL |
TradingStyle
"PASSIVE"
The trading style of the order, the default is HYBRID
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The trading style of the order, the default is HYBRID |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | PASSIVE |
| anonymous | AGGRESSIVE |
| anonymous | HYBRID |
TriggerCondition
"ABOVE"
The trigger condition to start the order
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The trigger condition to start the order |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | ABOVE |
| anonymous | BELOW |
TriggerInfo
{
"trigger_price": "string",
"trigger_condition": "string"
}
Information related to how the order should be triggered.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| trigger_price | string | true | none | The price to monitor for the trigger |
| trigger_condition | any | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TriggerCondition | false | none | The trigger condition to start the order |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The condition to trigger the order |
Urgency
"LOW"
The Urgency or Risk Aversion of the IS strategy, the default is MEDIUM. The parameter is not case-sensitive. Each risk aversion levels correspond to a lambda value, "that is, how much we penalize variance relative to expected cost" Low : 0.2e-6 Medium: 1e-6 High: 5e-6 Based on the paper from Almgren Chriss https://www.smallake.kr/wp-content/uploads/2016/03/optliq.pdf
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | string | false | none | The Urgency or Risk Aversion of the IS strategy, the default is MEDIUM. The parameter is not case-sensitive. Each risk aversion levels correspond to a lambda value, "that is, how much we penalize variance relative to expected cost" Low : 0.2e-6 Medium: 1e-6 High: 5e-6 Based on the paper from Almgren Chriss https://www.smallake.kr/wp-content/uploads/2016/03/optliq.pdf |
Enumerated Values
| Property | Value |
|---|---|
| anonymous | LOW |
| anonymous | MEDIUM |
| anonymous | HIGH |
WouldInfo
{
"would_price": "string",
"would_pct": "string",
"would_style": "string",
"would_is_arrival": true
}
Information to instruct how to execute a Would price trigger.
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| would_price | string¦null | false | none | The price to trigger Would mode |
| would_pct | string | true | none | The percent of the order to trade when the Would price triggers |
| would_style | any | true | none | none |
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | TradingStyle | false | none | The trading style of the order, the default is HYBRID |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » anonymous | string | false | none | The trading style to use when the Would price triggers |
continued
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| would_is_arrival | boolean | false | none | Would price as arrival price |