Market maker programme
Errors and retries
Every error code the API returns, and what to do about each one.
Branch on error.code, never on the message text: codes are stable and messages are not.
| Code | HTTP | What it means and what to do |
|---|---|---|
MISSING_API_KEY | 401 | No key in the request. Send Authorization: Bearer or X-API-Key. |
INVALID_API_KEY | 401 | The key is not recognised. Check you are on the right environment. |
API_KEY_REVOKED | 401 | The key was revoked. Move to the current one, or request a new key. |
API_KEY_EXPIRED | 401 | The key has expired. Request a new key. |
MARKET_MAKER_SUSPENDED | 403 | Cardiv suspended the account. Resting orders are unaffected; contact support. |
PAIR_NOT_ALLOWED | 403 | The pair is not on your account. Check limits.allowedPairs. |
INVALID_CLIENT_ORDER_ID | 400 | The clientOrderId is missing your account prefix. error.expectedPrefix carries the required value. |
VALIDATION_ERROR | 400 | Malformed request, or the order is below the minimum size. Not retryable unchanged. |
INSUFFICIENT_BALANCE | 400 | Nothing spendable in the token this order spends, either none at all or all of it already committed to resting orders. |
LEDGER_COMMAND_REJECTED | 400 | The command was refused, and this code also covers a submission timeout. Check GET /orders/{orderId} before you retry. |
MAX_OPEN_ORDERS | 429 | You are at your open order cap. Cancel something, or ask for a higher cap. |
RATE_LIMITED | 429 | Past your per-minute limit. The body carries the limit. Back off. |
CACHE_EXPIRED | 410 | Past the five minute prepared-transaction deadline. Prepare again. |
CONTRACT_NOT_FOUND | 404 | A stale identifier, or the order is no longer active. Re-read GET /orders. |
ORDER_ALREADY_FILLED | 409 | The order filled before your cancellation was processed. |
Retry policy
- 4xx is not retryable unchanged. Fix the request first.
- Prepare, on 5xx or timeout, is retryable with the same
clientOrderId. Placement is idempotent on that value, so a retry cannot double your exposure. - Submission, on 5xx or timeout, is never retried blind. Check
GET /orders/{orderId}first: the transaction may have committed despite the failed response, and re-preparing an order that is already resting doubles your position.
One known limitation
Calden currently collapses submission failures into a single generic 502, so a degraded network and a rejected signature look the same from the response alone. On an unexplained 502, check GET /orders/{orderId}, then contact Cardiv support with the correlationId and ask for the server-side cause.
Need help
Write to support@wolfedgelabs.com and include your party ID.