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
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 as400 with validation.message listing each failed constraint. Check the request body against the operation’s schema before retrying.
