- This document lists the base URL for the API endpoints: https://sapi.asterdex.com
- All API responses are in JSON format.
- All times and timestamps are in UNIX time, in milliseconds.
- Many endpoints require an API Key to access.
- When setting the API Key, for security reasons it is recommended to set an IP access whitelist.
- Never reveal your API key/secret to anyone.
If an API Key is accidentally exposed, immediately delete that Key and generate a new one.
- TESTUSDT or any other symbols starting with TEST are symbols used for Aster’s INTERNAL TESTING ONLY. Please DO NOT trade on these symbols starting with TEST. Aster does not hold any accountability for loss of funds due to trading on these symbols. However, if you run into issues, you may contact support about this any time, we will try to help you recover your funds.
- HTTP
4XXstatus codes are used to indicate errors in the request content, behavior, or format. The problem lies with the requester. - HTTP
403status code indicates a violation of WAF restrictions (Web Application Firewall). - HTTP
429error code indicates a warning that the access frequency limit has been exceeded and the IP is about to be blocked. - HTTP
418indicates that after receiving a 429 you continued to access, so the IP has been blocked. - HTTP
5XXerror codes are used to indicate issues on the Aster service side.
- When using the endpoint
/api/v1, any endpoint may throw exceptions;
The API error codes are returned in the following format:
{
"code": -1121,
"msg": "Invalid symbol."
}- Endpoints with the
GETmethod must send parameters in thequery string. - For
POST,PUT, andDELETEendpoints, parameters can be sent in thequery stringwith content typeapplication/x-www-form-urlencoded, or in therequest body. - The order of parameters is not required.
- The
rateLimitsarray in/api/v1/exchangeInfocontains objects related to REQUEST_WEIGHT and ORDERS rate limits for trading. These are further defined in theenum definitionssection underrateLimitType. - A 429 will be returned when any of the rate limits are violated.
- Each request will include a header named
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)that contains the used weight of all requests from the current IP. - Each endpoint has a corresponding weight, and some endpoints may have different weights depending on their parameters. The more resources an endpoint consumes, the higher its weight will be.
- Upon receiving a 429, you are responsible for stopping requests and must not abuse the API.
- If you continue to violate access limits after receiving a 429, your IP will be banned and you will receive a 418 error code.
- Repeated violations of the limits will result in progressively longer bans, from a minimum of 2 minutes up to a maximum of 3 days.
- The
Retry-Afterheader will be sent with responses bearing 418 or 429, and will give the wait time in seconds (if 429) to avoid the ban, or, if 418, until the ban ends. - Access restrictions are based on IP, not API Key
You are advised to use WebSocket messages to obtain the corresponding data as much as possible to reduce the load and rate-limit pressure from requests.
- Each successful order response will include a
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)header containing the number of order limit units currently used by the account. - When the number of orders exceeds the limit, you will receive a response with status 429 but without the
Retry-Afterheader. Please check the order rate limits inGET api/v1/exchangeInfo(rateLimitType = ORDERS) and wait until the ban period ends. - Rejected or unsuccessful orders are not guaranteed to include the above header in the response.
- Order placement rate limits are counted per account.
- The WebSocket server accepts a maximum of 5 messages per second. Messages include:
- PING frame
- PONG frame
- Messages in JSON format, such as subscribe and unsubscribe.
- If a user sends messages that exceed the limit, the connection will be terminated. IPs that are repeatedly disconnected may be blocked by the server.
- A single connection can subscribe to up to 1024 Streams.
- Each API has its own authentication type, which determines what kind of authentication should be performed when accessing it.
- The authentication type will be indicated next to each endpoint name in this document; if not specifically stated, it defaults to
NONE.
| Authentication type | Description |
|---|---|
| NONE | APIs that do not require authentication |
| TRADE | A valid API-Key and signature are required |
| USER_DATA | A valid API-Key and signature are required |
| USER_STREAM | A valid API-Key is required |
| MARKET_DATA | A valid API-Key is required |
- The
TRADEandUSER_DATAendpoints are signed (SIGNED) endpoints.
- When calling a
SIGNEDendpoint, in addition to the parameters required by the endpoint itself, you must also pass asignatureparameter in thequery stringorrequest body. - The signature uses the
HMAC SHA256algorithm. The API-Secret corresponding to the API-KEY is used as the key forHMAC SHA256, and all other parameters are used as the data for theHMAC SHA256operation; the output is the signature. - The
signatureis case-insensitive. - "totalParams" is defined as the "query string" concatenated with the "request body".
- Signed endpoints must include the
timestampparameter, whose value should be the unix timestamp (milliseconds) at the moment the request is sent. - When the server receives a request it will check the timestamp; if it was sent more than 5,000 milliseconds earlier, the request will be considered invalid. This time window value can be defined by sending the optional
recvWindowparameter.
The logical pseudocode is as follows:
if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow)
{
// process request
}
else
{
// reject request
}About trade timeliness Internet conditions are not completely stable or reliable, so the latency from your client to Aster's servers will experience jitter. This is why we provide recvWindow; if you engage in high-frequency trading and have strict requirements for timeliness, you can adjust recvWindow flexibly to meet your needs.
It is recommended to use a recvWindow of under 5 seconds. It must not exceed 60 seconds.
Below is an example of placing an order by calling the API using echo, openssl, and curl tools in a Linux bash environment. The apiKey and secretKey are for demonstration only.
| Key | Value |
|---|---|
| apiKey | 4452d7e2ed4da80b74105e02d06328c71a34488c9fdd60a5a0900d42d584b795 |
| secretKey | fdde510a2b71fa43a43bff3e3cf7819c8c66df34633d338050f4f59664b3b313 |
| Parameters | Values |
|---|---|
| symbol | BNBUSDT |
| side | BUY |
| type | LIMIT |
| timeInForce | GTC |
| quantity | 5 |
| price | 1.1 |
| recvWindow | 5000 |
| timestamp | 1756187806000 |
Example 1 HMAC SHA256 signature:
$ echo -n "symbol=BNBUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=5&price=1.1&recvWindow=5000×tamp=1756187806000" | openssl dgst -sha256 -hmac "fdde510a2b71fa43a43bff3e3cf7819c8c66df34633d338050f4f59664b3b313"
(stdin)= e09169bf6c02ec4b29fa1bdc3a967f92c8c6cfcde0551ba1d477b2d3cf4c51b0curl command:
(HMAC SHA256)
$ curl -H "X-MBX-APIKEY: 4452d7e2ed4da80b74105e02d06328c71a34488c9fdd60a5a0900d42d584b795" -X POST 'https://sapi.asterdex.com/api/v1/order' -d 'symbol=BNBUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=5&price=1.1&recvWindow=5000×tamp=1756187806000&signature=e09169bf6c02ec4b29fa1bdc3a967f92c8c6cfcde0551ba1d477b2d3cf4c51b0'- requestBody:
symbol=BNBUSDT &side=BUY &type=LIMIT &timeInForce=GTC &quantity=5 &price=1.1 &recvWindow=5000 ×tamp=1756187806000
Example 2 HMAC SHA256 signature:
$ echo -n "symbol=BNBUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=5&price=1.1&recvWindow=5000×tamp=1756187806000" | openssl dgst -sha256 -hmac "fdde510a2b71fa43a43bff3e3cf7819c8c66df34633d338050f4f59664b3b313"
(stdin)= e09169bf6c02ec4b29fa1bdc3a967f92c8c6cfcde0551ba1d477b2d3cf4c51b0 curl command:
(HMAC SHA256)
$ curl -H "X-MBX-APIKEY: 4452d7e2ed4da80b74105e02d06328c71a34488c9fdd60a5a0900d42d584b795" -X POST 'https://sapi.asterdex.com/api/v1/order?symbol=BNBUSDT&side=BUY&type=LIMIT&timeInForce=GTC&quantity=5&price=1.1&recvWindow=5000×tamp=1756187806000&signature=e09169bf6c02ec4b29fa1bdc3a967f92c8c6cfcde0551ba1d477b2d3cf4c51b0'- queryString:
symbol=BNBUSDT &side=BUY &type=LIMIT &timeInForce=GTC &quantity=5 &price=1.1 &recvWindow=5000 ×tamp=1756187806000
The terminology in this section applies throughout the document. New users are encouraged to read it carefully for better understanding.
base assetrefers to the asset being traded in a trading pair, i.e., the asset name written first; for example, inBTCUSDT,BTCis thebase asset.quote assetrefers to the pricing asset of a trading pair, i.e., the asset name written at the latter part; for example, inBTCUSDT,USDTis thequote asset.
Trading pair status (status):
- TRADING - after trade
Trading pair type:
- SPOT - spot
Order status (status):
| Status | Description |
|---|---|
| NEW | Order accepted by the matching engine |
| PARTIALLY_FILLED | Part of the order was filled |
| FILLED | The order was fully filled |
| CANCELED | The user canceled the order |
| REJECTED | The order was not accepted by the matching engine and was not processed |
| EXPIRED | Order canceled by the trading engine, for example: Limit FOK order not filled, Market order not fully filled, orders canceled during exchange maintenance |
Order types (orderTypes, type):
- LIMIT - Limit Order
- MARKET - Market Order
- STOP - Limit Stop Order
- TAKE_PROFIT - Limit Take-Profit Order
- STOP_MARKET - Market Stop Order
- TAKE_PROFIT_MARKET - Market Take-Profit Order
Order response type (newOrderRespType):
- ACK
- RESULT
- FULL
Order direction (direction side):
- BUY - Buy
- SELL - Sell
Valid types (timeInForce):
This defines how long an order can remain valid before expiring.
| Status | Description |
|---|---|
| GTC (Good ‘Til Canceled) | The order remains active until it is fully executed or manually canceled. |
| IOC (Immediate or Cancel) | The order will execute immediately for any amount available. Any unfilled portion is automatically canceled. |
| FOK (Fill or Kill) | The order must be fully executed immediately. If it cannot be filled in full, it is canceled right away. |
| GTX (Good till crossing, Post only) | The post-only limit order will only be placed if it can be added as a maker order and not as a taker order. |
K-line interval:
m (minutes), h (hours), d (days), w (weeks), M (months)
- 1m
- 3m
- 5m
- 15m
- 30m
- 1h
- 2h
- 4h
- 6h
- 8h
- 12h
- 1d
- 3d
- 1w
- 1M
Rate limit type (rateLimitType)
REQUEST_WEIGHT
{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 1200
}ORDERS
{
"rateLimitType": "ORDERS",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 100
}-
REQUEST_WEIGHT - The maximum sum of request weights allowed within a unit time
-
ORDERS - Order placement frequency limit per time unit
Interval restriction (interval)
- MINUTE - Minute
Filters, i.e. Filter, define a set of trading rules. There are two types: filters for trading pairs symbol filters, and filters for the entire exchange exchange filters (not supported yet)
Format in the /exchangeInfo response:
{
"minPrice": "556.72",
"maxPrice": "4529764",
"filterType": "PRICE_FILTER",
"tickSize": "0.01"
}The Price Filter checks the validity of the price parameter in an order. It consists of the following three parts:
minPricedefines the minimum allowed value forprice/stopPrice.maxPricedefines the maximum allowed value forprice/stopPrice.tickSizedefines the step interval forprice/stopPrice, meaning the price must equal minPrice plus an integer multiple of tickSize.
Each of the above items can be 0; when 0 it means that item is not constrained.
The logical pseudocode is as follows:
price>=minPriceprice<=maxPrice- (
price-minPrice) %tickSize== 0
Format in the /exchangeInfo response:
{
"multiplierDown": "0.9500",
"multiplierUp": "1.0500",
"multiplierDecimal": "4",
"filterType": "PERCENT_PRICE"
}The PERCENT_PRICE filter defines the valid range of prices based on the index price.
For the "price percentage" to apply, the "price" must meet the following conditions:
price<=indexPrice*multiplierUpprice> =indexPrice*multiplierDown
Format in the /exchangeInfo response:
{
"stepSize": "0.00100000",
"filterType": "LOT_SIZE",
"maxQty": "100000.00000000",
"minQty": "0.00100000"
}Lots is an auction term. The LOT_SIZE filter validates the quantity (i.e., the amount) parameter in orders. It consists of three parts:
minQtyindicates the minimum allowed value forquantity.maxQtydenotes the maximum allowed value forquantity.stepSizedenotes the allowed step increment forquantity.
The logical pseudocode is as follows:
quantity>=minQtyquantity<=maxQty- (
quantity-minQty) %stepSize== 0
*/exchangeInfo response format:
{
"stepSize": "0.00100000",
"filterType": "MARKET_LOT_SIZE"
"maxQty": "100000.00000000",
"minQty": "0.00100000"
}The MARKET_LOT_SIZE filter defines the quantity (i.e., the "lots" in an auction) rules for MARKET orders on a trading pair. There are three parts:
minQtydefines the minimum allowedquantity.maxQtydefines the maximum allowed quantity.stepSizedefines the increments by which the quantity can be increased or decreased.
In order to comply with the market lot size, the quantity must satisfy the following conditions:
quantity>=minQtyquantity<=maxQty- (
quantity-minQty) %stepSize== 0
Response
{}GET /api/v1/ping
Test whether the REST API can be reached.
Weight: 1
Parameters: NONE
Response
{
"serverTime": 1499827319559
}GET /api/v1/time
Test if the REST API can be reached and retrieve the server time.
Weight: 1
Parameters: NONE
Response
{
"timezone": "UTC",
"serverTime": 1756197279679,
"rateLimits": [{
"rateLimitType": "REQUEST_WEIGHT",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000
},
{
"rateLimitType": "ORDERS",
"interval": "MINUTE",
"intervalNum": 1,
"limit": 6000
},
{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 300
}
],
"exchangeFilters": [],
"assets": [{
"asset": "USD"
}, {
"asset": "USDT"
},
{
"asset": "BNB"
}
],
"symbols": [{
"status": "TRADING",
"baseAsset": "BNB",
"quoteAsset": "USDT",
"pricePrecision": 8,
"quantityPrecision": 8,
"baseAssetPrecision": 8,
"quotePrecision": 8,
"filters": [{
"minPrice": "0.01000000",
"maxPrice": "100000",
"filterType": "PRICE_FILTER",
"tickSize": "0.01000000"
},
{
"stepSize": "0.00100000",
"filterType": "LOT_SIZE",
"maxQty": "1000",
"minQty": "1"
},
{
"stepSize": "0.00100000",
"filterType": "MARKET_LOT_SIZE",
"maxQty": "900000",
"minQty": "0.00100000"
},
{
"limit": 200,
"filterType": "MAX_NUM_ORDERS"
},
{
"minNotional": "5",
"filterType": "MIN_NOTIONAL"
},
{
"maxNotional": "100",
"filterType": "MAX_NOTIONAL"
},
{
"maxNotional": "100",
"minNotional": "5",
"avgPriceMins": 5,
"applyMinToMarket": true,
"filterType": "NOTIONAL",
"applyMaxToMarket": true
},
{
"multiplierDown": "0",
"multiplierUp": "5",
"multiplierDecimal": "0",
"filterType": "PERCENT_PRICE"
},
{
"bidMultiplierUp": "5",
"askMultiplierUp": "5",
"bidMultiplierDown": "0",
"avgPriceMins": 5,
"multiplierDecimal": "0",
"filterType": "PERCENT_PRICE_BY_SIDE",
"askMultiplierDown": "0"
}
],
"orderTypes": [
"LIMIT",
"MARKET",
"STOP",
"STOP_MARKET",
"TAKE_PROFIT",
"TAKE_PROFIT_MARKET"
],
"timeInForce": [
"GTC",
"IOC",
"FOK",
"GTX",
"HIDDEN"
],
"symbol": "BNBUSDT",
"ocoAllowed": false
}]
}GET /api/v1/exchangeInfo
Retrieve trading rules and trading pair information.
Weight: 1
Parameters: None
Response
{
"lastUpdateId": 1027024,
"E":1589436922972, // Message output time
"T":1589436922959, // Transaction time
"bids": [
[
"4.00000000", // PRICE
"431.00000000" // QTY
]
],
"asks": [
[
"4.00000200",
"12.00000000"
]
]
}GET /api/v1/depth
Weight:
Based on limit adjustments:
| Limitations | Weight |
|---|---|
| 5, 10, 20, 50 | 2 |
| 100 | 5 |
| 500 | 10 |
| 1000 | 20 |
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| limit | INT | NO | Default 100. Optional values: [5, 10, 20, 50, 100, 500, 1000] |
Response
[
{
"id": 657,
"price": "1.01000000",
"qty": "5.00000000",
"baseQty": "4.95049505",
"time": 1755156533943,
"isBuyerMaker": false
}
]GET /api/v1/trades
Get recent trades
Weight: 1
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| limit | INT | NO | Default 500; maximum 1000 |
Response
[
{
"id": 1140,
"price": "1.10000000",
"qty": "7.27200000",
"baseQty": "6.61090909",
"time": 1756094288700,
"isBuyerMaker": false
}
]GET /api/v1/historicalTrades
Retrieve historical trades
Weight: 20
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| limit | INT | NO | Default 500; maximum 1000. |
| fromId | LONG | NO | Return starting from which trade id. Defaults to returning the most recent trade records. |
Response
[
{
"a": 26129, // Aggregate tradeId
"p": "0.01633102", // Price
"q": "4.70443515", // Quantity
"f": 27781, // First tradeId
"l": 27781, // Last tradeId
"T": 1498793709153, // Timestamp
"m": true, // Was the buyer the maker?
}
]GET /api/v1/aggTrades
The difference between aggregated trades and individual trades is that trades with the same price, same side, and same time are combined into a single entry.
Weight: 20
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| fromId | LONG | NO | Return results starting from the trade ID that includes fromId |
| startTime | LONG | NO | Return results starting from trades after that time |
| endTime | LONG | NO | Return the trade records up to that moment |
| limit | INT | NO | Default 500; maximum 1000. |
- If you send startTime and endTime, the interval must be less than one hour.
- If no filter parameters (fromId, startTime, endTime) are sent, the most recent trade records are returned by default
Response
[
[
1499040000000, // Open time
"0.01634790", // Open
"0.80000000", // High
"0.01575800", // Low
"0.01577100", // Close
"148976.11427815", // Volume
1499644799999, // Close time
"2434.19055334", // Quote asset volume
308, // Number of trades
"1756.87402397", // Taker buy base asset volume
"28.46694368", // Taker buy quote asset volume
]
]GET /api/v1/klines
Each K-line represents a trading pair. The open time of each K-line can be regarded as a unique ID.
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| interval | ENUM | YES | See the enumeration definition: K-line interval |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| limit | INT | NO | Default 500; maximum 1500. |
- If startTime and endTime are not sent, the most recent trades are returned by default
Response
{
"symbol": "BTCUSDT", //symbol
"priceChange": "-94.99999800", //price change
"priceChangePercent": "-95.960", //price change percent
"weightedAvgPrice": "0.29628482", //weighted avgPrice
"prevClosePrice": "3.89000000", //prev close price
"lastPrice": "4.00000200", //last price
"lastQty": "200.00000000", //last qty
"bidPrice": "866.66000000", //first bid price
"bidQty": "72.05100000", //first bid qty
"askPrice": "866.73000000", //first ask price
"askQty": "1.21700000", //first ask qty
"openPrice": "99.00000000", //open price
"highPrice": "100.00000000", //high price
"lowPrice": "0.10000000", //low price
"volume": "8913.30000000", //volume
"quoteVolume": "15.30000000", //quote volume
"openTime": 1499783499040, //open time
"closeTime": 1499869899040, //close time
"firstId": 28385, // first id
"lastId": 28460, // last id
"count": 76, // count
"baseAsset": "BTC", //base asset
"quoteAsset": "USDT" //quote asset
}GET /api/v1/ticker/24hr
24-hour rolling window price change data. Please note that omitting the symbol parameter will return data for all trading pairs; in that case the returned data is an example array for the respective pairs, which is not only large in volume but also has a very high weight.
Weight: 1 = single trading pair; 40 = When the trading pair parameter is missing (returns all trading pairs)
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | NO |
- Please note that omitting the symbol parameter will return data for all trading pairs
Response
{
"symbol": "ADAUSDT",
"price": "1.30000000",
"time": 1649666690902
} OR
[
{
"symbol": "ADAUSDT",
"price": "1.30000000",
"time": 1649666690902
}
]GET /api/v1/ticker/price
Get the latest price for a trading pair
Weight: 1 = Single trading pair; 2 = No symbol parameter (returns all pairs)
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | NO |
- If no trading pair parameter is sent, information for all trading pairs will be returned
Response
{
"symbol": "LTCBTC",
"bidPrice": "4.00000000",
"bidQty": "431.00000000",
"askPrice": "4.00000200",
"askQty": "9.00000000"
"time": 1589437530011 // Timestamp
}OR
[
{
"symbol": "LTCBTC",
"bidPrice": "4.00000000",
"bidQty": "431.00000000",
"askPrice": "4.00000200",
"askQty": "9.00000000",
"time": 1589437530011 // Timestamp
}
]GET /api/v1/ticker/bookTicker
Return the current best orders (highest bid, lowest ask)
Weight: 1 = Single trading pair; 2 = No symbol parameter (returns all pairs)
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | NO |
- If no trading pair parameter is sent, information for all trading pairs will be returned
Response
{
"symbol": "APXUSDT",
"makerCommissionRate": "0.000200",
"takerCommissionRate": "0.000700"
}GET /api/v1/commissionRate
Get symbol fees
Weight: 20
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| recvWindow | LONG | NO | The assigned value cannot be greater than 60000 |
| timestamp | LONG | YES |
Response ACK:
{
"symbol": "BTCUSDT",
"orderId": 28,
"clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
"updateTime": 1507725176595,
"price": "0.00000000",
"avgPrice": "0.0000000000000000",
"origQty": "10.00000000",
"cumQty": "0",
"executedQty": "10.00000000",
"cumQuote": "10.00000000",
"status": "FILLED",
"timeInForce": "GTC",
"stopPrice": "0",
"origType": "LIMIT",
"type": "LIMIT",
"side": "SELL",
}POST /api/v1/order (HMAC SHA256)
Send order
Weight: 1
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| side | ENUM | YES | See enum definition: Order direction |
| type | ENUM | YES | See enumeration definition: Order type |
| timeInForce | ENUM | NO | See enum definition: Time in force |
| quantity | DECIMAL | NO | |
| quoteOrderQty | DECIMAL | NO | |
| price | DECIMAL | NO | |
| newClientOrderId | STRING | NO | Client-customized unique order ID. If not provided, one will be generated automatically. |
| stopPrice | DECIMAL | NO | Only STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET require this parameter |
| recvWindow | LONG | NO | The value cannot be greater than 60000 |
| timestamp | LONG | YES |
Depending on the order type, certain parameters are mandatory:
| Type | Mandatory parameters |
|---|---|
| LIMIT | timeInForce, quantity, price |
| MARKET | quantity or quoteOrderQty |
| STOP and TAKE_PROFIT | quantity, price, stopPrice |
| STOP_MARKET and TAKE_PROFIT_MARKET | quantity, stopPrice |
Other information:
- Place a
MARKETSELLmarket order; the user controls the amount of base assets to sell with the market order viaQUANTITY.- For example, when placing a
MARKETSELLmarket order on theBTCUSDTpair, useQUANTITYto let the user specify how much BTC they want to sell.
- For example, when placing a
- For a
MARKETBUYmarket order, the user controls how much of the quote asset they want to spend withquoteOrderQty;QUANTITYwill be calculated by the system based on market liquidity. For example, when placing aMARKETBUYmarket order on theBTCUSDTpair, usequoteOrderQtyto let the user choose how much USDT to use to buy BTC. - A
MARKETorder usingquoteOrderQtywill not violate theLOT_SIZElimit rules; the order will be executed as closely as possible to the givenquoteOrderQty. - Unless a previous order has already been filled, orders set with the same
newClientOrderIdwill be rejected.
Response
{
"symbol": "BTCUSDT",
"orderId": 28,
"clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
"updateTime": 1507725176595,
"price": "0.00000000",
"avgPrice": "0.0000000000000000",
"origQty": "10.00000000",
"cumQty": "0",
"executedQty": "10.00000000",
"cumQuote": "10.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"stopPrice": "0",
"origType": "LIMIT",
"type": "LIMIT",
"side": "SELL",
}DELETE /api/v1/order (HMAC SHA256)
Cancel active orders
Weight: 1
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
At least one of orderId or origClientOrderId must be sent.
Response
{
"orderId": 38,
"symbol": "ADA25SLP25",
"status": "FILLED",
"clientOrderId": "afMd4GBQyHkHpGWdiy34Li",
"price": "20",
"avgPrice": "12.0000000000000000",
"origQty": "10",
"executedQty": "10",
"cumQuote": "120",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0",
"origType": "LIMIT",
"time": 1649913186270,
"updateTime": 1649913186297
} GET /api/v1/order (HMAC SHA256)
Query order status
- Please note that orders meeting the following conditions will not be returned:
- The final status of the order is
CANCELEDorEXPIRED, and - The order has no trade records, and
- Order creation time + 7 days < current time
- The final status of the order is
Weight: 1
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
Note:
- You must send at least one of
orderIdororigClientOrderId.
Response
{
"orderId": 38,
"symbol": "ADA25SLP25",
"status": "NEW",
"clientOrderId": "afMd4GBQyHkHpGWdiy34Li",
"price": "20",
"avgPrice": "12.0000000000000000",
"origQty": "10",
"executedQty": "10",
"cumQuote": "120",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0",
"origType": "LIMIT",
"time": 1649913186270,
"updateTime": 1649913186297
}GET /api/v1/openOrder (HMAC SHA256)
Query current open order status.
Weight: 1
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| origClientOrderId | STRING | NO | |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
Note:
- You must send at least one of
orderIdororigClientOrderId.
Response
[
{
"orderId": 349661,
"symbol": "BNBUSDT",
"status": "NEW",
"clientOrderId": "LzypgiMwkf3TQ8wwvLo8RA",
"price": "1.10000000",
"avgPrice": "0.0000000000000000",
"origQty": "5",
"executedQty": "0",
"cumQuote": "0",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0",
"origType": "LIMIT",
"time": 1756252940207,
"updateTime": 1756252940207,
}
]GET /api/v1/openOrders (HMAC SHA256)
Retrieve all current open orders for trading pairs. Use calls without a trading pair parameter with caution.
Weight:
- With symbol 1
- Without 40
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | NO | |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
- If the symbol parameter is not provided, it will return the order books for all trading pairs.
Response
{
"code": 200,
"msg": "The operation of cancel all open order is done."
}DEL /api/v1/allOpenOrders (HMAC SHA256)
Weight:
- 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderIdList | STRING | NO | orderid array string |
| origClientOrderIdList | STRING | NO | clientOrderId array string |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
Response
[
{
"orderId": 349661,
"symbol": "BNBUSDT",
"status": "NEW",
"clientOrderId": "LzypgiMwkf3TQ8wwvLo8RA",
"price": "1.10000000",
"avgPrice": "0.0000000000000000",
"origQty": "5",
"executedQty": "0",
"cumQuote": "0",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0",
"origType": "LIMIT",
"time": 1756252940207,
"updateTime": 1756252940207,
}
]GET /api/v1/allOrders (HMAC SHA256)
Retrieve all account orders; active, canceled, or completed.
- Please note that orders meeting the following conditions will not be returned:
- Order creation time + 7 days < current time
Weight: 5
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | YES | |
| orderId | LONG | NO | |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| limit | INT | NO | Default 500; maximum 1000 |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
- The maximum query time range must not exceed 7 days.
- By default, query data is from the last 7 days.
GET /api/v1/transactionHistory
Response
[
{
"tranId": 1759115482304540227,
"tradeId": null,
"asset": "ASTER",
"symbol": "",
"balanceDelta": "-500.00000000",
"balanceInfo": "TRADE_SOURCE",
"time": 1759115482000,
"type": "TRADE_SOURCE"
}
]Query transaction records
Weight: 30
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| asset | STRING | NO | asset |
| type | STRING | NO | type |
| startTime | LONG | NO | startTime |
| endTime | LONG | NO | endTime |
| limit | LONG | NO | default:100 max:1000 |
Note:
type:TRADE_TARGET,TRADE_SOURCE,TRANSFER_SPOT_TO_FUTURE,TRANSFER_FUTURE_TO_SPOT,TRANSFER_SPOT_TO_SPOT,AIRDROP,DIVIDEND,TRANSFER_REFUND,INTERNAL_TRANSFER,TRANSFER,SWAP,COMMISSION_REBATE,CASH_BACK,STAKING_WITHDRAW,STAKING_CLAIM,STAKING_DELEGATE- If startTime and endTime are not provided, only data from the most recent 7 days will be returned.
Response:
{
"tranId": 21841, //Tran Id
"status": "SUCCESS" //Status
}POST /api/v1/asset/wallet/transfer (HMAC SHA256)
Weight: 5
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| amount | DECIMAL | YES | Quantity |
| asset | STRING | YES | Asset |
| clientTranId | STRING | YES | Transaction ID |
| kindType | STRING | YES | Transaction type |
| timestamp | LONG | YES | Timestamp |
- kindType FUTURE_SPOT(future to spot)/SPOT_FUTURE(spot to future)
Response:
{
"tokenPrice": 1.00019000,
"gasCost": 0.5000,
"gasUsdValue": 0.5
}GET /api/v1/aster/withdraw/estimateFee
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| chainId | STRING | YES | |
| asset | STRING | YES |
Notes:
- chainId: 1(ETH),56(BSC),42161(Arbi)
- gasCost: The minimum fee required for a withdrawal
Response:
{
"withdrawId": "1014729574755487744",
"hash":"0xa6d1e617a3f69211df276fdd8097ac8f12b6ad9c7a49ba75bbb24f002df0ebb"
}POST /api/v1/aster/user-withdraw (HMAC SHA256)
Weight: 1
Parameters:
| Name | Type | Mandatory | Description |
|---|---|---|---|
| chainId | STRING | YES | 1(ETH),56(BSC),42161(Arbi) |
| asset | STRING | YES | |
| amount | STRING | YES | |
| fee | STRING | YES | |
| receiver | STRING | YES | The address of the current account |
| nonce | STRING | YES | The current time in microseconds |
| userSignature | STRING | YES | |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
Note:
- chainId: 1(ETH),56(BSC),42161(Arbi)
- receiver: The address of the current account
- If the futures account balance is insufficient, funds will be transferred from the spot account to the perp account for withdrawal.
- userSignature demo
const domain = {
name: 'Aster',
version: '1',
chainId: 56,
verifyingContract: ethers.ZeroAddress,
}
const currentTime = Date.now() * 1000
const types = {
Action: [
{name: "type", type: "string"},
{name: "destination", type: "address"},
{name: "destination Chain", type: "string"},
{name: "token", type: "string"},
{name: "amount", type: "string"},
{name: "fee", type: "string"},
{name: "nonce", type: "uint256"},
{name: "aster chain", type: "string"},
],
}
const value = {
'type': 'Withdraw',
'destination': '0xD9cA6952F1b1349d27f91E4fa6FB8ef67b89F02d',
'destination Chain': 'BSC',
'token': 'USDT',
'amount': '10.123400',
'fee': '1.234567891',
'nonce': currentTime,
'aster chain': 'Mainnet',
}
const signature = await signer.signTypedData(domain, types, value)Response
{
"feeTier": 0,
"canTrade": true,
"canDeposit": true,
"canWithdraw": true,
"canBurnAsset": true,
"updateTime": 0,
"balances": [
{
"asset": "BTC",
"free": "4723846.89208129",
"locked": "0.00000000"
},
{
"asset": "LTC",
"free": "4763368.68006011",
"locked": "0.00000000"
}
]
}GET /api/v1/account (HMAC SHA256)
Retrieve current account information
Weight: 5
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
Response
[
{
"symbol": "BNBUSDT",
"id": 1002,
"orderId": 266358,
"side": "BUY",
"price": "1",
"qty": "2",
"quoteQty": "2",
"commission": "0.00105000",
"commissionAsset": "BNB",
"time": 1755656788798,
"counterpartyId": 19,
"createUpdateId": null,
"maker": false,
"buyer": true
}
] GET /api/v1/userTrades (HMAC SHA256)
Retrieve the trade history for a specified trading pair of an account
Weight: 5
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| symbol | STRING | NO | |
| orderId | LONG | NO | Must be used together with the parameter symbol |
| startTime | LONG | NO | |
| endTime | LONG | NO | |
| fromId | LONG | NO | Starting trade ID. Defaults to fetching the most recent trade. |
| limit | INT | NO | Default 500; maximum 1000 |
| recvWindow | LONG | NO | |
| timestamp | LONG | YES |
- If both
startTimeandendTimeare not sent, only data from the last 7 days will be returned. - The maximum interval between startTime and endTime is 7 days.
fromIdcannot be sent together withstartTimeorendTime.
- The base URL for all wss endpoints listed in this document is: wss://sstream.asterdex.com
- Streams have either a single raw stream or a combined stream
- Single raw streams format is **/ws/**
- The URL format for combined streams is **/stream?streams=//**
- When subscribing to combined streams, the event payload is wrapped in this format: **{"stream":"","data":}**
- All trading pairs in stream names are lowercase
- Each link to sstream.asterdex.com is valid for no more than 24 hours; please handle reconnections appropriately
- Every 3 minutes the server sends a ping frame; the client must reply with a pong frame within 10 minutes, otherwise the server will close the connection. The client is allowed to send unpaired pong frames (i.e., the client may send pong frames at a frequency higher than once every 10 minutes to keep the connection alive).
- The following messages can be sent via WebSocket to subscribe or unsubscribe to data streams. Examples are shown below.
- The
idin the response content is an unsigned integer that serves as the unique identifier for exchanges of information. - If the
resultin the response content isnull, it indicates the request was sent successfully.
Response
{
"result": null,
"id": 1
}- Request { "method": "SUBSCRIBE", "params": [ "btcusdt@aggTrade", "btcusdt@depth" ], "id": 1 }
Response
{
"result": null,
"id": 312
}- Request { "method": "UNSUBSCRIBE", "params": [ "btcusdt@depth" ], "id": 312 }
Response
{
"result": [
"btcusdt@aggTrade"
],
"id": 3
}-
Request
{ "method": "LIST_SUBSCRIPTIONS", "id": 3 }
Currently, the only configurable property is whether to enable the combined ("combined") stream. When connecting using /ws/ ("raw stream"), the combined property is set to false, while connecting using /stream/ sets the property to true.
Response
{
"result": null,
"id": 5
}- Request { "method": "SET_PROPERTY" "params": [ "combined", true ], "id": 5 }
Response
{
"result": true, // Indicates that combined is set to true.
"id": 2
}-
Request
{ "method": "GET_PROPERTY", "params": [ "combined" ], "id": 2 }
### Error message
| Error message | Description |
|---|---|
| {"code": 0, "msg": "Unknown property"} | Parameters applied in SET_PROPERTY or GET_PROPERTY are invalid |
| {"code": 1, "msg": "Invalid value type: expected Boolean", "id": '%s'} | Only true or false are accepted |
| {"code": 2, "msg": "Invalid request: property name must be a string"} | The provided attribute name is invalid |
| {"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} | Parameter ID not provided or ID has an invalid type |
| {"code": 2, "msg": "Invalid request: unknown variant %s, expected one of SUBSCRIBE, UNSUBSCRIBE, LIST_SUBSCRIPTIONS, SET_PROPERTY, GET_PROPERTY at line 1 column 28"} | Typo warning, or the provided value is not of the expected type |
| {"code": 2, "msg": "Invalid request: too many parameters"} | Unnecessary parameters were provided in the data |
| {"code": 2, "msg": "Invalid request: property name must be a string"} | Property name not provided |
| {"code": 2, "msg": "Invalid request: missing field method at line 1 column 73"} | Data did not provide method |
| {"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} | JSON syntax error |
Payload:
{
"e": "aggTrade", // Event type
"E": 123456789, // Event time
"s": "BNBBTC", // Symbol
"a": 12345, // Aggregate trade ID
"p": "0.001", // Price
"q": "100", // Quantity
"f": 100, // First trade ID
"l": 105, // Last trade ID
"T": 123456785, // Trade time
"m": true, // Is the buyer the market maker?
"M": true // Ignore
}The collection transaction stream pushes transaction information and is an aggregation of a single order.
Stream name: <symbol>@aggTrade
Update speed: real-time
Payload:
{
"e": "trade", // Event type
"E": 123456789, // Event time
"s": "BNBBTC", // Symbol
"t": 12345, // Trade ID
"p": "0.001", // Price
"q": "100", // Quantity
"T": 123456785, // Trade time
"m": true, // Is the buyer the market maker?
}Stream name: <symbol>@trade
Each trade stream pushes the details of every individual trade. A trade, also called a transaction, is defined as a match between exactly one taker and one maker.
Payload:
{
"e": "kline", // Event type
"E": 123456789, // Event time
"s": "BNBBTC", // Symbol
"k": {
"t": 123400000, // Kline start time
"T": 123460000, // Kline close time
"s": "BNBBTC", // Symbol
"i": "1m", // Interval
"f": 100, // First trade ID
"L": 200, // Last trade ID
"o": "0.0010", // Open price
"c": "0.0020", // Close price
"h": "0.0025", // High price
"l": "0.0015", // Low price
"v": "1000", // Base asset volume
"n": 100, // Number of trades
"x": false, // Is this kline closed?
"q": "1.0000", // Quote asset volume
"V": "500", // Taker buy base asset volume
"Q": "0.500", // Taker buy quote asset volume
"B": "123456" // Ignore
}
}The K-line stream pushes per-second updates for the requested type of K-line (the latest candle).
Stream name: <symbol>@kline_<interval>
Update speed: 2000ms
K-line interval parameter:
m (minutes), h (hours), d (days), w (weeks), M (months)
- 1m
- 3m
- 5m
- 15m
- 30m
- 1h
- 2h
- 4h
- 6h
- 8h
- 12h
- 1d
- 3d
- 1w
- 1M
Payload:
{
"e": "24hrMiniTicker", // Event type
"E": 123456789, // Event time
"s": "BNBBTC", // Symbol
"c": "0.0025", // Close price
"o": "0.0010", // Open price
"h": "0.0025", // High price
"l": "0.0010", // Low price
"v": "10000", // Total traded base asset volume
"q": "18" // Total traded quote asset volume
}Refreshed simplified 24-hour ticker information by symbol
Stream name: <symbol>@miniTicker
Update speed: 1000ms
Payload:
[
{
// Same as <symbol>@miniTicker payload
}
]Same as above, but pushes all trading pairs. Note that only updated tickers will be pushed.
Stream name: !miniTicker@arr
Update speed: 1000ms
Payload:
{
"e": "24hrTicker", // Event type
"E": 123456789, // Event time
"s": "BNBBTC", // Symbol
"p": "0.0015", // Price change
"P": "250.00", // Price change percent
"w": "0.0018", // Weighted average price
"c": "0.0025", // Last price
"Q": "10", // Last quantity
"o": "0.0010", // Open price
"h": "0.0025", // High price
"l": "0.0010", // Low price
"v": "10000", // Total traded base asset volume
"q": "18", // Total traded quote asset volume
"O": 0, // Statistics open time
"C": 86400000, // Statistics close time
"F": 0, // First trade ID
"L": 18150, // Last trade Id
"n": 18151 // Total number of trades
}Pushes per-second tag statistics for a single trading pair over a rolling 24-hour window.
Stream name: <symbol>@ticker
Update speed: 1000ms
Payload:
[
{
// Same as <symbol>@ticker payload
}
]Pushes the full 24-hour refreshed ticker information for all trading pairs across the entire market. Note that tickers without updates will not be pushed.
Stream name: !ticker@arr
Update speed: 1000ms
Payload:
{
"u":400900217, // order book updateId
"s":"BNBUSDT", // symbol
"b":"25.35190000", // best bid price
"B":"31.21000000", // best bid qty
"a":"25.36520000", // best ask price
"A":"40.66000000" // best ask qty
}Real-time push of best order book information for the specified trading pair
Stream name: <symbol>@bookTicker
Update speed: Real-time
Payload:
{
// 同 <symbol>@bookTicker payload
}Real-time push of the best order information for all trading pairs
Stream name: !bookTicker
Update speed: Real-time
Payload:
{
"e": "depthUpdate", // Event type
"E": 123456789, // Event time
"T": 123456788, // Transaction time
"s": "BTCUSDT", // Symbol
"U": 100, // First update ID in event
"u": 120, // Final update ID in event
"pu": 99, // Final update Id in last stream(ie `u` in last stream)
"bids": [ // Bids to be updated
[
"0.0024", // Price level to be updated
"10" // Quantity
]
],
"asks": [ // Asks to be updated
[
"0.0026", // Price level to be updated
"100" // Quantity
]
]
} Limited depth information pushed every second or every 100 milliseconds. Levels indicate how many levels of bid/ask information, optional 5/10/20 levels.
Stream names: <symbol>@depth<levels> or <symbol>@depth<levels>@100ms.
Update speed: 1000ms or 100ms
Payload:
{
"e": "depthUpdate", // Event type
"E": 123456789, // Event time
"T": 123456788, // Transaction time
"s": "BTCUSDT", // Symbol
"U": 100, // First update ID in event
"u": 120, // Final update ID in event
"pu": 99, // Final update Id in last stream(ie `u` in last stream)
"b": [ // Bids to be updated
[
"5.4", // Price level to be updated
"10" // Quantity
]
],
"a": [ // Asks to be updated
[
"5.6", // Price level to be updated
"100" // Quantity
]
]
} Pushes the changed parts of the orderbook (if any) every second or every 100 milliseconds
Stream name: <symbol>@depth or <symbol>@depth@100ms
Update speed: 1000ms or 100ms
- Subscribe to wss://sstream.asterdex.com/ws/bnbbtc@depth
- Start caching the received updates. For the same price level, later updates overwrite earlier ones.
- Fetch the REST endpoint https://sapi.asterdex.com/api/v1/depth?symbol=BNBBTC&limit=1000 to obtain a 1000-level depth snapshot
- Discard from the currently cached messages those with
u<= thelastUpdateIdobtained in step 3 (drop older, expired information) - Apply the depth snapshot to your local order book copy, and resume updating the local copy from the first WebSocket event whose
U<=lastUpdateId+1 andu>=lastUpdateId+1 - Each new event’s
Ushould equal exactly the previous event’su+1; otherwise packets may have been lost - restart initialization from step 3 - The order quantity in each event represents the current order quantity at that price as an absolute value, not a relative change
- If the order quantity at a given price is 0, it means the orders at that price have been canceled or filled, and that price level should be removed
- The base URL for the API endpoints listed in this document is: https://sapi.asterdex.com
- The
listenKeyused to subscribe to account data is valid for 60 minutes from the time of creation - You can extend the 60-minute validity of a
listenKeyby sending aPUTrequest - You can immediately close the current data stream and invalidate the
listenKeyby sending aDELETEfor alistenKey - Sending a
POSTon an account with a validlistenKeywill return the currently validlistenKeyand extend its validity by 60 minutes - The WebSocket interface baseurl: wss://sstream.asterdex.com
- The stream name for subscribing to the user account data stream is **/ws/**
- Each connection is valid for no more than 24 hours; please handle disconnections and reconnections appropriately
Response
{
"listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}POST /api/v1/listenKey
Start a new data stream. The data stream will be closed after 60 minutes unless a keepalive is sent. If the account already has a valid listenKey, that listenKey will be returned and its validity extended by 60 minutes.
Weight: 1
Parameters: NONE
Response
{}PUT /api/v1/listenKey
Validity extended to 60 minutes after this call. It is recommended to send a ping every 30 minutes.
Weight: 1
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| listenKey | STRING | YES |
Response
{}DELETE /api/v1/listenKey
Close user data stream
Weight: 1
Parameters:
| Name | Type | Is it required? | Description |
|---|---|---|---|
| listenKey | STRING | YES |
An outboundAccountPosition event is sent whenever an account balance changes; it contains the assets that may have changed due to the event that generated the balance update.
Payload
{
"B":[ //Balance
{
"a":"SLP25", //Asset
"f":"10282.42029415", //Free
"l":"653.00000001" //Locked
},
{
"a":"ADA25",
"f":"9916.96229880",
"l":"34.00510000"
}
],
"e":"outboundAccountPosition", //Event type
"T":1649926447190, //Time of last account update
"E":1649926447205 //Event Time
"m":"WITHDRAW" // Event reason type
}Orders are updated via the executionReport event
Payload
{
"s":"ADA25SLP25", // symbol
"c":"Xzh0gnxT41PStbwqOtXnjD", // client order id
"S":"SELL", // order direction
"o":"LIMIT", // order type
"f":"GTC", // Time in force
"q":"10.001000", // Order quantity
"p":"19.1000000000", // Order price
"ap":"19.0999999955550656", //average price
"P":"0", //stop price
"x":"TRADE", // Current execution type
"X":"PARTIALLY_FILLED", // Current order status
"i":27, // Order ID
"l":"1", // Last executed quantity
"z":"8.999000", // Cumulative filled quantity
"L":"19.1000000000", // Last executed price
"n":"0.00382000", // Commission amount
"N":"SLP25", // Commission asset
"T":1649926447190, //Trasanction Time
"t":18, // transaction id
"m":true, // is this trade the maker side?
"ot":"LIMIT", //original order type
"O":0, // Order creation time
"Z":"171.88089996", // Cumulative quote asset transacted quantity
"Y":"19.1000000000000000", // Last quote asset transacted quantity (i.e. lastPrice * lastQty)
"Q":"0", // Quote Order Qty
"e":"executionReport", // event
"E":1649926447209 // event time
} Execution type:
- NEW - New Order
- CANCELED - Order canceled
- REJECTED - New order was rejected
- TRADE - Order had a new fill
- EXPIRED - Order expired (based on the order's Time In Force parameter)
#错误代码
error JSON payload:
{
"code":-1121,
"msg":"Invalid symbol."
}Errors consist of two parts: an error code and a message. The code is standardized, but the message may vary.
- An unknown error occurred while processing the request.
- Internal error; unable to process your request. Please try again.
- You are not authorized to execute this request.
- Too many requests queued.
- Too many requests; please use the WebSocket for live updates.
- Too many requests; current limit is %s requests per minute. Please use the WebSocket for live updates to avoid polling the API.
- Too many request weights; IP banned until %s. Please use the WebSocket for live updates to avoid bans.
- This IP is already on the white list.
- No such IP has been whitelisted.
- An unexpected response was received from the message bus. Execution status unknown.
- Timeout waiting for response from backend server. Send status unknown; execution status unknown.
- The current order parameter combination is not supported.
- Too many new orders.
- Too many new orders; the current limit is %s orders per %s.
- This service is no longer available.
- This operation is not supported.
- Timestamp for this request is outside of the recvWindow.
- The timestamp for this request was 1000ms ahead of the server's time.
- The signature for this request is invalid.
- The start time in the parameters is after the end time.
- Illegal characters found in a parameter.
- Illegal characters found in parameter %s; legal range is %s.
- Too many parameters sent for this endpoint.
- Too many parameters; expected %s and received %s.
- Duplicate values for a parameter detected.
- A mandatory parameter was not sent, was empty/null, or malformed.
- Mandatory parameter %s was not sent, was empty/null, or malformed.
- Param %s or %s must be sent, but both were empty/null.
- An unknown parameter was sent.
- Not all sent parameters were read.
- Not all sent parameters were read; read %s parameter(s) but %s parameter(s) were sent.
- A parameter was empty.
- Parameter %s was empty.
- A parameter was sent when not required.
- The precision exceeds the maximum defined for this asset.
- No open orders for the trading pair.
- TimeInForce parameter sent when not required.
- Invalid timeInForce.
- Invalid orderType.
- Invalid order side.
- New client order ID was empty.
- The client’s custom order ID is empty.
- Invalid time interval.
- Invalid trading pair.
- This listenKey does not exist.
- The query interval is too large.
- More than %s hours between startTime and endTime.
- Combination of optional parameters invalid.
- The parameter sent contains invalid data.
- Data sent for parameter %s is not valid.
- Invalid newOrderRespType.
- New order rejected.
- Order cancellation rejected.
- Order does not exist.
- API-key format invalid.
- Invalid API key, IP, or permissions for action.
- No trading window could be found for the symbol. Try ticker/24hrs instead.
- Balance is insufficient.
- Unable to fill.
- Order would immediately trigger.
- ReduceOnly Order is rejected.
- Position is not sufficient.
- Reached max open order limit.
- This OrderType is not supported when reduceOnly.
- Invalid order status.
- Price less than 0.
- Price greater than max price.
- Quantity less than zero.
- Quantity less than minimum quantity.
- Quantity greater than maximum quantity.
- Stop price less than zero.
- Stop price greater than max price.
- Tick size less than zero.
- Max price less than min price.
- Maximum quantity less than minimum quantity.
- Step size less than zero.
- Maximum order quantity less than 0.
- Price less than minimum price.
- Price not increased by tick size.
- Client order ID is not valid.
- Client order ID length should not be more than 36 characters.
- Price is higher than mark price multiplier cap.
- Multiplier up less than zero.
- Multiplier down less than zero.
- Composite scale too large.
- Target strategy invalid for orderType %s, reduceOnly %b'
- Invalid depth limit.
- %s is not a valid depth limit.
- Market status sent is not valid.
- The increment of the quantity is not a multiple of the step size.
- Price is lower than mark price multiplier floor.
- Multiplier decimal less than zero.
- Commission invalid.
- Incorrect profit value.
%sless than zero.%sabsolute value greater than%s.
- Invalid account type.
- Tick size precision is invalid.
- Price decimal precision is incorrect.
- The number of decimal places for the step size is incorrect.
- Invalid parameter working type:
%s
- Exceeds the maximum order quantity that can be canceled.
- Invalid parameter working type:
%s
- The balance type is incorrect.
- Reached the stop-loss order limit.
- The quantity must be a positive integer.
- The API key type is invalid.
- The API key is invalid.
- maxPrice and priceDecimal too large, please check.
- Invalid position side.
- The order's position direction does not match the user’s settings.
- Invalid or improper reduceOnly value.
- Method is not allowed currently. Coming soon.
- Invalid price spread threshold.
- Users can only place reduce-only orders.
- User cannot place orders currently.
- clientTranId is not valid.
- The customer's tranId length should be less than 64 characters.
- clientTranId is duplicated.
- The client's tranId should be unique within 7 days.
- ReduceOnly Order failed. Please check your existing position and open orders
- The counterparty's best price does not meet the PERCENT_PRICE filter limit.
- Invalid activation price.
- Quantity must be zero when closePosition is true.
- Reduce only must be true when closePosition is true.
- Order type cannot be a market order if it cannot be canceled.
- Invalid symbol status for opening position.
- Trading pair has been delisted.
- Rejected: Take Profit or Stop order would be triggered immediately.
- Order notional must be at least 5.0 (unless you select Reduce Only)
- Order notional must be no smaller than %s (unless you choose Reduce Only)
- Invalid time interval
- Maximum time interval is %s days
- Limit price cannot be higher than the cap of %s.
- Take-Profit/Stop-Loss price cannot be higher than the cap of %s.
- Price is below the stop price limit.
- Take-Profit/Stop-Loss price must be above the trigger price × multiplier floor.
- Order price (limit or TP/SL) can’t be below %s.