Diffusal

Error Codes

API error codes, HTTP status mapping, and resolution guidance

All Diffusal API errors follow a consistent structure with an error code, HTTP status, and human-readable message. This page documents every error category returned by the API.

Error Response Format

{
  "code": "invalid_argument",
  "message": "symbols must be an array",
  "details": null
}

The code field maps to a standard gRPC/Encore error code. The message field contains a description specific to the failed request.


Error Reference

unauthenticated — HTTP 401

Returned when authentication is missing or invalid.

ContextMessageFix
Missing sessionNo auth data availableComplete the SIWE auth flow to obtain a bearer token
Invalid SIWE nonceInvalid or expired nonceRequest a fresh nonce from POST /api/auth/siwe/nonce before signing
Bad signatureInvalid SIWE signatureEnsure the wallet signing the SIWE message matches the address in the message
Bad signature formatInvalid signature formatSignature must be a valid hex string (0x-prefixed)
Missing SIWE fieldsInvalid SIWE message: no address / no chainId / no nonceInclude all required fields in the SIWE message
Domain mismatchDomain mismatch: expected ...Set the SIWE domain to api.testnet.diffusal.xyz
Chain ID mismatchChainId mismatch: expected ...Set the SIWE chain ID to match the target network
User not foundUser not foundThe wallet address has no associated account

invalid_argument — HTTP 400

Returned when request parameters fail validation.

ContextMessageFix
Symbol validationsymbols must be an arrayPass symbols as a JSON array
Empty symbolsAt least one symbol is requiredInclude at least one symbol in the request
Invalid symbol formatInvalid symbol formatUse the format BTC-82000-C-1736409600 (underlying-strike-type-expiry)
Invalid wallet addressInvalid wallet addressProvide a valid checksummed Ethereum address
Invalid hex stringseriesId must be a hex stringEnsure IDs are 0x-prefixed hex strings
Missing required field{field} is requiredInclude all required fields in the request body
Invalid amountamount must be a positive numeric stringPass amounts as positive decimal strings (e.g., "100.5")
RFQ signaturemmSignature must be a valid hex stringMarket maker signatures must be 0x-prefixed hex
Paginationlimit must be greater than 0Set limit to a positive integer
Time rangestartTime must be before endTimeEnsure the start timestamp is earlier than end

permission_denied — HTTP 403

Returned when the authenticated user lacks required permissions.

ContextMessageFix
Admin requiredAdmin access requiredThis endpoint is restricted to admin wallets
Missing scopeMissing required scope: tradeAuthenticate with an API key or session that has the trade scope
MMM requiredMMM membership requiredThe wallet must be registered as a market maker member
Realtime authAdmin access required for monitoring streamMonitoring streams are admin-only

not_found — HTTP 404

Returned when a requested resource does not exist.

ContextMessageFix
RFQ request(dynamic message)Check the request ID is valid and the RFQ auction has not expired
Order(dynamic message)Verify the order ID exists via GET /api/mm/orders
SeriesSeries not found: {seriesId}The series may not be listed yet; check GET /api/markets

resource_exhausted — HTTP 429

Returned when rate limits are exceeded.

ContextMessageFix
Rate limitrate limit exceededBack off and retry after the cooldown period. See Rate Limits

unavailable — HTTP 503

Returned when a downstream service is temporarily unreachable.

ContextMessageFix
Service not ready(dynamic message)The backend service is starting up or temporarily unavailable. Retry with exponential backoff
Upstream timeout(dynamic message)An internal service call timed out. Retry after a brief delay

internal — HTTP 500

Returned on unexpected server-side failures. These should be rare.

ContextMessageFix
Unexpected errorAn unexpected error occurredReport the issue with your request ID if the error persists
Processing failure(dynamic message)An internal processing step failed. Retry or contact support

Retry Guidance

Error CodeRetry?Strategy
unauthenticatedNoRe-authenticate, then retry the original request
invalid_argumentNoFix the request parameters before retrying
permission_deniedNoUse an account with the required permissions
not_foundNoVerify the resource exists before retrying
resource_exhaustedYesExponential backoff; respect Retry-After header if present
unavailableYesExponential backoff starting at 1 second
internalYesExponential backoff; report if persistent

See Also

On this page