Skip to content

Errors

Every JSON-RPC error code the ATLAS API returns, grouped by area, with what each means and what to do, plus WebSocket close codes and HTTP statuses.

On this page

Errors use the standard JSON-RPC error object. code tells you exactly what went wrong. message is a short human-readable name for the code. data, when present, carries the order's client id or how long to wait.

{
  "jsonrpc": "2.0",
  "id": 41,
  "error": {
    "code": 61,
    "message": "Margin exceeded",
    "data": { "clOrdId": "0x5f1c9a7e3b2d4c6e8a0b1d3f5e7c9a2b" }
  }
}

error

codeErrorCode (integer)required
messagestringrequired
dataErrorData

Error data

error.data is a closed object with at most two fields. Tolerate it being absent.

ErrorData

clOrdIdClientOrderId
retryAfterMsinteger

Results, refusals and unknown outcomes

A signed write answers in one of four ways.

AnswerWhat it meansWhat to do
A result with type ending in Accepted or Applied, {"status": "ok", "transferId"} from a transfer or a withdrawal, or {"status": "ok"} from stake, unstake, moveIsolatedMargin, createSubAccount, createSignerPolicy or a key removeThe action took effect. A withdrawal is booked on ATLAS, not yet arrived on the destination chain; an unstake has started its unstaking periodTrack it
An error with a definite code (-32602, -20009, -10013, a protocol refusal and so on)Refused. Nothing changed, and the nonce was not consumedFix the cause. The signed bytes stay admissible until their nonce is used or expires, so sign the corrected request with the same nonce: then only one of the two can ever apply
-10010 (Trading write timeout), -10011 (Publication unknown), -32603, -20003 (Service unavailable), a code you don't recognise, or no replyUnknown. It may still applyLook the txId up with atlas.getTransactionReceipt: committed means it applied. A null receipt proves nothing: check atlas.getTransactions for a recorded refusal, and if there is none, resend the identical signed request. A txId applies at most once

Resending a signed request that already applied is refused by the nonce check, 290 (Nonce not next) or 21 (Nonce stale): it never applies twice while its key stays bound. See Nonce for the one exception, a gapless key bound again before its old requests expire.

Error codes

Branch on code, never on message. New codes may be added: treat one you don't recognise as non-fatal to the session, and on a signed write as an unknown outcome. A protocol refusal, a signed write the venue refused, uses a small positive code such as 61 (Margin exceeded).

Standard JSON-RPC

CodeMeaningWhat to do
-32700Parse error: the body or frame is not valid JSONFix the encoding
-32600Invalid request: not a valid JSON-RPC object, an oversized body, or a binary frameCheck jsonrpc, id and method
-32601Method not foundCheck the method name and that you are on the right endpoint
-32602Invalid params: wrong types, missing fields, unknown fields, bad enum values, uppercase hex ids, a decimal past its signed scale, bad statements, or a params array of the wrong shapeFix the params
-32603Internal error. On a signed write, the outcome is unknownRetry a read with backoff. For a write, look up its txId first

Shared

CodeMessageMeaning
-20001Rate limit exceededWait data.retryAfterMs. See Rate limits
-20002Authentication requiredA private read without a bearer token, or a private stream without sign-in. See HTTP sessions
-20003Service unavailableThe service can't answer right now. Retry with backoff
-20004Subscription not foundatlas.unsubscribe for an id this connection doesn't hold
-20005Subscription limit exceededUnsubscribe from something first
-20006Slow consumer subscription killedSent as a stream.closed reasonCode: read faster, then resubscribe
-20007Slow consumer connection killedThe connection was closed for reading too slowly. Reconnect with jittered backoff
-20008Symbol not foundCheck the symbol
-20009Invalid signatureThe signature doesn't verify: high s, v not 0/1, an unknown scheme byte, or a statements text other than the one signed. A digest mode the command doesn't allow is 18 instead. Don't retry as-is
-20010Unknown termsThe terms id or version isn't published. Re-read atlas.getTerms
-20011Terms hash mismatchThe contentHash doesn't match the published document
-20012Terms not in forceThat version isn't the one in force
-20013Terms purpose mismatchThe terms document named isn't one this request accepts
-20014Restricted regionBuilder onboarding, atlas.getBuilderPayouts and atlas.getBuilderUsers from a restricted or undetermined region. Trading and the public Builder and tier reads are not affected
-20015Venue busyThe venue is at capacity: HTTP 503. Wait data.retryAfterMs (1 second) and retry with backoff. Cancels and reduce-only orders are never refused this way

Trading gateway

