Introduction
WOO X. A privately-accessible liquidity venue for the trading of cryptocurrencies.
WOO X provides clients with an easily accessible deep pool of liquidity sourced from the largest exchanges and from Kronos’ HFT proprietary trading. We utilize advanced crossing and routing methods that provide ease of access and superior trade execution to selected exchanges.
WOO X provides two interfaces to access its services:
- RESTful API interface: Provides sending events like create order, cancel orders, fetch balance, etc.
- Websocket interface V2: Provides real-time orderbook data feed and order update feed.
Pricing
WOO X charges low to zero transaction fees defined as:
0.00%
Maker fee and -0.003%
Taker rebate. More Info Also, a 30-day free trial period (for both Maker and Taker) is provided for institutional clients.
Base endpoints:
https://api.staging.woo.org/
(Staging)https://api.woo.org/
(Production)
Authorization:
All our interfaces require key to access, and the token will be pre-generated by us.
Please set the corrsponding header in your request. Refer to Authenticaton for more information.
Symbol:
WOO X use the following format: <TYPE>_<BASE>_<QUOTE>
to represent a symbol name, for example: SPOT_BTC_USDT
means that it is BTC_USDT
pair in SPOT
trading market.
Rate Limit:
The rate limit is counted using an api key, and if your application reached the rate limit of a certain endpoint, the server will return an error result with http code 429
. You may need to wait until the next time horizon.
Error Message:
Errors consist of three parts: an error code, detail message and a success flag.
{
"success": false,
"code": -1005, // Error code
"message": "order_price must be a positive number" // Detail message
}
All API will return following json when api failed, the "message" will contain the detail error message, it may be because some data is in the wrong format, or another type of error.
Specific error codes and messages are defined in Errors Codes.
Authentication
Client needs to ask for an api_key
and api_secret
, and use these to sign your request.
Example
Here we provide a simple example that shows you how to send a valid request to WOO X.
Assume following infomation:
Key | Value | Description |
---|---|---|
api_key |
AbmyVJGUpN064ks5ELjLfA== |
create from WOO X console |
api_secret |
QHKRXHPAW1MC9YGZMAT8YDJG2HPR |
create from WOO X console |
timestamp |
1578565539808 |
Unix epoch time in milliseconds |
Hash your request parameters with api_secret
, the hashing logic is described as follows:
If the request looks like:
POST /v1/order
# Body parameter:
symbol:SPOT_BTC_USDT
order_type:LIMIT
order_price:9000
order_quantity:0.11
side:BUY
For v1
API, please follow the steps to normalize request content:
- use query string as the parameters for GET methods and body parameters for POST and DELETE methods.
- concat query string and body parameters in an alphabetical order in query string format.
- concat
timestamp
with the above result, using|
as seperator.
Normalize request content for V1 API, The result content would look like following
order_price=9000&order_quantity=0.11&order_type=LIMIT&side=BUY&symbol=SPOT_BTC_USDT|1578565539808
For v3
API using request body to pass the parameters, please concatenate the timestamp
, http request method
, request_path
and request_body
as the normalized content to sign. Besides, please use application/json
as Content-Type
in the headers.
var signString = timestamp + method + request_path + request_body;
Normalize request content for V3 API, The result content would look like following
1578565539808POST/v3/algo/order{
"symbol": "PERP_BTC_USDT",
"side": "BUY",
"reduceOnly": false,
"type": "MARKET",
"quantity": "1",
"algoType": "TRAILING_STOP",
"callbackRate": "0.012"
}
Then use
api_secret
to hash it with HMACSHA256
algorithm, you can useopenssl
to get this:
$ echo -n "order_price=9000&order_quantity=0.11&order_type=LIMIT&side=BUY&symbol=SPOT_BTC_USDT|1578565539808" | openssl dgst -sha256 -hmac "QHKRXHPAW1MC9YGZMAT8YDJG2HPR"
(stdin)= 20da0852f73b20da0208c7e627975a59ff072379883d8457d03104651032033d
Put the HMAC signature in request header x-api-signature
, and put timestamp in x-api-timestamp
, and also api key in x-api-key
.
So the final request would look like:
Security
There have three-layer checker to check if a request is valid. WOO X server only accepts the request that passed all checkers. The checker is defined as follows:
Revoken checker:
The api key/secret can be revoked manaually by clients' request. if the key was revoked, all access tokens generated by this key cannot be used.
Request IP checker:
The api key/secret can be tied to specific ips (default is empty). if the request is not coming from allowed ip addresses, the request would be rejected.
Request Timestamp checker:
The request would be considered expired and get rejected if the timestamp in x-api-timestamp
header has a 300+ second difference from the API server time.
HMAC Parameter Signature:
The request must have a x-api-signature
header that is generated from request parameters and signed with your secret key.
Error Codes
Errors consist of three parts: an error code and a message. Codes are universal, but messages can vary. Here is the error JSON payload:
{
"success": false,
"code": -1001, // Error code
"message": "order_price must be a positive number" // Detail message
}
Error Code | Status Code | Error Name | Description |
---|---|---|---|
-1000 |
500 | UNKNOWN |
An unknown error occurred while processing the request. |
-1001 |
401 | INVALID_SIGNATURE |
The api key or secret is in wrong format. |
-1002 |
401 | UNAUTHORIZED |
API key or secret is invalid, it may be because the key has insufficient permission or the key is expired/revoked. |
-1003 |
429 | TOO_MANY_REQUEST |
Rate limit exceed. |
-1004 |
400 | UNKNOWN_PARAM |
An unknown parameter was sent. |
-1005 |
400 | INVALID_PARAM |
Some parameters are in the wrong format for api. |
-1006 |
400 | RESOURCE_NOT_FOUND |
The data is not found in the server. For example, when the client try canceling a CANCELLED order, will raise this error. |
-1007 |
409 | DUPLICATE_REQUEST |
The data already exists or your request is duplicated. |
-1008 |
400 | QUANTITY_TOO_HIGH |
The quantity of settlement is higher than you can request. |
-1009 |
400 | CAN_NOT_WITHDRAWAL |
Can not request withdrawal settlement, you need to deposit other arrears first. |
-1011 |
400 | RPC_NOT_CONNECT |
Can not place/cancel orders, it may be because of internal network error. Please try again in a few seconds. |
-1012 |
400 | RPC_REJECT |
The place/cancel order request is rejected by internal module, it may be because the account is in liquidation or other internal errors. Please try again in a few seconds. |
-1101 |
400 | RISK_TOO_HIGH |
The risk exposure for the client is too high, it may be caused by sending too big order or the leverage is too low. please refer to client info to check the current exposure. |
-1102 |
400 | MIN_NOTIONAL |
The order value (price * size) is too small. |
-1103 |
400 | PRICE_FILTER |
The order price is not following the tick size rule for the symbol. |
-1104 |
400 | SIZE_FILTER |
The order quantity is not following the step size rule for the symbol. |
-1105 |
400 | PERCENTAGE_FILTER |
Price is X% too high or X% too low from the mid price. |
RESTful API
Exchange Information
Limit: 10 requests per 1 second per IP address
GET /v1/public/info/:symbol
Get send order requirement by symbol, there are some rules need to be fullfilled in order to successfully send order, which are defined as follows:
Price filter
price
>=quote_min
price
<=quote_max
(price - quote_min) % quote_tick
should equal to zeroprice
<=asks[0].price * (1 + price_range)
when BUYprice
>=bids[0].price * (1 - price_range)
when SELL
Size filter
base_min
<=quantity
<=base_max
(quantity - base_min) % base_tick
should equal to zero
Min Notional filter
price * quantity
should greater thanmin_notional
Risk Exposure filer
- For margin trading, the margin rate should exceed a certain threshold as per leverage. For spot trading, the order size should be within the holding threshold. See account_info
Response
{
"success": true,
"info": {
"symbol": "SPOT_BTC_USDT",
"quote_min": 100,
"quote_max": 100000,
"quote_tick": 0.01,
"base_min": 0.0001,
"base_max": 20,
"base_tick": 0.0001,
"min_notional": 0.02,
"price_range": 0.5,
"price_scope": 0.1,
"created_time": "1575014248.99", // Unix epoch time in seconds
"updated_time": "1575014248.99" // Unix epoch time in seconds
}
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y |
System Status (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/system_info
For fetch system status to check if system is down or under maintenance.
Response
{
"success":true,
"data":
{
"status":0,
"msg":"System is functioning properly."
},
"timestamp":1676335013700
}
Parameters
None
Available Symbols (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/info
Get the available symbols that WOO X supports, and also send order rules for each symbol. The definition of rules can be found at Exchange Infomation
Response
{
"success": true,
"rows": [
{
"created_time": "1575441595.65", // Unix epoch time in seconds
"updated_time": "1575441595.65", // Unix epoch time in seconds
"symbol": "SPOT_BTC_USDT",
"quote_min": 100,
"quote_max": 100000,
"quote_tick": 0.01,
"base_min": 0.0001,
"base_max": 20,
"base_tick": 0.0001,
"min_notional": 0.02,
"price_range": 0.99,
"price_scope": 0.01
},
// ...
]
}
Parameters
None
Orderbook snapshot (Public)
Limit: 10 requests per 1 second
GET /v1/public/orderbook/:symbol
SNAPSHOT of current orderbook. Price of asks/bids are in descending order.
Note: The original endpoint GET /v1/orderbook/:symbol
can still be used.
Response
{
"success": true,
"asks": [
{
"price": 10669.4,
"quantity": 1.56263218
},
{
"price": 10670.3,
"quantity": 0.36466977
},
{
"price": 10670.4,
"quantity": 0.06738009
}
],
"bids": [
{
"price": 10669.3,
"quantity": 0.88159988
},
{
"price": 10669.2,
"quantity": 0.5
},
{
"price": 10668.9,
"quantity": 0.00488286
}
],
"timestamp": 1564710591905 // Unix epoch time in milliseconds
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
max_level | number | N (default: 100) | the levels you wish to show on both sides. |
Kline (Public)
Limit: 10 requests per 1 second
GET /v1/public/kline
The latest klines of the trading pairs.
Note: The original endpoint GET /v1/kline
can still be used.
Response
{
"success": true,
"rows": [
{
"open": 66166.23,
"close": 66124.56,
"low": 66038.06,
"high": 66176.97,
"volume": 23.45528526,
"amount": 1550436.21725288,
"symbol": "SPOT_BTC_USDT",
"type": "1m",
"start_timestamp": 1636388220000, // Unix epoch time in milliseconds
"end_timestamp": 1636388280000
},
{
"open": 66145.13,
"close": 66166.24,
"low": 66124.62,
"high": 66178.60,
"volume": 15.50705000,
"amount": 1025863.18892610,
"symbol": "SPOT_BTC_USDT",
"type": "1m",
"start_timestamp": 1636388160000,
"end_timestamp": 1636388220000
},
// ...skip
]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | |
type | enum | Y | 1m /5m /15m /30m /1h /4h /12h /1d /1w /1mon /1y |
limit | number | N (default: 100) | Numbers of klines. Maximum of 1000 klines. |
Kline - Historical Data (Public)
Limit: 1 request per 1 second per IP
GET https://api-pub.woo.org/v1/hist/kline
The historical klines of the trading pairs. Note that the endpoint is different with other APIs.
Response
{
"success": true,
"data": {
"rows": [
{
"open": 66166.23,
"close": 66124.56,
"low": 66038.06,
"high": 66176.97,
"volume": 23.45528526,
"amount": 1550436.21725288,
"symbol": "SPOT_BTC_USDT",
"type": "1m",
"start_timestamp": 1636388220000, // Unix epoch time in milliseconds
"end_timestamp": 1636388280000
},
{
"open": 66145.13,
"close": 66166.24,
"low": 66124.62,
"high": 66178.60,
"volume": 15.50705000,
"amount": 1025863.18892610,
"symbol": "SPOT_BTC_USDT",
"type": "1m",
"start_timestamp": 1636388160000,
"end_timestamp": 1636388220000
},
// ...skip
]
"meta":{
"total":67377,
"records_per_page":100,
"current_page":1
}
}
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | |
type | enum | Y | 1m /5m /15m /30m /1h /4h /12h /1d /1w /1mon |
start_time | number | Y | start range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
Market Trades (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/market_trades
Get latest market trades. The response output "source" 1=internal (trade on WOO X), 0=external (trade from aggregrated sources)
Response
{
"success": true,
"rows": [
{
"symbol": "SPOT_ETH_USDT",
"side": "BUY",
"source": 0,
"executed_price": 202,
"executed_quantity": 0.00025,
"executed_timestamp": "1567411795.000" // Unix epoch time in seconds
},
{
"symbol": "SPOT_ETH_USDT",
"side": "BUY",
"source": 1,
"executed_price": 202,
"executed_quantity": 0.00025,
"executed_timestamp": "1567411795.000" // Unix epoch time in seconds
}
]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | |
limit | number | N (default: 10) | Numbers of trades you want to query. |
Market Trades History(Public)
Limit: 10 requests per 1 second per IP address
GET https://api-pub.woo.org/v1/hist/trade
Get historical market trades data. The response output "source" 1=internal (trade on WOO X), 0=external (trade from aggregrated sources)
Response
{
"success": true,
"data":{
"rows": [
{
"symbol": "SPOT_ETH_USDT",
"side": "BUY",
"source": 0,
"executed_price": 202,
"executed_quantity": 0.00025,
"executed_timestamp": "1567411795.000" // Unix epoch time in seconds
},
{
"symbol": "SPOT_ETH_USDT",
"side": "BUY",
"source": 1,
"executed_price": 202,
"executed_quantity": 0.00025,
"executed_timestamp": "1567411795.000" // Unix epoch time in seconds
}
],
"meta":{
"total":10911159,
"records_per_page":100,
"current_page":1
}
},
"timestamp":1669072422897
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
page | number | N (default: 1) | |
size | number | N (default: 1) | |
start_time | number | Y | start range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
symbol | string | Y |
Available Token (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/token
Get the available tokens that WOO X supports, it need to use when you call get deposit address or withdraw api.
Response
{
"success": true,
"rows": [
{
"created_time": "1579399877.02", // Unix epoch time in seconds
"updated_time": "1579399877.02", // Unix epoch time in seconds
"token": "BTC",
"balance_token": "BTC",
"fullname": "Bitcoin",
"decimals": 8,
"can_collateral":true,
"can_short":true
},
{
"created_time": "1579399877.02",
"updated_time": "1579399877.02",
"token": "BTC_USDT",
"balance_token": "USDT",
"fullname": "Tether",
"decimals": 8,
"can_collateral":true,
"can_short":true
},
{
"created_time": "1579399877.02",
"updated_time": "1579399877.02",
"token": "ETH",
"balance_token": "ETH",
"fullname": "Ethereum",
"decimals": 18,
"can_collateral":true,
"can_short":true
},
{
"created_time": "1579399877.02",
"updated_time": "1579399877.02",
"token": "ETH_OKB",
"balance_token": "OKB",
"fullname": "OKB",
"decimals": 18,
"can_collateral":true,
"can_short":true
}
]
}
Parameters
None
Token Network (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/token_network
Get the available networks for each token as well as the deposit/withdrawal information.
Response
{
"success": true,
"rows": [
{
"protocol": "BTC",
"token": "BTC",
"name": "Bitcoin",
"minimum_withdrawal": 0.01,
"withdrawal_fee": 0.05,
"allow_deposit": 1,
"allow_withdraw": 1
},
{
"protocol": "ERC20",
"token": "ETH",
"name": "Ethereum",
"minimum_withdrawal": 0.03,
"withdrawal_fee": 0.06,
"allow_deposit": 1,
"allow_withdraw": 1
},
{
"protocol": "ERC20",
"token": "WOO",
"name": "Ethereum",
"minimum_withdrawal": 30,
"withdrawal_fee": 20,
"allow_deposit": 1,
"allow_withdraw": 1
},
{
"protocol": "BEP20",
"token": "WOO",
"name": "Binance Smart Chain",
"minimum_withdrawal": 30,
"withdrawal_fee": 3,
"allow_deposit": 1,
"allow_withdraw": 1
},
// ...
]
}
Parameters
None
Get Predicted Funding Rate for All Markets (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/funding_rates
Get predicted funding rate and the latest funding rate for all the markets.
Response
{
"success":true,
"rows": [
{
"symbol":"PERP_BTC_USDT",
"est_funding_rate":-0.00001392,
"est_funding_rate_timestamp":1681069199002,
"last_funding_rate":-0.00001666,
"last_funding_rate_timestamp":1681066800000,
"next_funding_time":1681070400000,
"last_funding_rate_interval":1,
"est_funding_rate_interval":1
},
{
"symbol":"PERP_ETH_USDT",
"est_funding_rate":-0.00001394,
"est_funding_rate_timestamp":1681069319011,
"last_funding_rate":-0.00001661,
"last_funding_rate_timestamp":1681066800000,
"next_funding_time":1681070400000,
"last_funding_rate_interval":1,
"est_funding_rate_interval":1
}
],
"timestamp":1681069222726, // Unix epoch time in milliseconds
}
Get Predicted Funding Rate for One Market (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/funding_rate/:symbol
Get predicted funding rate and the latest funding rate for one market.
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y |
Response
{
"success":true,
"timestamp":1681069222726,
"symbol":"PERP_BTC_USDT",
"est_funding_rate":-0.00001392,
"est_funding_rate_timestamp":1681069199002,
"last_funding_rate":-0.00001666,
"last_funding_rate_timestamp":1681066800000,
"next_funding_time":1681070400000,
"last_funding_rate_interval":1,
"est_funding_rate_interval":1
}
Get Funding Rate History for One Market (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/funding_rate_history
Get funding rate for one market.
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | |
start_t | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. If start_t and end_t are not filled, the newest funding rate will be returned. |
end_t | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. If start_t and end_t are not filled, the newest funding rate will be returned. |
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 10) | max 5000 |
Response
{
"success": true,
"meta": {
"total": 670,
"records_per_page": 25,
"current_page": 1
},
"rows": [
{
"symbol": "PERP_BTC_USDT",
"funding_rate": 0.12345689,
"funding_rate_timestamp": 1567411795000, // use rate to end calculating funding fee time
"next_funding_time": 1567411995000
},
{
"symbol": "PERP_BTC_USDT",
"funding_rate": 0.12345689,
"funding_rate_timestamp": "1567411795.000", // use rate to end calculating funding fee time
"next_funding_time": 1567411995000
}
],
"timestamp": 1564710591905 // Unix epoch time in milliseconds
}
Get Futures Info for All Markets (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/futures
Get basic futures information for all the markets.
Response
{
"success": true,
"rows": [
{
"symbol": "PERP_BTC_USDT",
"index_price": 56727.31344564,
"mark_price": 56727.31344564,
"est_funding_rate": 0.12345689,
"last_funding_rate": 0.12345689,
"next_funding_time": 1567411795000,
"open_interest": 0.12345689,
"24h_open": 0.16112,
"24h_close": 0.32206,
"24h_high": 0.33000,
"24h_low": 0.14251,
"24h_volume": 89040821.98,
"24h_amount": 22493062.21
},
{
"symbol": "PERP_ETH_USDT",
"index_price": 6727.31344564,
"mark_price": 6727.31344564,
"est_funding_rate": 0.12345689,
"last_funding_rate": 0.12345689,
"next_funding_time": 1567411795000,
"open_interest": 0.12345689,
"24h_open": 0.16112,
"24h_close": 0.32206,
"24h_high": 0.33000,
"24h_low": 0.14251,
"24h_volume": 89040821.98,
"24h_amount": 22493062.21
}
],
"timestamp": 1564710591905 // Unix epoch time in milliseconds
}
Get Futures for One Market (Public)
Limit: 10 requests per 1 second per IP address
GET /v1/public/futures/:symbol
Get basic futures information for one market.
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y |
Response
{
"success": true,
"info":{
"symbol": "PERP_BTC_USDT",
"index_price": 56727.31344564,
"mark_price": 56727.31344564,
"est_funding_rate": 0.12345689,
"last_funding_rate": 0.12345689,
"next_funding_time": 1567411795000,
"open_interest": 0.12345689,
"24h_open": 0.16112,
"24h_close": 0.32206,
"24h_high": 0.33000,
"24h_low": 0.14251,
"24h_volume": 89040821.98,
"24h_amount": 22493062.21
},
"timestamp": 1564710591905 // Unix epoch time in milliseconds
}
Token Config
Limit: 10 requests per 1 second
GET /v1/client/token
Get the configuration (collateral ratio, margin ratio factor etc) of the token.
Response
{
"success": true,
"rows": [
{
"token": "BTC",
"collateral_ratio": 0.85,
"margin_factor": 2.3e-8,
"futures_margin_factor": 2.3e-8,
"collateral": true, // if the token is now used as collateral
"can_collateral": true, // if the token can be used as collateral
"can_short": true, // if the token supports short selling
"stable": false // if the token is stable coin or not
},
{
"token": "ETH",
"collateral_ratio": 0.85,
"margin_factor": 2.5e-8,
"futures_margin_factor": 2.3e-8,
"collateral": true,
"can_collateral": true,
"can_short": true,
"stable": false
},
{
"token": "ASD",
"collateral_ratio": 1,
"margin_factor": 0,
"futures_margin_factor": 0,
"collateral": false,
"can_collateral": false,
"can_short": false,
"stable": false
}
]
}
Parameters
None
Send Order
Limit: 2 requests per 1 symbol per 1 second
POST /v1/order
Place order maker/taker, the order executed information will be updated from websocket stream. will respond immediately with an order created message.
MARKET
type order behavior: it matches until all size is executed. If the size is too large (larger than the whole book) or the matching price exceeds the price limit (refer to price_range
), then the remaining quantity will be cancelled.
IOC
type order behavior: it matches as much as possible at the order_price. If not fully executed, then remaining quantity will be cancelled.
FOK
type order behavior: if the order can be fully executed at the order_price then the order gets fully executed otherwise it would be cancelled without any execution.
ASK
type order behavior: the order price is guaranteed to be the best ask price of the orderbook if it gets accepted.
BID
type order behavior: the order price is guaranteed to be the best bid price of the orderbook if it gets accepted.
visible_quantity
behavior: it sets the maximum quantity to be shown on orderbook. By default, it is equal to order_quantity, negative number and number larger than order_quantity
is not allowed.
If it sets to 0, the order would be hidden from the orderbook.
It doesn't work for MARKET
/IOC
/FOK
orders since orders with these types would be executed and cancelled immediately and not be shown on orderbook.
For LIMIT
/POST_ONLY
order, as long as it's not complete, visible_quantity
is the maximum quantity that is shown on the orderbook.
order_amount
behavior: for MARKET
/BID
/ASK
order, order can be placed by order_amount
instead of order_quantity
. It's the size of the order in terms of the quote currency instead of the base currency. The order would be rejected if both order_amount
and order_quantity
are provided. The precision of the number should be within 8 digits.
client_order_id
behavior: customized order_id, a unique id among open orders. Orders with the same client_order_id
can be accepted only when the previous one if completed, otherwise the order will be rejected.
For MARKET
/BID
/ASK
order, if margin trading is disabled, order_amount
is not supported when placing SELL order while order_quantity
is not supported when placing BUY order.
Response
{
"success": true,
"order_id": 13,
"client_order_id": 0,
"order_type": "LIMIT",
"order_price": 100.12,
"order_quantity": 0.987654,
"order_amount": null,
"reduce_only": false,
"timestamp": "1639980423.855" // Unix epoch time in seconds
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | |
broker_id | string | N | broker id, for broker service provider, please use your application id as broker id |
client_order_id | number | N | number for scope : from 0 to 9223372036854775807. (default: 0) |
order_tag | string | N | An optional tag for this order. (default: default ) |
order_type | enum | Y | LIMIT /MARKET /IOC /FOK /POST_ONLY /ASK /BID |
order_price | number | N | If order_type is MARKET , then is not required, otherwise this parameter is required. |
order_quantity | number | N | For MARKET /ASK /BID order, if order_amount is given, it is not required. |
order_amount | number | N | For MARKET /ASK /BID order, the order size in terms of quote currency |
reduce_only | boolean | N | true or false, default false |
visible_quantity | number | N | The order quantity shown on orderbook. (default: equal to order_quantity ) |
side | enum | Y | SELL /BUY |
Cancel Order
Limit: 10 requests per 1 second shared with cancel_order_by_client_order_id
DELETE /v1/order
Cancel order by order id. The order cancelled information will be updated from websocket stream. note that we give an immediate response with an order cancel sent message, and will update the cancel event via the websocket channel.
Response
{
"success": true,
"status": "CANCEL_SENT"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
order_id | number | Y | The order_id that you wish tocancel |
symbol | string | Y |
Cancel Order by client_order_id
Limit: 10 requests per 1 second shared with cancel_order
DELETE /v1/client/order
Cancel order by client order id. The order cancelled information will be updated from websocket stream. note that we give an immediate response with an order cancel sent message, and will update the cancel event via the websocket channel.
Only the latest order with the symbol
and client_order_id
would be canceled.
Response
{
"success": true,
"status": "CANCEL_SENT"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
client_order_id | number | Y | The client_order_id that you wish tocancel |
symbol | string | Y |
Cancel Orders
Limit: 10 requests per 1 second
DELETE /v1/orders
Cancel orders by symbol.
Response
{
"success": true,
"status": "CANCEL_ALL_SENT"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | |
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 1) |
Cancel All Pending Orders
Limit: 10 requests per 1 second
DELETE /v3/orders/pending
Cancel all pending ordinary orders.
Response
// success response
{
"success": true,
"status": "CANCEL_ALL_SENT"
}
// Failed response
{
"success": false,
"code": -1002,
"message": "The request is unauthorized."
}
Get Order
Limit: 10 requests per 1 second shared with get_order_by_client_order_id
GET /v1/order/:oid
Get specific order details by order_id
.
The realized_pnl
field in response will only present the settled amount for futures orders.
Response
{
"success": true,
"created_time": "1577349119.33", // Unix epoch time in seconds
"side": "SELL",
"status": "FILLED",
"symbol": "SPOT_BTC_USDT",
"client_order_id": 0,
"reduce_only": false,
"order_id": 1,
"order_tag": "default",
"type": "LIMIT",
"price": 123,
"quantity": 0.1,
"amount": null,
"visible": 0.1,
"executed": 0.1,
"total_fee": 0.00123,
"fee_asset": "USDT",
"average_executed_price": 123,
"realized_pnl":null,
// Detail transactions of this order
"Transactions": [
{
"id": 2,
"symbol": "SPOT_BTC_USDT",
"fee": 0.0001,
"fee_asset": "BTC", // fee. use Base (BTC) as unit when BUY, use Quote (USDT) as unit when SELL
"side": "BUY",
"order_id": 1,
"executed_price": 123,
"executed_quantity": 0.05,
"executed_timestamp": "1567382401.000", // Unix epoch time in seconds
"is_maker": 1
}]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
oid | number | Y | The order_id oid that you wish to query |
Get Order by client_order_id
Limit: 10 requests per 1 seconds shared with get_order
GET /v1/client/order/:client_order_id
Get specific order details by client_order_id
. If there is more than one order with the same client_order_id
, return the latest one.
The realized_pnl
field in response will only present the settled amount for futures orders.
Response
{
"success": true,
"created_time": "1577349119.33", // Unix epoch time in seconds
"side": "SELL",
"status": "FILLED",
"symbol": "SPOT_BTC_USDT",
"client_order_id": 123,
"reduce_only": false,
"order_id": 1,
"order_tag": "default",
"type": "LIMIT",
"price": 123,
"quantity": 0.1,
"amount": null,
"visible": 0.1,
"executed": 0.1,
"total_fee": 0.00123,
"fee_asset": "USDT",
"average_executed_price": 123,
"realized_pnl":null,
// Detail transactions of this order
"Transactions": [
{
"id": 2,
"symbol": "SPOT_BTC_USDT",
"fee": 0.0001,
"fee_asset": "BTC", // fee. use Base (BTC) as unit when BUY, use Quote (USDT) as unit when SELL
"side": "BUY",
"order_id": 1,
"executed_price": 123,
"executed_quantity": 0.05,
"executed_timestamp": "1567382401.000", // Unix epoch time in seconds
"is_maker": 1
}]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
client_order_id | number | Y | customized order_id when placing order |
Get Orders
Limit: 10 requests per 1 second
GET /v1/orders
Get orders by customize conditions.
- INCOMPLETE
= NEW
+ PARTIAL_FILLED
- COMPLETED
= CANCELLED
+ FILLED
+ REJECTED
The realized_pnl
field in response will only present the settled amount for futures orders. The return value default is null unless the input parameter realized_pnl
set to true
Response
{
"success": true,
"meta": {
"total": 31,
"records_per_page": 25,
"current_page": 1
},
"rows": [
{
"side": "SELL",
"status": "CANCELLED",
"symbol": "SPOT_BCHABC_USDT",
"client_order_id": 123,
"reduce_only": false,
"order_id": 8197,
"order_tag": "default",
"type": "LIMIT",
"price": 308.51,
"quantity": 0.0019,
"amount": null,
"visible": 0.0019,
"executed": 0,
"total_fee": 0,
"fee_asset": null,
"created_time": "1575014255.089", // Unix epoch time in seconds
"updated_time": "1575014255.910", // Unix epoch time in seconds
"average_executed_price": null,
"realized_pnl":null
},
// ....skip (total 25 items in one page)
]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | N | |
side | string | N | BUY /SELL |
size | number | N | The page size, default 100, max 500. |
order_type | string | N | LIMIT /MARKET /IOC /FOK /POST_ONLY /LIQUIDATE |
order_tag | string | N | An optional tag for this order. |
realized_pnl | boolean | N | Decide if return data calculate realized pnl value for the futures order. |
status | enum | N | NEW /CANCELLED /PARTIAL_FILLED /FILLED /REJECTED /INCOMPLETE /COMPLETED |
start_t | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
end_t | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
page | number | N (default: 1) | the page you wish to query. |
Edit Order
Limit: 5 requests per 1 second
PUT /v3/order/:order_id
**Note that for v3 API with json body POST method, please follow the instruction in authentication section for v3
API to generate the signature.
**Please use string
type for value input field to remain data accurancy.
The API allow you to edit the price and the quantity of the selected order. You must input at least one of it in the request body.
Response
// Success response
{
"success": true,
"data": {
"success": true,
"status": "EDIT_SENT"
},
"timestamp": 1673842319229
}
// Failed response
{
"success": false,
"code": -1103,
"message": "The order does not meet the price filter requirement."
}
Request
{
"price": "10.5",
"quantity": "1.4"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
order_id | number | Y | The order_id that you wish to query |
price | string | N | New price of the order. |
quantity | string | N | New quantity of the order. |
Edit Order by client_order_id
Limit: 5 requests per 1 second
PUT /v3/order/client/:client_order_id
**Note that for v3 API with json body POST method, please follow the instruction in authentication section for v3
API to generate the signature.
**Please use string
type for value input field to remain data accurancy.
The API allow you to edit the price and the quantity of the selected order. You must input at least one of it in the request body.
Response
// Success response
{
"success": true,
"data": {
"success": true,
"status": "EDIT_SENT"
},
"timestamp": 1673842319229
}
// Failed response
{
"success": false,
"code": -1103,
"message": "The order does not meet the price filter requirement."
}
Request
{
"price": "10.5",
"quantity": "1.4"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
client_order_id | number | Y | customized order_id when placing order |
price | string | N | New price of the order. |
quantity | string | N | New quantity of the order. |
Send Algo Order
Limit: 2 requests per 1 second per symbol
POST /v3/algo/Order
**Note that for v3 API, please follow the instruction in authentication section for v3
API to generate the signature.
**Please use string
type for value input field to remain data accurancy.
Place algo order maker/taker, the order executed information will be updated from websocket stream. will respond immediately with an order created message.
To place Stop Market
order, please use 'STOP' as algoType
and 'MARKET' as type
. Please input the trigger price in triggerPrice
field.
To place Stop Limit
order, please use 'STOP' as algoType
and 'LIMIT' as type
. Please input the trigger price in triggerPrice
field.
To place Trailing Stop
order, please use 'TRAILING_STOP' as algoType
and 'MARKET' as type
. Please also input your trailing rate setting in callbackRate
field.
To place OCO
order, the input fields is 2 layer and includes an array of the objects named childOrder
. The second order of OCO order should be a STOP_LIMIT or STOP MARKET order object in the array. please use 'OCO' as algoType
in outter parameters, 'STOP' as algoType
in childOrder
object, and 'LIMIT' or 'MARKET' as type.
To place Positional TP/SL
order, the input fields is 2 layer and includes an array of the objects named childOrder
. The take-profit or stop-loss order should be the objects in the array. For the sub-order in childOrder
, please input 'CLOSE_POSITION' as type
, and 'TAKE_PROFIT' or 'STOP_LOSS' in algoType
field.
visible_quantity
behavior: it sets the maximum quantity to be shown on orderbook. By default, it is equal to order_quantity, negative number and number larger than order_quantity
is not allowed. The visibility of the childOrder will inherit the parent order's visibility setting.
If it sets to 0, the order would be hidden from the orderbook.
It doesn't work for MARKET
orders since orders with these types would be executed and cancelled immediately and not be shown on orderbook.
For LIMIT
order, as long as it's not complete, visible_quantity
is the maximum quantity that is shown on the orderbook.
client_order_id
behavior: customized order_id, a unique id among open orders. Orders with the same client_order_id
can be accepted only when the previous one if completed, otherwise the order will be rejected.
Response
{
"code": 0,
"data": {
"rows": [
{
"algoType": "string",
"clientOrderId": 0,
"orderId": 0,
"quantity": 0
}
]
},
"message": "string",
"success": true,
"timestamp": 0
}
// bracket order response
{
"success": true,
"data": {
"rows": [
{
"orderId": 432132,
"clientOrderId": 0,
"algoType": "TAKE_PROFIT",
"quantity": 0
},
{
"orderId": 432133,
"clientOrderId": 0,
"algoType": "STOP_LOSS",
"quantity": 0
},
{
"orderId": 432131,
"clientOrderId": 0,
"algoType": "POSITIONAL_TP_SL",
"quantity": 0
},
{
"orderId": 432130,
"clientOrderId": 0,
"algoType": "BRACKET",
"quantity": 10
}
]
},
"timestamp": 1676283560233
}
Request ```js // stop market order
{ "symbol":"PERP_BTC_USDT", "side":"BUY", "orderCombinationType":"STOP_MARKET", "algoType":"STOP", "triggerPrice":"1000", "type":"MARKET", "quantity":"0.01" }
//stop market limit
{ "symbol":"PERP_BTC_USDT", "side":"BUY", "orderCombinationType":"STOP_LIMIT", "algoType":"STOP", "triggerPrice":"1000", "type":"LIMIT", "quantity":"0.01", "price":1000 }
//OCO
{ "symbol": "PERP_ETH_USDT", "side": "BUY", "reduceOnly": false, "type": "LIMIT", "quantity": "1", "algoType": "OCO", "price": "1000", "childOrders": [ { "side": "BUY", "algoType": "STOP", "triggerPrice": "1600", "type": "MARKET" } ] }
//Positional TP/SL
{ "symbol": "SPOT_BAL_USDT", "reduceOnly": false, "algoType": "POSITIONAL_TP_SL", "childOrders": [ { "algoType": "TAKE_PROFIT", "type": "CLOSE_POSITION", "side": "BUY", "reduceOnly": true, "triggerPrice": "72" }, { "algoType": "STOP_LOSS", "type": "CLOSE_POSITION", "side": "BUY", "reduceOnly": true, "triggerPrice": "74" } ] }
// Bracket order
{ "symbol": "SPOT_BAL_USDT", "side": "BUY", "reduceOnly": false, "type": "LIMIT", "quantity": "1", "algoType": "BRACKET", "price": "69", "childOrders": [ { "symbol": "SPOT_BAL_USDT", "reduceOnly": false, "algoType": "POSITIONAL_TP_SL", "childOrders": [ { "algoType": "TAKE_PROFIT", "type": "CLOSE_POSITION", "side": "SELL", "reduceOnly": true, "triggerPrice": "76" }, { "algoType": "STOP_LOSS", "type": "CLOSE_POSITION", "side": "SELL", "reduceOnly": true, "triggerPrice": "50" } ] } ] } ```
Parameters - Parent
Name | Type | Required | Description |
---|---|---|---|
activatedPrice | string | N | activated price for algoType=TRAILING_STOP |
algoType | string | Y | STOP |
brokerId | string | N | broker id, for broker service provider, please use your application id as broker id |
callbackRate | string | N | callback rate, only for algoType=TRAILING_STOP, i.e. the value = 0.1 represent to 10%. |
callbackValue | string | N | callback value, only for algoType=TRAILING_STOP, i.e. the value = 100 |
childOrders | child | N | Child orders for algoType=POSITIONAL_TP_SL |
symbol | string | Y | |
clientOderId | number | N | Client order id defined by client. Duplicated client order id on opening order is not allowed. |
orderTag | string | N | An optional tag for this order. (default: default ) |
price | string | N | order price |
quantity | string | N | Order quantity, only optional for algoType=POSITIONAL_TP_SL |
reduceOnly | boolean | N | true or false, default false |
triggerPrice | string | N | trigger price, if algoType=TRAILING_STOP, you need to provide 'activatedPrice' |
triggerPriceType | string | N | trigger price, default MARKET_PRICE , enum: MARKET_PRICE |
type | string | Y | LIMIT /MARKET |
visibleQuantity | number | N | The order quantity shown on orderbook. (default: equal to orderQuantity ) |
side | enum | Y | SELL /BUY |
Parameters - Child
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | |
algoType | string | Y | STOP |
side | enum | Y | SELL /BUY |
type | string | Y | LIMIT /MARKET |
triggerPrice | string | N | trigger price, if algoType=TRAILING_STOP, you need to provide 'activatedPrice' |
price | string | N | order price |
reduceOnly | boolean | N | true or false, default false |
childOrders | child | N | Child orders for algoType=POSITIONAL_TP_SL |
Cancel Algo Order
Limit: 10 requests per 1 second shared with cancel_algo_order_by_client_order_id
DELETE /v3/algo/order/:order_id
***Note: This v3 API using query string to pass parameter, please follow the instruction in authentication section for v3
API to generate the signature.
Cancel order by order id. The order cancelled information will be updated from websocket stream.
note that we give an immediate response with an order cancel sent message, and will update the cancel event via the websocket channel.
Response
// Success response
{
"success": true,
"status": "CANCEL_SENT"
}
// Failed response
"success": false,
"code": -1006,
"message": "Your order and symbol are not valid or already canceled."
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
order_id | number | Y | The order_id that youwish to cancel |
Cancel All Pending Algo Orders
Limit: 10 requests per 1 second
DELETE /v3/algo/orders/pending
***Note: This v3 API using query string to pass parameter, please follow the instruction in authentication section for v3
API to generate the signature.
Cancel all pending algo orders.
Response
// Success response
{
"success": true,
"status": "CANCEL_SENT"
}
// Failed response
"success": false,
"code": -1006,
"message": "Your order and symbol are not valid or already canceled."
}
Cancel Pending Merge Orders by Symbol
Limit: 10 requests per 1 second
DELETE /v3/merge/orders/pending/:symbol
***Note that for v3 API, please follow the instruction in authentication section for v3
API to generate the signature.
Cancel pending algo orders by symbol.
Response
{
"success": true,
"status": "CANCEL_ALL_SENT"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
side | string | N | BUY or SELL |
symbol | string | Y |
Get Algo Order
Limit: 10 requests per 1 second shared with get_algo_order_by_client_order_id
GET /v3/algo/order/:oid
***Note: This v3 API using query string to pass parameter, please follow the instruction in authentication section for v3
API to generate the signature.
Get specific order details by Algo order's oid
.
Response
// Success response
{
"success": true,
"data": {
"algoOrderId": 431601,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 0,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "BRACKET",
"side": "BUY",
"quantity": 11,
"isTriggered": false,
"triggerStatus": "SUCCESS",
"type": "LIMIT",
"status": "FILLED",
"rootAlgoStatus": "FILLED",
"algoStatus": "FILLED",
"triggerPriceType": "MARKET_PRICE",
"price": 0.33,
"triggerTime": "0",
"totalExecutedQuantity": 11,
"averageExecutedPrice": 0.33,
"totalFee": 0.0033,
"feeAsset": "ADA",
"reduceOnly": false,
"createdTime": "1676277825.917",
"updatedTime": "1676280901.229",
"childOrders": [
{
"algoOrderId": 431602,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 431601,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "POSITIONAL_TP_SL",
"side": "SELL",
"quantity": 0,
"isTriggered": false,
"triggerStatus": "USELESS",
"rootAlgoStatus": "FILLED",
"algoStatus": "NEW",
"triggerPriceType": "MARKET_PRICE",
"triggerTime": "0",
"totalExecutedQuantity": 0,
"visibleQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"feeAsset": "",
"reduceOnly": false,
"createdTime": "1676277825.914",
"updatedTime": "1676277825.914",
"isActivated": false,
"childOrders": [
{
"algoOrderId": 431603,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 431602,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "TAKE_PROFIT",
"side": "SELL",
"quantity": 0,
"isTriggered": false,
"triggerStatus": "USELESS",
"type": "CLOSE_POSITION",
"rootAlgoStatus": "FILLED",
"algoStatus": "NEW",
"triggerPriceType": "MARKET_PRICE",
"triggerTime": "0",
"totalExecutedQuantity": 0,
"visibleQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"feeAsset": "",
"reduceOnly": true,
"createdTime": "1676277825.908",
"updatedTime": "1676277872.024",
"isActivated": false
},
{
"algoOrderId": 431604,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 431602,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "STOP_LOSS",
"side": "SELL",
"quantity": 0,
"isTriggered": false,
"triggerStatus": "USELESS",
"type": "CLOSE_POSITION",
"rootAlgoStatus": "FILLED",
"algoStatus": "NEW",
"triggerPriceType": "MARKET_PRICE",
"triggerTime": "0",
"totalExecutedQuantity": 0,
"visibleQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"feeAsset": "",
"reduceOnly": true,
"createdTime": "1676277825.911",
"updatedTime": "1676277872.035",
"isActivated": false
}
]
}
]
},
"timestamp": 1676281474630
}
// Failed response
{
"success": false,
"code": -1006,
"message": "The order can not be found."
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
oid | number | Y | The Algo order's order_id oid that you wish to query |
Get Algo Orders
Limit: 10 requests per 1 second
GET /v3/algo/orders
***Note: This v3 API using query string to pass parameter, please follow the instruction in authentication section for v3
API to generate the signature.
Get orders by customize conditions.
- INCOMPLETE
= NEW
+ PARTIAL_FILLED
- COMPLETED
= CANCELLED
+ FILLED
+ REJECTED
The realizedPnl
field in response will only present the settled amount for futures orders. The return value default is null unless the input parameter realizedPnl
set to true
Response
{
"success": true,
"data": {
"rows": [
{
"algoOrderId": 431601,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 0,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "BRACKET",
"side": "BUY",
"quantity": 11,
"isTriggered": false,
"triggerStatus": "SUCCESS",
"type": "LIMIT",
"status": "FILLED",
"rootAlgoStatus": "FILLED",
"algoStatus": "FILLED",
"triggerPriceType": "MARKET_PRICE",
"price": 0.33,
"triggerTime": "0",
"totalExecutedQuantity": 11,
"averageExecutedPrice": 0.33,
"totalFee": 0.0033,
"feeAsset": "ADA",
"reduceOnly": false,
"createdTime": "1676277825.917",
"updatedTime": "1676280901.229",
"childOrders": [
{
"algoOrderId": 431602,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 431601,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "POSITIONAL_TP_SL",
"side": "SELL",
"quantity": 0,
"isTriggered": false,
"triggerStatus": "USELESS",
"rootAlgoStatus": "FILLED",
"algoStatus": "NEW",
"triggerPriceType": "MARKET_PRICE",
"triggerTime": "0",
"totalExecutedQuantity": 0,
"visibleQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"feeAsset": "",
"reduceOnly": false,
"createdTime": "1676277825.914",
"updatedTime": "1676277825.914",
"isActivated": false,
"childOrders": [
{
"algoOrderId": 431603,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 431602,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "TAKE_PROFIT",
"side": "SELL",
"quantity": 0,
"isTriggered": false,
"triggerStatus": "USELESS",
"type": "CLOSE_POSITION",
"rootAlgoStatus": "FILLED",
"algoStatus": "NEW",
"triggerPriceType": "MARKET_PRICE",
"triggerTime": "0",
"totalExecutedQuantity": 0,
"visibleQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"feeAsset": "",
"reduceOnly": true,
"createdTime": "1676277825.908",
"updatedTime": "1676277872.024",
"isActivated": false
},
{
"algoOrderId": 431604,
"clientOrderId": 0,
"rootAlgoOrderId": 431601,
"parentAlgoOrderId": 431602,
"symbol": "SPOT_ADA_USDT",
"orderTag": "default",
"algoType": "STOP_LOSS",
"side": "SELL",
"quantity": 0,
"isTriggered": false,
"triggerStatus": "USELESS",
"type": "CLOSE_POSITION",
"rootAlgoStatus": "FILLED",
"algoStatus": "NEW",
"triggerPriceType": "MARKET_PRICE",
"triggerTime": "0",
"totalExecutedQuantity": 0,
"visibleQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"feeAsset": "",
"reduceOnly": true,
"createdTime": "1676277825.911",
"updatedTime": "1676277872.035",
"isActivated": false
}
]
}
]
}
],
"meta": {
"total": 436,
"records_per_page": 1,
"current_page": 1
}
},
"timestamp": 1676281407576
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
algoType | string | Y | STOP |
createdTimeEnd | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
createdTimeStart | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
isTriggered | string | N | true or false |
orderTag | string | N | An optional tag for this order. |
page | number | N (default: 1) | pag of query pagination |
realizedPnl | boolean | N | Decide if return data calculate realized pnl value for the futures order. |
side | string | N | BUY /SELL |
size | number | N | size for query pagination |
status | enum | N | NEW /CANCELLED /PARTIAL_FILLED /FILLED /REJECTED /INCOMPLETE /COMPLETED |
symbol | string | N | |
orderType | string | N | LIMIT /MARKET |
Edit Algo Order
Limit: 5 requests per 1 second
PUT /v3/algo/order/:order_id
**Note that for v3 API with json body POST method, please follow the instruction in authentication section for v3
API to generate the signature.
**Please use string
type for value input field to remain data accurancy.
The API allow you to edit the trigger price and the quantity of the selected algo order. You must input at least one of it in the request body.
Response
{
"success": true,
"data": {
"success": true,
"status": "EDIT_SENT"
},
"timestamp": 1676277871935
}
Request
{
"activatedPrice": "200",
"callbackRate": "200",
"callbackValue": "200",
"childOrders": [
{
"algoOrderId": 123456,
"price": "1000",
"quantity": "1000",
"triggerPrice": "1000"
}
],
"price": "1000",
"quantity": "1000",
"triggerPrice": "1000"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
oid | number | Y | The order_id oid that you wish to query |
activatedPrice | string | N | activated price for algoType=TRAILING_STOP |
callbackRate | string | N | new callback rate, only for algoType=TRAILING_STOP, i.e. the value = 0.1 represent to 10%. |
callbackValue | string | N | new callback value, only for algoType=TRAILING_STOP, i.e. the value = 100 |
childOrders | array | N | The array list of the child orders, only for algoType=POSITIONAL_TP_SL or TP_SL |
price | number | N | New price of the algo order. |
quantity | number | N | New quantity of the algo order. |
triggerPrice | number | N | New trigger price of the algo order. |
Edit Algo Order by client_order_id
Limit: 5 requests per 1 second
PUT /v3/algo/order/client/:client_order_id
**Note that for v3 API with json body POST method, please follow the instruction in authentication section for v3
API to generate the signature.
**Please use string
type for value input field to remain data accurancy.
The API allow you to edit the price and the quantity of the selected algo order. You must input at least one of it in the request body.
Response
{
"code": 0,
"data": {
"status": "string",
"success": true
},
"message": "string",
"success": true,
"timestamp": 0
}
Request
{
"activatedPrice": "200",
"callbackRate": "200",
"callbackValue": "200",
"childOrders": [
{
"algoOrderId": 123456,
"price": "1000",
"quantity": "1000",
"triggerPrice": "1000"
}
],
"price": "1000",
"quantity": "1000",
"triggerPrice": "1000"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
oid | number | Y | The order_id oid that you wish to query |
activatedPrice | string | N | activated price for algoType=TRAILING_STOP |
callbackRate | string | N | new callback rate, only for algoType=TRAILING_STOP, i.e. the value = 0.1 represent to 10%. |
callbackValue | string | N | new callback value, only for algoType=TRAILING_STOP, i.e. the value = 100 |
childOrders | array | N | The array list of the child orders, only for algoType=POSITIONAL_TP_SL or TP_SL |
price | number | N | New price of the algo order. |
quantity | number | N | New quantity of the algo order. |
triggerPrice | number | N | New trigger price of the algo order. |
Get Trade
Limit: 10 requests per 1 second
GET /v1/client/trade/:tid
Get specific transaction detail by id
.
Response
{
"success": true,
"id": 1,
"symbol": "SPOT_BTC_USDT",
"fee": 0.0001,
"fee_asset": "BTC", // fee. use Base (BTC) as unit when BUY, use Quote (USDT) as unit when SELL
"side": "BUY",
"order_id": 2,
"executed_price": 123,
"executed_quantity": 0.05,
"is_maker": 0,
"executed_timestamp": "1567382400.000" // Unix epoch time in seconds
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
tid | number | Y | The transaction id tid that you wish to query |
Get Trades
Limit: 10 requests per 1 second
GET /v1/order/:oid/trades
Get trades by order_id
Response
{
"success": true,
"rows": [
{
"id": 5, // transaction id
"symbol": "SPOT_BTC_USDT",
"order_id": 211,
"order_tag": "default",
"executed_price": 10892.84,
"executed_quantity": 0.002,
"is_maker": 0,
"side": "SELL",
"fee": 0,
"fee_asset": "USDT", // use Base (BTC) as unit when BUY, use Quote (USDT) as unit when SELL
"executed_timestamp": "1566264290.250" // Unix epoch time in seconds
}
]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
oid | number | Y | The order id oid that you wish to query |
Get Trade History
Limit: 10 requests per 1 second
GET /v1/client/trades
Return client’s trade history in a range of time.
Response
{
"success": true,
"meta": {
"total": 31,
"records_per_page": 25,
"current_page": 1
},
"rows": [
{
"id": 5, // transaction id
"symbol": "SPOT_BTC_USDT",
"order_id": 211,
"order_tag": "default",
"executed_price": 10892.84,
"executed_quantity": 0.002,
"is_maker": 0,
"side": "SELL",
"fee": 0,
"fee_asset": "USDT", // use Base (BTC) as unit when BUY, use Quote (USDT) as unit when SELL
"executed_timestamp": "1566264290.250" // Unix epoch time in seconds
},
// ....skip (total 25 items in one page)
]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | N | |
order_tag | string | N | An optional tag for this order. |
start_t | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
end_t | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 1) |
Get Staking Yield History
Limit: 10 requests per 1 second
GET /v1/staking/yield_history
Return client’s staking yield history
Response
{
"rows": [
{
"id": 53173,
"token": "WOO",
"user_id": 10174,
"staking_size": 30100.00000000,
"annual_reward": "0.24294%",
"yield_amount": 0.20034259,
"yield_time": "1673481600.000"
},
{
"id": 53029,
"token": "WOO",
"user_id": 10174,
"staking_size": 30100.00000000,
"annual_reward": "0.24294%",
"yield_amount": 0.20034259,
"yield_time": "1673395200.000"
},
{
"id": 52885,
"token": "WOO",
"user_id": 10174,
"staking_size": 30100.00000000,
"annual_reward": "0.24294%",
"yield_amount": 0.20034259,
"yield_time": "1673308800.000"
},
{
"id": 52741,
"token": "WOO",
"user_id": 10174,
"staking_size": 30100.00000000,
"annual_reward": "0.242572%",
"yield_amount": 0.20003858,
"yield_time": "1673222400.000"
},
{
"id": 52597,
"token": "WOO",
"user_id": 10174,
"staking_size": 30100.00000000,
"annual_reward": "0.242572%",
"yield_amount": 0.20003858,
"yield_time": "1673136000.000"
}
],
"meta": {
"total": 582,
"records_per_page": 5,
"current_page": 1
},
"success": true
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 25) | the page size you wish to query, default = 25, 1000 at max. |
token | string | Y | i.e: WOO |
Get Current Holding
Limit: 10 requests per 1 seconds
GET /v1/client/holding
Holding summary of the client. Note that the number in holding could be negative, it means how much the client owes to WOO X.
Response
{
"success": true,
"holding": {
"BTC": 1.014,
"USDT": -26333.207589999998,
"BCHABC": 2
}
}
Parameters
None
Get Current Holding v2
Limit: 10 requests per 1 seconds
GET /v2/client/holding
** Note: This API will be deprecated at the end of 2023 Q1, please find the replacement API in Get Current Holding Get Balance - New Holding summary of client. Note that the number in holding could be negative, it means how much client owed to WOO X.
Response
{
"holding":[
{
"token":"BTC",
"holding":0.00590139,
"frozen":0.0,
"interest":0.0,
"outstanding_holding":-0.00080,
"pending_exposure":0.0,
"opening_cost":-126.36839957,
"holding_cost":-125.69703515,
"realised_pnl":73572.86125165,
"settled_pnl":73573.5326161,
"fee_24_h":0.01432411,
"settled_pnl_24_h":0.67528081,
"updated_time":"1675220398"
},{
"token":"UNI",
"holding":0.00000000,
"frozen":0.00000000,
"interest":0.00000000,
"outstanding_holding":0.00000000,
"pending_exposure":0.00000000,
"opening_cost":0,
"holding_cost":0,
"realised_pnl":0,
"settled_pnl":0,
"fee_24_h":0,
"settled_pnl_24_h":0,
"updated_time":"1655269545"
}
],
"success":true
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
all | enum | N | true /false . If true then will return all tokens even if balance is empty. |
Get Current Holding (Get Balance) - New
Limit: 10 requests per 1 seconds
GET /v3/balances
Holding summary of client. Note that the number in holding could be negative, it means how much client owed to WOO X. The API is design to replace the legacy API Get Current Holding and Get Current Holding v2
Response
{
"success": true,
"data": {
"holding": [
{
"token": "0_token",
"holding": 1,
"frozen": 0,
"staked": 0,
"unbonding": 0,
"vault": 0,
"interest": 0,
"pendingShortQty": 0,
"pendingLongQty": 0,
"availableBalance": 0,
"updatedTime": 312321.121
}
]
},
"timestamp": 1673323746259
}
Parameters
None
Get Account Information
Limit: 10 requests per 60 seconds
GET /v1/client/info
** Note: This API will be deprecated at the end of 2023 Q1, please find the replacement API in Get Account Information - New Get account information such as account name, leverage, current exposure ... etc.
Response
{
"success": true,
"application": {
"application_id": "8935820a-6600-4c2c-9bc3-f017d89aa173",
"account": "CLIENT_ACCOUNT_01",
"alias": "CLIENT_ACCOUNT_01",
"account_mode":"FUTURES" //account mode
"leverage": 5,
"taker_fee_rate": 0,
"maker_fee_rate": 0,
"futures_leverage": 5,
"futures_taker_fee_rate": 0,
"futures_maker_fee_rate": 0,
"otpauth": false
},
"margin_rate": 1000
}
Parameters
None
Get Account Information - New
Limit: 10 requests per 60 seconds
GET /v3/accountinfo
Get account information such as account name, leverage, current exposure ... etc. The API is design to replace the legacy API Get Account Information
Response
{
"success": true,
"data": {
"applicationId": "dsa",
"account": "dsa",
"alias": "haha",
"accountMode": "MARGIN",
"leverage": 1,
"takerFeeRate": 1,
"makerFeeRate": 1,
"interestRate": 1,
"futuresTakerFeeRate": 1,
"futuresMakerFeeRate": 1,
"otpauth": true,
"marginRatio": 1,
"openMarginRatio": 1,
"initialMarginRatio": 1,
"maintenanceMarginRatio": 1,
"totalCollateral": 1,
"freeCollateral": 1,
"totalAccountValue": 1,
"totalVaultValue": 1,
"totalStakingValue": 1
},
"timestamp": 1673323685109
}
Parameters
None
Get Buy Power
Limit: 60 requests per 60 seconds
GET /v3/buypower
Get buying power for selected symbol.
Response
{
"code": 0,
"data": [
{
"symbol": "SPOT_BTC_USDT",
"availableBaseQuantity": 1.2,
"availableQuoteQuantity": 100,
},
],
"timestamp": 1575014255
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | Y | symbol that you wish to query |
Get Token Deposit Address
Limit 60 requests per 60 seconds
GET /v1/asset/deposit
Get your unique deposit address by token
Response
{
"success": true,
"address": "0x31d64B3230f8baDD91dE1710A65DF536aF8f7cDa",
"extra": ""
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | Y | token name you want to deposit (can get it by /public/token) |
Token Withdraw
Limit 20 requests per 60 seconds
POST /v1/asset/withdraw
Initiate a token withdrawal request, amount
must less than or equal to holding
Response
{
"success": true,
"withdraw_id": "20200119145703654"
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | Y | token name you want to withdraw (can get it by /public/token) |
address | string | Y | the address you want to withdraw |
extra | string | N | address extra information such as MEMO or TAG |
amount | number | Y | amount you want to withdraw, must less or equal than holding |
Cancel Withdraw Request
Limit 5 requests per 60 seconds
DELETE /v1/asset/withdraw
Cancel withdraw request when status is NEW
Response
{
"success": true
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | the withdraw id you want to cancel |
Get Asset History
Limit 10 requests per 60 seconds
GET /v1/asset/history
Get asset history, includes token deposit/withdraw and collateral deposit/withdraw.
Response
{
"success": true,
"meta": {
"records_per_page": 25,
"current_page": 1
},
"rows": [
{
"created_time": "1579399877.041", // Unix epoch time in seconds
"updated_time": "1579399877.041", // Unix epoch time in seconds
"id": "202029292829292",
"external_id": "202029292829292",
"application_id": null,
"token": "ETH",
"target_address": "0x31d64B3230f8baDD91dE1710A65DF536aF8f7cDa",
"source_address": "0x70fd25717f769c7f9a46b319f0f9103c0d887af0",
"confirming_threshold":12,
"confirmed_number":12,
"extra": "",
"type": "BALANCE",
"token_side": "DEPOSIT",
"amount": 1000,
"tx_id": "0x8a74c517bc104c8ebad0c3c3f64b1f302ed5f8bca598ae4459c63419038106b6",
"fee_token": null,
"fee_amount": null,
"status": "CONFIRMING"
},
{
"created_time": "1579399877.041",
"updated_time": "1579399877.041",
"id": "20202020202020022",
"external_id": "20202020202020022",
"application_id": null,
"token": "ETH",
"target_address": "0x31d64B3230f8baDD91dE1710A65DF536aF8f7cDa",
"source_address": "0x70fd25717f769c7f9a46b319f0f9103c0d887af0",
"confirming_threshold":12,
"confirmed_number":12,
"extra": "",
"type": "BALANCE",
"token_side": "DEPOSIT",
"amount": 100,
"tx_id": "0x7f74c517bc104c8ebad0c3c3f64b1f302ed5f8bca598ae4459c63419038106c5",
"fee_token": null,
"fee_amount": null,
"status": "COMPLETED"
}
]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | N | token name you want to search (can get it by /public/token) |
balance_token | string | N | balance_token name you want to search (can get it by /public/token) |
type | string | N | BALANCE /COLLATERAL |
token_side | string | N | DEPOSIT /WITHDRAW |
status | string | N | NEW /CONFIRMING /PROCESSING /COMPLETED /CANCELED |
start_t | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
end_t | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 1) |
Margin Interest Rates
Limit 10 requests per 60 seconds
GET /v1/token_interest
Get the margin interest rate of each token.
Response
{
"success": true,
"rows": [
{
"token": "MATIC",
"current_hourly_base_rate": "0.0001%",
"est_hourly_base_rate": "0.0001%",
"current_annual_base_rate": "0.876%",
"est_annual_base_rate": "0.876%",
"est_time": "1632394800.000" // Unix epoch time in seconds
},
{
"token": "USDT",
"current_hourly_base_rate": "0.0008%",
"est_hourly_base_rate": "0.0008%",
"current_annual_base_rate": "7.008%",
"est_annual_base_rate": "7.008%",
"est_time": "1632394800.000" // Unix epoch time in seconds
},
{
"token": "WOO",
"current_hourly_base_rate": "0.001%",
"est_hourly_base_rate": "0.001%",
"current_annual_base_rate": "8.76%",
"est_annual_base_rate": "8.76%",
"est_time": "1632394800.000" // Unix epoch time in seconds
},
// ...
]
}
Parameters
None
Margin Interest Rate of Token
Limit 10 requests per 60 seconds
GET /v1/token_interest/:token
Get the margin interest rate of the specific token.
Response
{
"success": true,
"info": {
"token": "BTC",
"current_hourly_base_rate": "0.0001%",
"est_hourly_base_rate": "0.0001%",
"current_annual_base_rate": "0.876%",
"est_annual_base_rate": "0.876%",
"est_time": "1632448800.000" // Unix epoch time in seconds
}
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | Y | should be upper case |
Get Interest History
Limit 10 requests per 60 seconds
GET /v1/interest/history
Get margin interest history.
Response
{
"success": true,
"meta": {
"records_per_page": 25,
"current_page": 1
},
"rows": [
{
"created_time": "1579399877.041", // Unix epoch time in seconds
"updated_time": "1579399877.041", // Unix epoch time in seconds
"token": "USDT",
"application_id": null,
"side": "LOAN",
"interest": "1",
}
]
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | N | interest token which you want to query |
side | string | N | LOAN /REPAY /AUTO_REPAY |
start_t | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
end_t | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 1) |
Repay Interest
Limit 10 requests per 60 seconds
POST /v1/interest/repay
REPAY your margin interest.
Response
{
"success": true,
}
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | Y | interest token which you want to repay |
amount | number | Y | repayment amount |
Get Subaccounts
Limit: 10 requests per 60 seconds
GET /v1/sub_account/all
Get subaccount list.
Response
{
"rows": [
{
"application_id": "6b43de5c-0955-4887-9862-d84e4689f9fe",
"account": "2",
"created_time": "1606897264.994"
},
{
"application_id": "5b0df321-3aaf-471f-a386-b922a941d17d",
"account": "1",
"created_time": "1606897264.994"
},
{
"application_id": "de25e672-f3e8-4ddc-b264-75d243cb2b9c",
"account": "test",
"created_time": "1606897264.994"
}
],
"success": true
}
Permission
Main account only.
Parameters
None
Get Assets of Subaccounts
Limit: 10 requests per 60 seconds
GET /v1/sub_account/assets
Get assets summary of all subaccounts (including main account).
Response
{
"rows": [
{
"application_id": "0b297f58-9d3e-4c91-95cd-863329631b79",
"account": "Main",
"usdt_balance": 0.0
}
],
"success": true
}
Permission
Main account only.
Parameters
None
Get Asset Details from a Subaccount
Limit: 10 requests per 60 seconds
GET /v1/sub_account/asset_detail
Get assets details from a subaccounts.
Response
{
"balances": {
"BTC": {
"holding": 0.0,
"frozen": 0.0,
"interest": 0.0,
"staked": 0.0,
"unbonding": 0.0,
"vault": 0.0
},
"WOO": {
"holding": 4172706.29647137,
"frozen": 0.0,
"interest": 0.0,
"staked": 51370692,
"unbonding": 0.0,
"vault": 0.0
},
"BNB": {
"holding": 0.00070154,
"frozen": 0.0,
"interest": 0.0,
"staked": 0.0,
"unbonding": 0.0,
"vault": 0.0
},
"ETH": {
"holding": 0.0,
"frozen": 0.0,
"interest": 0.0,
"staked": 0.0,
"unbonding": 0.0,
"vault": 0.0
},
"USDT": {
"holding": 14066.5839369,
"frozen": 0.0,
"interest": 0.0,
"staked": 0.0,
"unbonding": 0.0,
"vault": 0.0
}
},
"account": "test",
"success": true,
"application_id": "e074dd6b-4c03-49be-937f-856472f7a6cb"
}
Permission
Main or Subaccounts.
Parameters
Name | Type | Required | Description |
---|---|---|---|
application_id | string | Y | application id for an account, user can find it from WOO X console. |
Get IP Restriction
Limit: 10 requests per 10 seconds
GET /v1/sub_account/ip_restriction
Get allowed IP list of a subaccount's API Key.
Response
{
"rows": [
{
"ip_list": "60.248.33.61,1.2.3.4,100.100.1.1,100.100.1.2,100.100.1.3,100.100.1.4,210.64.18.77",
"api_key": "plXHR+GwX0u8UG/GwMjLsQ==",
"update_time": "1644553230.916",
"restrict": true
}
],
"meta": {
"total": 1,
"records_per_page": 25,
"current_page": 1
},
"success": true
}
Permission
Main or Subaccounts.
Parameters
Name | Type | Required | Description |
---|---|---|---|
application_id | string | N | from WOO X console |
api_key | string | N | created from WOO X console |
Get Transfer History
Limit: 20 requests per 60 seconds
GET /v1/asset/main_sub_transfer_history
Get transfer history between main account and subaccounts.
Response
{
"success":true,
"data":{
"rows":[
{
"id":225,
"token":"USDT",
"amount":1000000,
"status":"COMPLETED",
"from_application_id":"046b5c5c-5b44-4d27-9593-ddc32c0a08ae",
"to_application_id":"082ae5ae-e26a-4fb1-be5b-03e5b4867663",
"from_user":"Main",
"to_user":"av",
"created_time":"1642660941.534",
"updated_time":"1642660941.950"
},
// ....skip (total 25 items in one page)
],
"meta":{
"total":7,
"records_per_page":5,
"current_page":1
}
}
}
Permission
Main or Subaccounts.
Parameters
Name | Type | Required | Description |
---|---|---|---|
start_t | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
end_t | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 1) |
Transfer Assets
Limit: 20 requests per 60 seconds
POST /v1/asset/main_sub_transfer
Transfer asset between main account and subaccounts.
Response
{
"success": true,
"id": 200
}
Permission
Main or Subaccounts.
Parameters
Name | Type | Required | Description |
---|---|---|---|
token | string | Y | token name you want to transfer (can get it by /public/token) |
amount | number | Y | amount you want to transfer |
from_application_id | string | Y | application id you want to transfer from |
to_application_id | string | Y | application id you want to transfer to |
Update Account Mode
Limit: 5 requests per 60 seconds per user
POST /v1/client/account_mode
Choose account mode: pure spot or margin or futures
Parameters
Name | Type | Required | Description |
---|---|---|---|
account_mode | string | Y | PURE_SPOT, MARGIN, FUTURES |
Response
{
"success": true
}
Update Leverage Setting
Limit: 5 requests per 60 seconds per user
POST /v1/client/leverage
Choose maximum leverage for margin mode or futures mode
Parameters
Name | Type | Required | Description |
---|---|---|---|
leverage | int | Y | for margin mode: 1, 2, 3, 4, 5 ; for futures mode: 1, 2, 3, 4, 5, 10, 15, 20 |
Response
{
"success": true
}
Get Funding Fee History
Limit: 20 requests per 60 seconds per user
GET /v1/funding_fee/history
Get funding fee history
Parameters
Name | Type | Required | Description |
---|---|---|---|
symbol | string | N | symbol that you wish to query |
start_t | timestamp | N | start time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
end_t | timestamp | N | end time range that you wish to query, noted that the time stamp is a 13-digits timestamp. |
page | number | N (default: 1) | the page you wish to query. |
size | number | N (default: 1) |
Response
{
"success": true,
"meta": {
"total": 670,
"records_per_page": 25,
"current_page": 1
},
"rows": [
{
"id": 10001,
"symbol": "PERP_BTC_USDT",
"funding_rate": 0.00345,
"mark_price": 100,
"funding_fee": 0.345,
"payment_type": "Receive", // Receive and Pay
"status": "COMPLETED",
"created_time": "1575014255.089", // Unix epoch time in seconds
"updated_time": "1575014255.910" // Unix epoch time in seconds
},
// ....skip (total 25 items in one page)
}
Get All Position info
Limit: 30 requests per 10 seconds per user
GET /v1/positions
** Note: This API will be deprecated at the end of 2023 Q1, please find the replacement API in Get Positions - New
Parameters
Response
{
"success": true,
"current_margin_ratio": 0.8,
"initial_margin_ratio": 0.8,
"maintenance_margin_ratio": 0.8,
"total_collateral": 100,
"free_collateral": 80,
"total_account_value": 150,
"total_vault_value": 10,
"total_staking_value": 5,
"positions": [
{
"symbol": "PERP_BTC_USDT",
"holding": 1.23,
"pending_long_qty": 0.5,
"pending_short_qty": 0.23,
"settle_price": 50000,
"average_open_price": 49000,
"pnl_24_h": 20,
"fee_24_h": 12,
"mark_price": 49550,
"est_liq_price": 40000,
"timestamp": "1575014255.089"
},
// ....skip
]
}
Get All Position info - New
Limit: 30 requests per 10 seconds per user
GET /v3/positions
The API is design to replace the legacy API Get Positions
Parameters
Response
{
"success": true,
"data": {
"positions": [
{
"symbol": "0_symbol",
"holding": 1,
"pendingLongQty": 0,
"pendingShortQty": 1,
"settlePrice": 1,
"averageOpenPrice": 1,
"pnl24H": 1,
"fee24H": 1,
"markPrice": 1,
"estLiqPrice": 1,
"timestamp": 12321321
}
]
},
"timestamp": 1673323880342
}
Get One Position info
Limit: 30 requests per 10 seconds per user
GET /v1/position/:symbol
Parameters
Response
{
"success": true,
"symbol": "PERP_BTC_USDT",
"holding": 1.23,
"pending_long_qty": 0.5,
"pending_short_qty": 0.23,
"settle_price": 50000,
"average_open_price": 49000,
"pnl_24_h": 20,
"fee_24_h": 0.2,
"mark_price": 49550,
"est_liq_price": 40000,
"timestamp": "1575014255.089"
}
Websocket API V2
Market Data Base endpoints:
wss://wss.staging.woo.org/ws/stream/{application_id}
(Staging)wss://wss.woo.org/ws/stream/{application_id}
(Production){application_id}
user can find application_id from console- user can subscribe/unsubscribe
orderbook
|orderbook100
|aggbook10
|aggbook100
|aggbook1000
|ticker
|tickers
|bbo
|trade
|kline_1m
|kline_5m
|kline_15m
|kline_30m
|kline_1h
|kline_1d
|kline_1w
|kline_1M
Private User Data Stream Base endpoints:
wss://wss.staging.woo.org/v2/ws/private/stream/{application_id}
(Staging)wss://wss.woo.org/v2/ws/private/stream/{application_id}
(Production){application_id}
user can find application_id from console- User needs to be authenticated before subscribing any topic, would be disconnected if fails the authentication. Refer to Authenticaton for more information.
- User can subscribe/unsubscribe
positioninfo
|executionreport
PING/PONG
- The server will send a ping command to the client every 10 seconds. If the pong from client is not received within 10 seconds for 10 consecutive times, it will actively disconnect the client.
- The client can also send ping every 10s to keep alive.
Parameters
Name | Type | Required | Description |
---|---|---|---|
event | string | Y | ping /pong |
{
"event":"ping"
}
Response
{
"event":"pong",
"ts":1614667590000
}
request orderbook
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | request |
params.type | string | Y | orderbook |
params.symbol | string | Y | {symbol} |
{
"id": "clientID1",
"event": "request",
"params": {
"type": "orderbook",
"symbol": "SPOT_BTC_USDT"
}
}
Response
{
"id":"123r",
"event":"request",
"success":true,
"ts":1618880432419,
"data":{
"symbol":"SPOT_BTC_USDT",
"ts":1618880432380,
"asks":[
[
54700,
0.443951
],
[
54700.02,
0.002566
],
...
],
"bids":[
[
54699.99,
2.887466
],
[
54699.76,
2.034711
],
...
]
}
}
orderbook
{symbol}@orderbook
depth 100, only push when there are actual change.{symbol}@orderbook100
depth 100, only push when there are actual change.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@orderbook /{symbol}@orderbook100 |
{
"id": "clientID2",
"topic": "SPOT_WOO_USDT@orderbook",
"event": "subscribe"
}
Response
{
"id": "clientID2",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic": "SPOT_WOO_USDT@orderbook",
"ts": 1614152140945,
"data": {
"symbol": "SPOT_WOO_USDT",
"asks": [
[
0.31075,
2379.63
],
[
0.31076,
4818.76
],
[
0.31078,
8496.1
],
...
],
"bids": [
[
0.30891,
2469.98
],
[
0.3089,
482.5
],
[
0.30877,
20
],
...
]
}
}
orderbookupdate
{symbol}@orderbookupdate
updated orderbook push every 200ms
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@orderbookupdate |
{
"id": "clientID2",
"topic": "SPOT_BTC_USDT@orderbookupdate",
"event": "subscribe"
}
Response
{
"id": "clientID2",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"SPOT_BTC_USDT@orderbookupdate",
"ts":1618826337580,
"data":{
"symbol":"SPOT_BTC_USDT",
"prevTs":1618826337380,
"asks":[
[
56749.15,
3.92864
],
[
56749.8,
0
],
...
],
"bids":[
[
56745.2,
1.03895025
],
[
56744.6,
1.0807
],
...
]
}
}
trade
- Push interval: real-time push
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@trade |
{
"id": "clientID3",
"topic": "SPOT_ADA_USDT@trade",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"SPOT_ADA_USDT@trade",
"ts":1618820361552,
"data":{
"symbol":"SPOT_ADA_USDT",
"price":1.27988,
"size":300,
"side":"BUY",
"source":0
}
}
24h ticker
- Push interval: only update when there is a change and 1 min force update even if no change.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@ticker |
{
"id": "clientID4",
"topic": "SPOT_WOO_USDT@ticker",
"event": "subscribe"
}
Response
{
"id": "clientID4",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic": "SPOT_WOO_USDT@ticker",
"ts": 1614152270000,
"data": {
"symbol": "SPOT_WOO_USDT",
"open": 0.16112,
"close": 0.32206,
"high": 0.33000,
"low": 0.14251,
"volume": 89040821.98,
"amount": 22493062.21,
"count": 15442
}
}
24h tickers
- Push interval: 1s
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | tickers |
{
"id": "clientID4",
"topic": "tickers",
"event": "subscribe"
}
Response
{
"id": "clientID4",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"tickers",
"ts":1618820615000,
"data":[
{
"symbol":"SPOT_OKB_USDT",
"open":16.297,
"close":17.183,
"high":24.707,
"low":11.997,
"volume":0,
"amount":0,
"count":0
},
{
"symbol":"SPOT_XRP_USDT",
"open":1.3515,
"close":1.43794,
"high":1.96674,
"low":0.39264,
"volume":750127.1,
"amount":985440.5122,
"count":396
},
...
]
}
bbo
- Push interval: 10ms
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@bbo |
{
"id": "clientID5",
"topic": "SPOT_WOO_USDT@bbo",
"event": "subscribe"
}
Response
{
"id": "clientID5",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic": "SPOT_WOO_USDT@bbo",
"ts": 1614152296945,
"data": {
"symbol": "SPOT_WOO_USDT",
"ask": 0.30939,
"askSize": 4508.53,
"bid": 0.30776,
"bidSize": 25246.14
}
}
bbos
- Push interval: 1s
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | bbos |
{
"id": "clientID5",
"topic": "bbos",
"event": "subscribe"
}
Response
{
"id": "clientID5",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"bbos",
"ts":1618822376000,
"data":[
{
"symbol":"SPOT_FIL_USDT",
"ask":159.0318,
"askSize":370.43,
"bid":158.9158,
"bidSize":16
},
{
"symbol":"SPOT_BTC_USDT",
"ask":56987.18,
"askSize":3.163881,
"bid":56987.17,
"bidSize":0.941728
},
...
]
}
k-line
{time}
:1m
/5m
/15m
/30m
/1h
/1d
/1w
/1M
- Push interval: by the selected k-line type.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | N | {symbol}@kline_{time} |
{
"id": "clientID6",
"topic": "SPOT_BTC_USDT@kline_1m",
"event": "subscribe"
}
Response
{
"id": "clientID6",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"SPOT_BTC_USDT@kline_1m",
"ts":1618822432146,
"data":{
"symbol":"SPOT_BTC_USDT",
"type":"1m",
"open":56948.97,
"close":56891.76,
"high":56948.97,
"low":56889.06,
"volume":44.00947568,
"amount":2504584.9,
"startTime":1618822380000,
"endTime":1618822440000
}
}
auth
- refer to Authenticaton for more details about how to sign the request with
api_key
andapi_secret
. query string and body parameters are both blank.
Parameters
Name | Type | Required | Description |
---|---|---|---|
apikey | string | Y | api key |
sign | string | Y | sign |
timestamp | string | Y | timestamp |
{
"id":"123r",
"event":"auth",
"params":{
"apikey":"CUS69ZJOXwSV38xo...",
"sign":"4180da84117fc9753b...",
"timestamp":"1621910107900"
}
}
Response
{
"id":"123r",
"event":"auth",
"success":true,
"ts":1621910107315
}
positioninfo
- Push interval: realtime (push on update)
** Note: This topic will be deprecated at the end of 2023 Q1 with WOO X New Margin Ratio Program, please find the replacement topic at balance
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | positioninfo |
{
"id": "clientID3",
"topic": "positioninfo",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"positioninfo",
"ts":1618757307607,
"data":{
"marginRate":95.87,
"marginMode":"MARGIN",
"leverage":3,
"takerFeeRate":5,
"makerFeeRate":0,
"interestRate":3,
"guiTakerFeeRate":5,
"guiMakerFeeRate":0,
"liquidationMarginRate":95.87,
"futuresLeverage":1,
"futuresApiTakerFeeRate":5,
"futuresApiMakerFeeRate":0,
"futuresGuiTakerFeeRate":5,
"futuresGuiMakerFeeRate":0,
"positions":{
"BTC":{
"holding":0,
"outstandingHolding":0,
"pendingExposure":0,
"interest":0,
"avgOpenPrice":0,
"breakEvenPrice":0,
"realisedPnl":0,
"settledPnl":0,
"markPx":309.8,
"liquidPx":0,
"pnl24H":0,
"fee24H":0,
"frozen":0
},
"ETH":{
"holding":0,
"outstandingHolding":0,
"pendingExposure":0,
"interest":0,
"avgOpenPrice":0,
"breakEvenPrice":0,
"realisedPnl":0,
"settledPnl":0,
"markPx":909.19,
"liquidPx":0,
"pnl24H":0,
"fee24H":0,
"frozen":0
},
...
}
}
}
balance
- Push interval: realtime (push on update)
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | balance |
{
"id": "clientID3",
"topic": "balance",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"balance",
"ts":1618757714353,
"data":{
"balances":{
"BTC":{
"holding":0,
"frozen":0,
"interest":0,
"pendingShortQty":0,
"pendingLongQty":0,
"version":0,
"staked":0,
"unbonding":0,
"vault":309.8,
"averageOpenPrice":0,
"pnl24H":0,
"fee24H":0,
"markPrice":0
},
"ETH":{
"holding":0,
"frozen":0,
"interest":0,
"pendingShortQty":0,
"pendingLongQty":0,
"version":0,
"staked":0,
"unbonding":0,
"vault":309.8,
"averageOpenPrice":0,
"pnl24H":0,
"fee24H":0,
"markPrice":0
},
...
}
}
}
executionreport
- Push interval: real-time push
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | executionreport |
{
"id": "clientID3",
"topic": "executionreport",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic": "executionreport",
"ts": 1675406261689,
"data":
{
"symbol": "SPOT_BTC_USDT",
"clientOrderId": 0,
"orderId": 54774393,
"type": "MARKET",
"side": "BUY",
"quantity": 0.0,
"price": 0.0,
"tradeId": 56201985,
"executedPrice": 23534.06,
"executedQuantity": 0.00040791,
"fee": 2.1E-7,
"feeAsset": "BTC",
"totalExecutedQuantity": 0.00040791,
"avgPrice": 23534.06,
"status": "FILLED",
"reason": "",
"orderTag": "default",
"totalFee": 2.1E-7,
"visible": 0.0,
"timestamp": 1675406261689,
"reduceOnly": false,
"maker": false
}
}
error response
{
"id": "clientID7",
"event": "subscribe",
"success": false,
"ts": 1614141150601,
"errorMsg": "invalid symbol SPOT_WOO_USDC"
}
algoexecutionreportv2
- Push interval: real-time push
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | algoexecutionreportv2 |
{
"id": "clientID3",
"topic": "algoexecutionreportv2",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic": "algoexecutionreportv2",
"ts": 1667978011834,
"data": [
{
"symbol": "SPOT_BAL_USDT",
"rootAlgoOrderId": 345181,
"parentAlgoOrderId": 0,
"algoOrderId": 345181,
"clientOrderId": 0,
"orderTag": "default",
"status": "NEW",
"algoType": "BRACKET",
"side": "SELL",
"quantity": 1,
"triggerStatus": "SUCCESS",
"price": 69,
"type": "LIMIT",
"triggerTradePrice": 0,
"triggerTime": 0,
"tradeId": 0,
"executedPrice": 0,
"executedQuantity": 0,
"fee": 0,
"reason": "",
"feeAsset": "USDT",
"totalExecutedQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"timestamp": 1667978011834,
"visibleQuantity": 1,
"reduceOnly": false,
"activatedPrice": 0,
"triggered": false,
"activated": false,
"maker": false,
"isTriggered": false,
"isMaker": false,
"isActivated": false,
"rootAlgoStatus": "NEW",
"algoStatus": "NEW"
},
{
"symbol": "SPOT_BAL_USDT",
"rootAlgoOrderId": 345181,
"parentAlgoOrderId": 345181,
"algoOrderId": 345182,
"clientOrderId": 0,
"orderTag": "default",
"algoType": "POSITIONAL_TP_SL",
"side": "BUY",
"quantity": 0,
"triggerStatus": "USELESS",
"price": 0,
"triggerTradePrice": 0,
"triggerTime": 0,
"tradeId": 0,
"executedPrice": 0,
"executedQuantity": 0,
"fee": 0,
"reason": "",
"feeAsset": "",
"totalExecutedQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"timestamp": 1667978011900,
"visibleQuantity": 0,
"reduceOnly": false,
"activatedPrice": 0,
"triggered": false,
"activated": false,
"maker": false,
"isTriggered": false,
"isMaker": false,
"isActivated": false,
"rootAlgoStatus": "NEW",
"algoStatus": "NEW"
},
{
"symbol": "SPOT_BAL_USDT",
"rootAlgoOrderId": 345181,
"parentAlgoOrderId": 345182,
"algoOrderId": 345183,
"clientOrderId": 0,
"orderTag": "default",
"algoType": "TAKE_PROFIT",
"side": "BUY",
"quantity": 0,
"triggerPrice": 50,
"triggerStatus": "USELESS",
"price": 0,
"type": "CLOSE_POSITION",
"triggerTradePrice": 0,
"triggerTime": 0,
"tradeId": 0,
"executedPrice": 0,
"executedQuantity": 0,
"fee": 0,
"reason": "",
"feeAsset": "",
"totalExecutedQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"timestamp": 1667978011900,
"visibleQuantity": 0,
"reduceOnly": true,
"activatedPrice": 0,
"triggered": false,
"activated": false,
"maker": false,
"isTriggered": false,
"isMaker": false,
"isActivated": false,
"rootAlgoStatus": "NEW",
"algoStatus": "NEW"
},
{
"symbol": "SPOT_BAL_USDT",
"rootAlgoOrderId": 345181,
"parentAlgoOrderId": 345182,
"algoOrderId": 345184,
"clientOrderId": 0,
"orderTag": "default",
"algoType": "STOP_LOSS",
"side": "BUY",
"quantity": 0,
"triggerPrice": 75,
"triggerStatus": "USELESS",
"price": 0,
"type": "CLOSE_POSITION",
"triggerTradePrice": 0,
"triggerTime": 0,
"tradeId": 0,
"executedPrice": 0,
"executedQuantity": 0,
"fee": 0,
"reason": "",
"feeAsset": "",
"totalExecutedQuantity": 0,
"averageExecutedPrice": 0,
"totalFee": 0,
"timestamp": 1667978011900,
"visibleQuantity": 0,
"reduceOnly": true,
"activatedPrice": 0,
"triggered": false,
"activated": false,
"maker": false,
"isTriggered": false,
"isMaker": false,
"isActivated": false,
"rootAlgoStatus": "NEW",
"algoStatus": "NEW"
}
]
}
indexprice
- Push interval: 1s
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@indexprice |
{
"id": "clientID3",
"topic": "SPOT_ETH_USDT@indexprice",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"SPOT_ETH_USDT@indexprice",
"ts":1618820361552,
"data":{
"symbol":"SPOT_ETH_USDT",
"price":3987.1
}
}
markprice
- Push interval: 1s
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@markprice |
{
"id": "clientID3",
"topic": "PERP_ETH_USDT@markprice",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"PERP_ETH_USDT@markprice",
"ts":1618820361552,
"data":{
"symbol":"PERP_ETH_USDT",
"price":3987.2
}
}
openinterest
- Push interval: push every 1 second if open interest change and 10 seconds force update even if no change.
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@openinterest |
{
"id": "clientID3",
"topic": "PERP_BTC_USDT@openinterest",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"PERP_BTC_USDT@openinterest",
"ts":1618820361552,
"data":{
"symbol":"PERP_BTC_USDT",
"openInterest":1.27988
}
}
estfundingrate
- Push interval: 1s
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | {symbol}@estfundingrate |
{
"id": "clientID3",
"topic": "PERP_BTC_USDT@estfundingrate",
"event": "subscribe"
}
Response
{
"id": "clientID3",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"PERP_BTC_USDT@estfundingrate",
"ts":1618820361552,
"data":{
"symbol":"PERP_BTC_USDT",
"fundingRate":1.27988,
"fundingTs":1618820361552
}
}
markprices
- Push interval: 1s
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe /unsubscribe |
topic | string | Y | markprices |
{
"id": "clientID5",
"topic": "markprices",
"event": "subscribe"
}
Response
{
"id": "clientID5",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic":"markprices",
"ts":1618822376000,
"data":[
{
"symbol":"PERP_BTC_USDT",
"price":51234.13
},
{
"symbol":"PERP_ETH_USDT",
"price":3894.34
},
...
]
}
position push
- Push interval: push on update
Parameters
Name | Type | Required | Description |
---|---|---|---|
id | string | Y | id generate by client |
event | string | Y | subscribe/ unsubscribe |
topic | string | Y | position |
{
"id": "clientID5",
"topic": "position",
"event": "subscribe"
}
Response
{
"id": "clientID5",
"event": "subscribe",
"success": true,
"ts": 1609924478533
}
Subscribed Message
{
"topic": "position",
"ts": 1677814655101,
"data":
{
"positions":
{
"PERP_BTC_USDT":
{
"holding": 0.0,
"pendingLongQty": 0.00020,
"pendingShortQty": 0.0,
"averageOpenPrice": 0.0,
"pnl24H": -1.55902,
"fee24H": 0.21800043,
"settlePrice": 0.0,
"markPrice": 22325.47533333,
"version": 93454,
"openingTime": 0,
"pnl24HPercentage": -0.00542227
}
}
}
}
Release Note
All the API changes would be listed here.
2023-04-10
- Add
can_collateral
andcan_short
in the response message of API Available Token (Public). - Change response message of Funding Rate related API for new funding rate calculation rules released in 2023-04-10, including Get Predicted Funding Rate for All Markets, Get Predicted Funding Rate for One Market and Get Funding Rate History for One Market.
- Change Orderbook Snapshot and Kline RESTful API from privateto public endpoint. (Those two endpoint will not require authentication anymore).
2023-02-06
- Add Get Balance API. The API is design to replace the legacy API Get Current Holding and Get Current Holding v2.
- Add Get Account Information - New. the API is design to replace the legacy API Get Account Information.
- Add Get All Position Info - New. The API is design to replace the legacy API Get Positions
- Add Get Buy Power for query buying power of selected symbol.
- Add New Websocket topic balance. The topic is design to replace existing topic positionsinfo.
2022-12-05
- Add Edit Order, Edit order by client_order_id, Edit Algo Order and Edit Algo order by client_order_id.
- Update push frequency for websocket topics: bbo, 24 ticker, Open Interest and orderbook.
- Update rate limit for Get Token Deposit Address and Token Withdraw.
2022-11-21
- Add Market Trade History for fetching trade history data.
2022-10-24
- Add Send Algo Order to create Algo Order through the API, support algo types include:
STOP
(stop market & stop limit),OCO
,TRAILING_STOP
,BRACKET
andPOSITIONAL_TP_SL
. - Add Cancel Algo Order, Cancel All Pending Algo Orders and Cancel Pending Merge Orders by Symbol.
- Add Get Algo Order and Get Algo Orders to fetch Algo Orders detail through the API.
- Add Cancel All Pending Order to cancel all pending Ordinary Orders (not include Algo Orders) through the API.
- Update authentication section for
v3
API to generate the signature withtimestamp
,request_method
,request_path
andrequest_body
. - Add Get System Maintenance Status API to fetch system status.
2022-09-08
- Add
can_collateral
in the response message of API Available Token (Public). - Add
realized_pnl
in the response message of API Get Order, Get Order by client_order_id and Get Orders. And addrealized_pnl
parameter in the request body of API Get Orders. Therealized_pnl
field in response will only present the settled amount for futures orders. - Newly support
1m
intype
parameter in the query string of API for Historical Kline.
2022-08-18
- update Token Withdraw API by remove
code
parameter, the new version will not require 2FA code for those withdrawal address been verified in the address book. - Increase rate limit of Get All Position info and Get One Position info to 30 requests per second.
2022-07-28
- Add
reduce_only
parameter in the request body of API Send_Order. - Add
reduce_only
in the response message of API Get_Order, Get_Order_by_client_order_id and Get_Orders. - Add
source
in the response message of API Market_Trades(Public). - Add
source
in the push message of Websocket Topic trades.
2022-06-10
- Add
total_collateral
,free_collateral
,total_account_value
,total_vault_value
,total_staking_value
andest_liq_price
for each futures positions in Position Info. - Deprecate websocket subscription topic: Orderbook depth 1000, the original {symbol}@orderbook topic will keep alive but push the same data as symbol@orderbook100 (depth 100).
2022-05-23
- Upgrade websocket subscription topic: bbo push frequency from 200ms to 10ms.
- Add public API for Historical Kline.
2022-03-21
- Add public API for Funding Rate and Futures Info.
- Add private API for Change Account mode, Change Leverage.
- Add private API for Funding Fee, Position Info.
- Add
account_mode
,futures_leverage
,futures_taker_fee_rate
,futures_maker_fee_rate
in Account Information. - Add
futures_margin_factor
in Token Config, - Add Websocket Topics indexprice, markprice, openinterest, estfundingrate, markprices, position push
2022-02-25
- Add API SubAccount to manage subaccounts.
2022-01-17
- Add
can_collateral
,can_short
andstable
in Token_Config
2021-12-24
Add API Kline to query yearly Kline.
Add
client_order_id
andtimestamp
in the response message of API Send_Order.
2021-11-12
- Add API Kline to provide at most 1000 klines.
2021-10-22
Add Public API Token Network to query the token deposit/withdrawal information on each network.
Add rate limit on public APIs.
2021-09-27
- Add API Margin_Interest_Rates and Margin_Interest_Rate_of_Token to query the margin interest rates.
2021-09-06
Adjust rate limit of API Get_Order and Get_Order_by_client_order_id to 10 per second in total.
Adjust rate limit of API Cancel_Order and Cancel_Order_by_client_order_id to 10 per second in total.
Adjust rate limit of API Get_Trade, Get_Trades to 10 per second for each.
2021-09-03
- Add API Token_Config.
2021-08-06
Remove
Transactions
from Get_Orders.Add
total_fee
andfee_asset
in Get_Order, Get_Order_by_client_order_id, Get_Orders.
2021-06-25
- Add API Cancel_Order_by_client_order_id
User could cancel order by the user-specified client_order_id
.
- Add API Get_Trades
User could get all the trades by order_id
.