API Reference
Error Codes
How the engine reports rejections, and what to do about each.
Shape
Errors return a non-2xx HTTP status and a JSON body:
{ "error": "insufficient_margin", "message": "free balance below required margin" }Always branch on error, never on the human-readable message — the wording may change.
HTTP statuses
| Status | Meaning | Retry? |
|---|---|---|
400 | Malformed request or failed validation | No — fix the request |
401 | Signature did not recover to an authorised key | No — re-sign |
404 | Unknown route, pair or address | No |
409 | Duplicate clientNonce | Yes — re-sign with a fresh nonce |
429 | Rate limited | Yes — back off |
5xx | Engine or node error | Yes — with backoff |
Common errors
error | Cause | Fix |
|---|---|---|
invalid_signature | Signed value differs from the posted body | Rebuild the digest from the exact body |
session_expired | Session key past its expiry | Create a new session key |
session_not_found | Key was revoked or never registered | Re-create the session |
insufficient_margin | Free balance below required margin | Deposit, or reduce size/leverage |
leverage_exceeded | Above the 50x maximum | Lower leverage |
reduce_only_violation | Reduce-only order would increase the position | Clear the flag or lower size |
market_halted | Trading halted for the pair | Wait — halts are safety-only |
duplicate_nonce | clientNonce already used | Re-sign with a new nonce |
price_out_of_band | Limit price too far from mark | Move the price toward the mark |
unknown_pair | pair_id is not one of the live 15 | Check /oracle/prices |
409 is expected under load
A duplicate nonce is normal when retrying. Re-sign with a fresh clientNonce rather than
re-posting the same payload — the SDK does this for you, up to three attempts.