CodeMessageMeaning
-10003Sender mismatchThe signing key is neither the account's owner key nor a key bound to it. Bind the key, or sign with one that is
-10006Ingress busyNot submitted. Retry with backoff
-10007Ingress unavailableNot submitted. Retry after data.retryAfterMs
-10008Outcome unavailableNot submitted. Retry with backoff
-10009Auth unavailableThe account is unknown: on the /seq/ws handshake, onboard over HTTP first. Otherwise retry with backoff
-10010Trading write timeoutNo outcome in time. Unknown: look up the txId before resending
-10011Publication unknownSubmission may or may not have happened. Unknown: look up the txId, or resend the same request
-10013Unsupported commandThe envelope holds a command this method doesn't take, for example anything but a setInstructionKey bind in atlas.sendWalletReadyRequest
-10015Command disabledThe command is switched off. Don't retry it
-10017Duplicate request idA JSON-RPC id reused while still in flight on this connection
-10018Handshake timeoutNo /seq/ws handshake within 10 seconds
-10019Handshake expiredThe handshake's ts_ms is outside the ±60-second window
-10022Market closed to new ordersA new order, a replace, or creating or updating a TP/SL or TWAP on a market closed to new orders. Cancels still go through. Nothing was submitted; don't retry until the market reopens

Protocol refusals

A signed write the venue refused gets one of these. Nothing changed and the nonce was not consumed. The pre-trade checks page explains the order checks in detail.

Signature, authority and nonce

CodeMessageMeaning
1Envelope malformedThe envelope doesn't decode: a missing proof, or command bytes that aren't the canonical encoding of the command their selector names
3Transaction type not foundThe envelope's transaction type byte names no transaction type
12Signature malformedA signature that isn't in its one canonical form
16, 17Verification scheme not found, Digest mode not foundThe scheme byte's low nibble names no verification scheme, or its high nibble no digest mode
18Suite not permittedThe scheme byte names a digest mode this command doesn't take
218Selector not foundThe command selector names no command
246Atlas chain id mismatchThe transaction's chainId, or the chainId of a sign-in or login, isn't this deployment's Atlas chain ID (33003)
329Authority mismatchThe transaction's authority isn't the account whose authority its command exercises: the account it names, or that account's Main for an owner-key command
-11111Trading grant requiredThe signer may not make this request for the account, such as an advanced-order request from a key the account hasn't allowed
24Signer key not foundThe signer has no authority on this account or wallet
28Signer key not permittedThe signer's key kind or scope doesn't allow this command, for example the owner key placing an order, or an INSTRUCTION_KEY_SCOPE_REDUCE_ONLY key opening a position, turning the dead-man switch off or lengthening it
27Power row not foundThe command named a sub-account where it needs Main
-11095UnauthorizedThe signer isn't the key this command needs
20Nonce malformedThe nonce's form doesn't match the slot's mode, or an increasing nonce is zero or has its top bit or reserved bits set. Also a bind of an already bound key that names another nonce mode than its slot's
290Nonce not nextA gapless nonce that isn't exactly last + 1
21Nonce staleAn increasing nonce not above the channel's last applied one
22Nonce too oldA gapless expires_at that has passed, or an increasing nonce 60 seconds or more behind
23Nonce too far aheadA gapless expires_at more than 14 days ahead, or an increasing nonce 10 seconds or more ahead
30Wallet pendingThe wallet hasn't completed Enable Trading
219Wallet exit onlyThe wallet may only reduce and exit
157Wallet state transition invalidOnboarding an exit-only wallet
115Wallet not foundA signed message for an address with no wallet yet: onboard with the bind
102Account not foundA named account doesn't exist, or isn't Main where Main is needed
-11114Not activatedThe account isn't activated
330, 331Signer policy not found, Signer policy single signature not permittedA policy signature for a wallet no policy owns, or a single-key signature for a wallet a policy owns. See atlas.getSignerPolicy
332, 333, 334Signer policy member index invalid, Signer policy signature required, Signer policy member mismatchA policy proof with an entry out of member order, fewer signatures than the threshold, or a signature that doesn't recover to its member

Orders

CodeMessageMeaning
34Market not foundThe market isn't listed
44Order not foundThe target isn't a live order of the account (cancel, replace)
33Client order id already setA live order of the account already uses this clientOrderId
32Order malformedThe order fails its shape, for example a missing time in force or a malformed clientOrderId
38Order type invalidPost-only with ioc or fok, or reduce-only with fok on a perp
40Price tick invalidPrice off the tick grid
42, 43Order size out of range, Order size exceededSize off the lot grid, or a size or notional below the minimum or above the maximum
55Price collar exceededThe limit price is outside the band around the last mark
176Close price bound exceededA limit order that closes or flips a position is priced past its margin unit's bankruptcy price
59Post only take not permittedA post-only order would have taken
69Match visit cap exceededThe order would cross too many resting orders: reduce its size. A GTC or FOK order is refused and nothing changed; an IOC order fills up to that point and expires its remainder
60Open interest cap exceededThe order could take the market's open interest past its cap
203Account flag mismatchThe market is open only to wallets holding an access flag yours doesn't hold. Reduce-only orders, and spot sells of what you hold, still pass
326, 328Order id exceeded, Book slots exceededThe market can't take another resting order right now
47Reduce only invalidreduceOnly on a spot market
288Reduce only budget exceededThe reduce-only orders would exceed the position
62Balance exceededNot enough balance
61Margin exceededNot enough margin
318Position notional cap exceededThe position would exceed its limit
65Open order limit exceededToo many open orders for the account's tier, per market or in all: HTTP 429. See Rate limits
51Isolated unit limit exceededToo many isolated positions
49, 50Margin mode not permitted, Margin mode mismatchThe margin mode isn't allowed on this market, or differs from the live position's
302, 303Opening margin not permitted, Opening margin invalidopeningMargin on a cross order, or an amount that can't be used
48Position not foundNo position to act on
53, 54Margin unit exit only, Liquidation activeThe margin unit may only reduce, or is being liquidated
-11018, -11030, -11031, -11049, -11195Risk unavailable, Fx unusable, Fee state unavailable, Margin config unavailable, Mark unusablePricing, risk or fee inputs aren't available right now. Retry later
46Builder fee out of rangeThe Builder Fee rate is outside the venue's range
45Builder fee cap exceededThe rate is above the signing key's cap for this market class
93Dms timeout out of rangetimeoutSeconds isn't 0 or 5 to 86,400
227Dms round pendingThe account's dead-man deadline has passed and its cancels are still running. Retry once they finish

