Errors
Binance error codes, mapped by CCXT to typed exceptions.
Every error is a JSON body of exactly two fields with the HTTP status Binance would use:
{ "code": -2010, "msg": "Account has insufficient balance for requested action." }CCXT's binance class maps code to its typed exceptions (AuthenticationError, InsufficientFunds, InvalidOrder, OrderNotFound, RateLimitExceeded, BadSymbol, ...), so try / catch written for Binance works unchanged.
Codes
| HTTP | code | msg | What to do |
|---|---|---|---|
| 401 | -2015 | Invalid API-key, IP, or permissions for action. | Missing X-MBX-APIKEY, revoked key, or signature mismatch. Check the secret and the signed bytes. |
| 400 | -1021 | Timestamp for this request is outside of the recvWindow. | Sync your clock or raise recvWindow (max 30000). |
| 400 | -1102 | Mandatory parameter 'timestamp' was not sent... | Add timestamp. |
| 400 | -1131 | recvWindow must be less than 30000 | Lower recvWindow. |
| 400 | -2010 | This key is bound to a SPOT strategy; use /api/v3 | Wrong family for this key. |
| 400 | -2010 | Strategy not live | No strategy bound, or a write against a strategy that is not LIVE. |
| 400 | -2010 | Account has insufficient balance for requested action. | Reduce size; check free in the account response. |
| 400 | -1121 | Invalid symbol. | Not in Wellat's exchangeInfo. |
| 400 | -4161 | Leverage reduction is not supported in Isolated Margin Mode with open positions | Close or reduce the position first. |
| 400 | -1116 | Invalid orderType. | Use a type the symbol advertises. |
| 400 | -1102 | Bad or missing parameter | Includes sizing and precision failures: round to stepSize / tickSize and meet minNotional from exchangeInfo. |
| 400 | -2013 | Order does not exist. | Wrong orderId or origClientOrderId. |
| 400 | -2011 | Unknown order sent. | Cancel of an order that is already filled or cancelled. |
| 400 | -4120 | Conditional order type not allowed on /fapi/v1/order | Use /fapi/v1/algoOrder for STOP / TAKE_PROFIT. |
| 429 | -1003 | Too many requests... | Back off per Retry-After. See Rate limits. |
| 429 | -1015 | Too many new orders... | Slow down order placement. |
| 418 | -1003 | Way too much request weight used; banned until ... | Stop for two minutes. |
| 404 | -1000 | Unknown route | The path is not part of the Bot API. |
| 413 | -1000 | Request body exceeds the 10240 byte limit | Bodies are small form strings; something is wrong with the client. |
| 503 | -1001 | Internal error; unable to process your request. Please try again. | Wellat could not reach its trading engine in time. Retry with the same newClientOrderId. |
Retrying safely
Wellat never retries a request on your behalf. On a timeout or a 503 you do not know whether an order was placed. Always send newClientOrderId (or clientAlgoId for futures legs) and retry with the same value: a duplicate returns the existing order rather than placing another. Reads are always safe to retry.
What never comes back
No error body is wrapped in { status, message, data } or any other envelope. If you see one, you are not talking to the Bot API.
Updated 10 days ago