Troubleshooting

Symptoms, causes and fixes for the most common integration problems.

Error codes and their names are listed in Data Structures, Constants and Errors. This page covers what usually causes them.

sendTx returned 200 but my order isn't there

200 means the API accepted the transaction. The sequencer can still reject it, for example because of a price outside the allowed band, a taker order that can't fill at your worst price, or insufficient margin for a taker order. Check account_tx/{account} on WebSocket or GET /api/v1/tx?by=hash&value=<tx_hash>.

invalid nonce (21104)

  • Two processes are using the same API key concurrently. Use one key per process, or serialize.
  • A previous tx failed in the sequencer without consuming its nonce (e.g. ExpiredAt passed, not enough margin for a resting order), so the later nonces you already sent are now one step ahead and fail too. Refetch nextNonce and re-sign. See When a rejected transaction consumes its nonce.
  • Batch nonces must be consecutive (21105).

invalid PublicKey, please run changePubKey (21108) / key check fails

The key at that apiKeyIndex isn't registered for that accountIndex, or it was replaced by another app using the same index. Register it again (Create accounts programmatically).

Signature rejected / wrong chain

The chainId in CreateClient must be 304 for mainnet and 300 for testnet. See Environments & endpoints.

Order size or price is off by powers of ten

You mixed up decimals. base_amount = size × 10^size_decimals, price = price × 10^price_decimals, taken from orderBookDetails for that market. If you use lighter-ts, also watch the display/real multiplier (see Market data).

Order rejected as too small

Below min_base_amount or min_quote_amount (the larger applies).

Integrator fee rejected

The client is on Standard, the fee exceeds the approved max, the approval expired, or the client already has 4 partners. See Partner Attribution.

HTTP 429 / 405

Rate limited. Back off, authenticate requests, reduce polling (use WebSocket), or change tier. See Rate Limits.

WebSocket disconnects

No frame within 2 minutes, too many subscriptions, reading too slowly, or a server deployment. Send pings every ~60 s and reconnect automatically.

account not found (21100) after a deposit

Deposits take a few minutes to credit (CCTP: ~15–20 min). Poll accountsByL1Address, or check UDA status.

WASM: argument N is undefined / expects N args

Every positional argument is required. Pass 0 for unused ones. Check the order in WASM signer functions.

Still stuck?

Open a ticket in #support on Discord with the tx_hash, account index, API key index and the full response.


Did this page help you?