币安Rest接口(包括wapi)返回的错误包含两部分,错误码与错误信息. 错误码是大类,一个错误码可能对应多个不同的错误信息。 以下是一个完整错误码实例
{
"code":-1121,
"msg":"Invalid symbol."
}
- 未知错误
- 通常是一个内部错误,一般重试即可解决。
- 请检查你的(API)权限
- 排队的请求过多。
- 请求权重过多; 当前限制是 %s 每 %s 的请求权重。 请使用 Websocket Streams 进行实时更新,以避免轮询API。
- 请求权重过多; IP被禁止,直到%s。 请使用 Websocket Streams 进行实时更新,以免被禁。
- (从内部)接收到了不符合预设格式的消息,下单状态未知。
- 后端服务超时,下单状态未知。
- 现货交易服务器当前因其他请求而过载。 请在几分钟后重试。
- 不支持的订单参数组合.
- 下单(撤单)太多
- 服务器下线
- 不支持的操作
- 时延过大,服务器根据接请求中的时间戳判定耗时已经超出了recevWindow。请改善网络条件或者增大recevWindow。
- 时间偏移过大,服务器根据请求中的时间戳判定客户端时间比服务器时间提前了1秒钟以上。(该参数不可由客户端调节)
- 请求中携带的signature与服务器根据规则计算得到的signature不一致。通常是因为客户端代码中使用的apisecret错误。
- 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 was sent '%s'.
- A parameter was empty.
- Parameter '%s' was empty.
- A parameter was sent when not required.
- Parameter '%s' sent when not required.
- Parameter '%s' overflowed.
- Parameter '%s' has too much precision.
- No orders on book for symbol.
- TimeInForce parameter sent when not required.
- Invalid timeInForce.
- Invalid orderType.
- Invalid side.
- New client order ID was empty.
- Original client order ID was empty.
- Invalid interval.
- Invalid symbol.
- This listenKey does not exist.
- Lookup interval is too big.
- More than %s hours between startTime and endTime.
- Combination of optional parameters invalid.
- Invalid data sent for a parameter.
- Data sent for parameter '%s' is not valid.
strategyType
was less than 1000000.
- Invalid JSON Request
- JSON sent for parameter '%s' is not valid
- Invalid ticker type.
cancelRestrictions
has to be eitherONLY_NEW
orONLY_PARTIALLY_FILLED
.
- Symbol is present multiple times in the list.
- Invalid
X-MBX-SBE
header; expected<SCHEMA_ID>:<VERSION>
.
- Unsupported SBE schema ID or version specified in the
X-MBX-SBE
header.
- SBE is not enabled.
- Order type not supported in OCO.
- If the order type provided in the
aboveType
and/orbelowType
is not supported.
- Parameter '%s' is not supported if
aboveTimeInForce
/belowTimeInForce
is not GTC. - If the order type for the above or below leg is
STOP_LOSS_LIMIT
, andicebergQty
is provided for that leg, thetimeInForce
has to beGTC
else it will throw an error.
- NEW_ORDER_REJECTED
- CANCEL_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.
- Order was canceled or expired with no executed qty over 90 days ago and has been archived.
这个错误代码是由撮合引擎抛出的,引擎还会抛出2010和2011,具体原因需要参考下面列出的具体消息
错误消息 | 描述 |
---|---|
"Unknown order sent." | 找不到订单, (根据请求里发送的 orderId , clOrdId , origClOrdId )。 |
"Duplicate order sent." | 客户自定义的订单号重复了。 |
"Market is closed." | 该交易对交易关闭了。 |
"Account has insufficient balance for requested action." | 账户金额不足。 |
"Market orders are not supported for this symbol." | 该交易对无法发起市价单。 |
"Iceberg orders are not supported for this symbol." | 该交易对无法发起冰山订单。 |
"Stop loss orders are not supported for this symbol." | 该交易对无法发起止损单。 |
"Stop loss limit orders are not supported for this symbol." | 该交易对无法发起止损限价单。 |
"Take profit orders are not supported for this symbol." | 该交易对无法发起止盈单。 |
"Take profit limit orders are not supported for this symbol." | 该交易对无法发起止盈限价单。 |
"Price * QTY is zero or less." | 订单金额必须大于0。 |
"IcebergQty exceeds QTY." | 冰山订单中小订单的Quantity必须小于总的Quantity。 |
"This action is disabled on this account." | 联系客户支持; 该账户已禁用了某些操作。 |
"This account may not place or cancel orders." | 联系客户支持: 该账户已被禁用了交易操作。 |
"Unsupported order combination" | orderType , timeInForce , stopPrice , icebergQty 某些参数取某些值的时候另一些参数必须/不得提供。 |
"Order would trigger immediately." | 止盈、止损单必须在未来触发,如果条件太弱现在的市场行情就可以触发(通常是误操作填错了条件),就会报这个错误。 |
"Cancel order is invalid. Check origClOrdId and orderId." | 撤销订单必须提供 origClOrdId 或者 orderId 中的一个。 |
"Order would immediately match and take." | LIMIT_MAKER 订单如果按照规则会成为Taker,就会报此错。 |
"The relationship of the prices for the orders is not correct." | OCO 订单中设置的价格不符合报价规则:请参考以下示例: BUY :LIMIT_MAKER price < Last Traded Price < stopPrice SELL :LIMIT_MAKER price > Last Traded Price > stopPrice |
"OCO orders are not supported for this symbol" | OCO 订单不支持该交易对。 |
"Quote order qty market orders are not support for this symbol." | 这个交易对,市价单不支持参数 quoteOrderQty 。 |
"Trailing stop orders are not supported for this symbol." | 此symbol不支持 trailingDelta 。 |
"Order cancel-replace is not supported for this symbol." | 此symbol不支持 POST /api/v3/order/cancelReplace 或者 order.cancelReplace (WebSocket API)。 |
"This symbol is not permitted for this account." | 账户和交易对的权限不一致 (比如 SPOT , MARGIN 等)。 |
"This symbol is restricted for this account." | 账户没有权限在此交易对交易 (比如账户只拥有 ISOLATED_MARGIN 权限,则无法下SPOT 订单)。 |
"Order was not canceled due to cancel restrictions." | cancelRestrictions 设置为 ONLY_NEW 但订单状态不是 NEW 或 cancelRestrictions 设置为 ONLY_PARTIALLY_FILLED 但订单状态不是 PARTIALLY_FILLED 。 |
"Rest API trading is not enabled." / "WebSocket API trading is not enabled." | 下单时,服务器没有设置为允许访问 TRADE 的接口。 |
收到该错误码代表撤单或者下单失败。
收到该错误码代表撤单和下单都失败。
错误信息 | 描述 |
---|---|
"Filter failure: PRICE_FILTER" | 检查价格的上限、下限、步进间隔。 |
"Filter failure: PERCENT_PRICE" | 检查订单中价格是否相对于过去N分钟的平均价格变动超过了百分之X。 |
"Filter failure: LOT_SIZE" | 检查订单中数量的上限、下线、步进间隔。 |
"Filter failure: MIN_NOTIONAL" | price * quantity ,也就是订单金额,是否超过了最小值。 |
"Filter failure: ICEBERG_PARTS" | 冰山订单只能被分割成有限个小订单。 |
"Filter failure: MARKET_LOT_SIZE" | 与LOT_SIZE含义一致,只是对市价单生效。 |
"Filter failure: MAX_POSITION" | 账户的仓位已达到定义的最大限额。 它是由基础资产余额的总和以及所有未平仓买入订单的数量之和组成的。 |
"Filter failure: MAX_NUM_ORDERS" | 账户在该交易对下最多挂单数。 |
"Filter failure: MAX_NUM_ALGO_ORDERS" | 账户在该交易对下最多的止盈/止损挂单数。 |
"Filter failure: MAX_NUM_ICEBERG_ORDERS" | 账户在该交易对下最多的冰山订单数。 |
"Filter failure: TRAILING_DELTA" | trailingDelta 不在该订单类型的筛选器的定义范围内。 |
"Filter failure: EXCHANGE_MAX_NUM_ORDERS" | 账户在交易所有太多未结订单。 |
"Filter failure: EXCHANGE_MAX_NUM_ALGO_ORDERS" | 账户在交易所有太多的未平仓止损和/或止盈订单。 |
"Filter failure: EXCHANGE_MAX_NUM_ICEBERG_ORDERS" | 账户在交易所有太多未平仓的冰山订单。 |