Skip to main content

Error Codes

Spot APIs return errors as {"error": "<STRING_CODE>"} plus the HTTP status. This page lists every code emitted by the spot subsystem grouped by category.

Auth & permission

HTTPerrorWhen
401(empty body)Missing / invalid JWT, missing / wrong HMAC signature, or timestamp outside ±60000 ms of server time.
403API Key permission denied: transfers not allowedAPI-key caller hit POST /spot/transfer (JWT only).
403API Key permission denied: withdraws not allowedAPI-key caller hit POST /spot/withdraw/request (JWT only).
403FORBIDDENCanceling an order that belongs to another user. Withdrawals are different: another user's withdrawal id returns 404 not found, never 403.

Market state

HTTPerrorWhen
404MARKET_NOT_FOUNDsymbol doesn't exist in spot_markets.
404TICKER_NOT_FOUNDGET /spot/ticker/24hr?symbol=… for a symbol with no ticker row yet. Resolves after the first fill.
409MARKET_HALTEDMarket in halted status; no new orders.
410MARKET_DELISTEDMarket in delisted status; terminal.
400market.status invalidMarket row has an unrecognized status value.

Order placement (POST /spot/orders)

HTTPerrorWhen
400invalid sideside not in sell.
400invalid typetype not in market.
400invalid tiftif not in post_only. Note: lowercase only.
400price required for limitlimit order missing price.
400quantity required for limitlimit order missing quantity.
400quantity required for market sellmarket SELL missing quantity.
400quote_quantity required for market buymarket BUY missing quote_quantity.
400INVALID_TICKprice is not a multiple of the market's tick_size.
400INVALID_LOTquantity is not a multiple of the market's lot_size.
400BELOW_MIN_NOTIONALprice * quantity < min_notional.
400INSUFFICIENT_BALANCEThe lock the order needs (base for SELL, quote for BUY) exceeds caller's available.
400POST_ONLY_REJECTtif=post_only order would have crossed the book at placement.
400SELF_TRADENew order would cross caller's own resting order (DECLINE_TAKER policy).

Order management

HTTPerrorWhen
400invalid idPath :id is not a UUID.
404ORDER_NOT_FOUNDOrder doesn't exist, is terminal, or belongs to another user.
404not foundWithdrawal id doesn't exist or belongs to another user.

Engine availability

HTTPerrorWhenAction
503spot trading disabledSPOT_TRADING_ENABLED=false on this server.Permanent for this env.
503ENGINE_BUSYEngine mpsc backlog full — POST /spot/orders and GET /spot/depth only.Retry with backoff (200 / 400 / 800 ms).
503ENGINE_RESTARTINGRecovery in progress — POST /spot/orders and GET /spot/depth only.Retry after a few seconds.

Engine overflow surfaces differently on the cancel endpoints: DELETE /spot/orders/:id maps it to 500 DB_ERROR, and DELETE /spot/orders (cancel-all) returns 200 with an empty canceled array — indistinguishable from having no open orders.

Transfer (POST /spot/transfer)

HTTPerrorWhen
400invalid direction: <direction>direction not in spot_to_perp.
400amount must be positiveamount <= 0.
400insufficient balanceSource side does not have enough free USDT.
400unsupported token: <token>MVP supports USDT only.

Withdraw (POST /spot/withdraw/request)

HTTPerrorWhen
400unsupported token: <token>Token not in the spot wallet's supported list (currently DF).
400amount below minimum <min>amount below the server-configured minimum. No separate non-positive check exists — zero / negative amounts fail here too.
400insufficient balanceavailable < amount for the requested token.
409you have a pending withdrawal — submit it on-chain or wait for it to expire before signing a new oneA signed withdrawal at or after the contract's current nonce already exists.
409withdrawal slot conflict — try again in a momentThe (user, chain, nonce) slot is occupied by a non-expired row.
500chain query failedReading the vault's on-chain release nonce failed.
500signer unavailableThe backend withdraw signer could not be initialized.
500sign failedEIP-712 signing failed.
503spot blockchain not initializedThe BSC blockchain service is not running.

Admin (/admin/spot/*)

HTTPerrorWhen
400INVALID_STATUSstatus not in delisted.
400AMOUNT_NON_POSITIVECredit amount is <= 0.
404DISABLEDPOST /admin/spot/balances/credit called when TESTNET_ONLY != true.
409MARKET_EXISTSCreating a market whose id already exists.
500DB_ERRORPostgres error during the admin write.

Server faults

HTTPerrorWhen
500DB_ERRORUnexpected Postgres error on the trading endpoints (orders / trades / market data). Investigate logs.
500internal error / internalUnexpected Postgres error on the wallet-side endpoints (/spot/transfer, /spot/withdraw*, /spot/withdrawals*). These endpoints never return DB_ERROR.
500(html body)Panic in the request task. Capture the request and report.