Keys, accounts and funds

CodeMessageMeaning
98Key ceiling exceededThe account already holds the maximum number of bound keys
99Key binding not foundA remove of a key that isn't bound to the account
100Builder fee cap out of rangeA cap is negative, or above the venue's cap for that market class
101Owner key already setrotateOwnerKey to the current owner key
160Owner key proof invalidrotateOwnerKey without a valid proof from the new key
91Sub account allowance exceededThe wallet holds its maximum of sub-accounts
264Sub account address not permittedThe next sub-account address is already another wallet's account
9, 103Amount invalid, Amount grid invalidAn amount that is zero or negative, out of range, or off its grid (a withdrawal's amount sits on the withdrawal grid)
132, 180Withdrawable exceeded, Removable exceededMore than the account may move out, or remove from an isolated position
135, 137Transfer destination invalid, Transfer destination not permittedA transfer to its own source, or an internal transfer out of the wallet
205Asset not foundThe asset isn't listed
206Bridge withdrawal route not foundNo route for that asset to that zone. atlas.getAssets lists each asset's withdrawalZones
342Bridge withdrawal below minimumThe amount is below the asset's withdrawalMinimum
256, 158, 141Staking asset not permitted, Unstake pending, Unstake exceededA stake or unstake that can't apply
202Command size exceededA list or text is longer than its cap
305, 262Rate invalid, Balance out of rangeA bps rate or an amount outside the range ATLAS can hold

The remaining protocol codes cover venue administration and should not answer an ordinary client write.

Account reads, sign-in and sessions

CodeMessageMeaning
-12009ForbiddenThe bearer token doesn't cover this account
-12010Account mismatchThe signed account doesn't match the request, or a private stream on a connection signed in as another account
-12012Challenge expiredGet a new challenge
-12013Challenge invalidNot the challenge issued on this connection
-12014Challenge usedAlready consumed
-12015Unknown accountThe account doesn't exist
-12016Authentication failedThe sign-in or login signature doesn't recover to a key that may act for the account
-12017Already authenticatedThis connection is already signed in
-12018Challenge requiredauth.signIn without an auth.challenge on this connection
-12019, -12020Token expired, Token invalidRefresh the access token, or log in again
-12021, -12022Refresh token invalid, Refresh token reusedLog in again. A reused refresh token ends the session
-12023Signature expiredOnboarding: the bind's expires_at has passed or is more than 14 days ahead, or a TermsAcceptance's expiresAt has passed or is more than one day ahead
-12024Not a builderA Builder read for an account that isn't a builder
-12025Handoff code invalidauth.redeemHandoff with an unknown, expired or already redeemed code, or the wrong codeVerifier. Nothing was consumed

Advanced orders

CodeMessageMeaning
-14001Unknown advanced orderNo such parent, or one the reader may not read
-14002Version not projectedThe read hasn't caught up with minVersion yet. Retry shortly
-14003OMS delegate key mismatchThe delegate key named isn't the account's current one

A refused advanced-order request is usually not an error: it answers with a result whose result is { "rejected": reason }, and it still spends its advanced-order nonce. The exception is a create on a market closed to new orders, which is refused -10022 and spends no nonce. See Advanced orders.

HTTP statuses

Every JSON-RPC answer, success or error, comes back as HTTP 200, with these exceptions:

StatusWhen
401No valid X-Api-Key header, before JSON-RPC is involved. The body is {"error":"authentication required"}
403The IP is over the edge limit. See Edge limit per IP
429Rate limited (-20001) or over the open-order cap (65), including a WebSocket upgrade. The body is the JSON-RPC error
503Venue busy (-20015)

A 429 or 503 also carries x-ratelimit-limit (the limit's name), x-ratelimit-retry-after-ms and Retry-After headers. Back off on the millisecond value. See Rate limits.

WebSocket close codes

CloseMeaning
1008 (Policy Violation) on /seq/ws, after one JSON-RPC error with "id": nullThe handshake failed. The reason is "<code> <message>", with one of the handshake codes
Closed after stream.closed with -20007 for each subscriptionClosed for not keeping up (-20007). Every subscription on the connection is gone. Reconnect with jittered backoff