Skip to main content

Error envelope

Earn, Trade and Borrow return the same JSON envelope for errors.
Branch on statusCode and, where present, details.code. Typed Earn errors that do not set details.code usually carry the class name in message. The Zama typed errors (InvalidArgumentError, MissingArgumentsError, NotImplementedError) always do. An enter that leaves out a required argument returns Field '<name>' is required in message, with no details. Do not parse details.reason or other free text: its wording can change. A typed Earn error and a request-validation error:

Rate limits

Requests are limited per API key. Every response on a keyed route carries: A 429 has message: "Rate limit exceeded". Limits depend on your plan; see Rate limits.

Retry guidance

Never resubmit a signed transaction blindly. On Earn, call GET /v1/transactions/{transactionId} first; a different signed transaction or hash on a terminal transaction returns 412. On Trade and Borrow, a transaction can be submitted once and any second submit returns 400, so poll GET /v1/actions/{id} instead.
Reads and idempotent lookups are safe to retry. Creating actions is not idempotent: a retried POST /v1/actions/enter can create a second action, so list actions for the address first.

Endpoint-specific Earn errors

For RWA checks before you build an action, use Get KYC status. Geo-blocking is described in Geo-blocking. Zama confidential vaults have their own argument errors, for encrypted amounts, legs and input tokens. See Zama errors and troubleshooting.

Request validation

Earn, Trade and Borrow report invalid request bodies as 400 with validation.message listing each failed constraint. Check the request body against the operation’s schema before retrying.