Skip to content
The Mog guide

Errors

Every mog command exits with one of these codes. With --json, the same number is in error.exit.

CodeMeaningRetry
0Done—
1An unexpected fault in the CLIReport it
2Bad arguments. Nothing was signed or sent.Fix the command
3No usable session key, or a wallet signature is missing. Nothing was sent.Fix the key
4The venue or the relay refused. Nothing changed.Read error.code first
5A service did not answer. Nothing was sent.Safe
6A signed instruction may be on chain, or may still landWait for the deadline, then read state

After exit 6, the first signed instruction can still land until its deadline. Anyone who holds its bytes can deliver it, the relay included. Find that time in this order:

  • error.details.liveUntil or error.details.deadline, when present.
  • A wallet-signed instruction (withdraw, give up a claim, grant or revoke a key): mog pending show <id> prints its deadline. The id is error.details.pending.
  • A trading instruction signed by the CLI’s session key: 5 minutes after the CLI signed it. The CLI signs a few seconds after the command starts, so wait at least 6 minutes from the start.

Do not sign a new instruction for the same decision before then. After it, run mog orders or mog positions, and sign again only if the first instruction did not apply. A second signature is a second instruction, so an early retry can open a second position.

POST /submit answers a refusal with a JSON body: error, code, and preBroadcast. preBroadcast: true means this request sent nothing. An earlier delivery of the same signed bytes may still be on its way, so treat it like exit 6 when you sent those bytes before. Some refusals add index, the failing instruction, and retryAfterMs.

CodeHTTPMeaning
ORIGIN_NOT_ALLOWED403A browser request from a site the relay does not serve. Send from your server instead.
BAD_BODY, BAD_JSON, BAD_INTENT400The body is not { "intents": [ … ] }
TOO_MANY_INTENTS400Too many instructions in one request
BODY_TOO_LARGE413The body is too large
BAD_TARGET, WRONG_TARGET, UNKNOWN_SELECTOR400The instruction is not a signed entry point of that contract
BAD_CALLDATA400The call data is malformed
BAD_SIGNATURE400The signature is malformed
MIXED_TARGETS, SINGLE_NOT_BATCHABLE400Trading instructions batch together. Key and withdrawal instructions go one per request.
FORM_RETIRED400The instruction uses an old signed format. Sign it again with the current one.
EXPIRED400The signed deadline is behind the chain clock. Sign again.
CodeHTTPMeaning
NOT_AUTHORIZED403The signer is not the account or a live session key of it. With retryAfterMs, the relay has not seen the key yet: a key registered seconds ago needs one more moment. Send the same instruction again after retryAfterMs.
NONCE_USED409This signed instruction already applied, or its nonce was spent
INTENT_WOULD_FAIL400A dry run on the chain failed. revert names the reason.
BELOW_SPONSORED_MIN402Below the smallest amount the relay pays gas for. An order: raise the margin, or send it yourself. A withdrawal or a claim give-up: take the whole balance or claim, or send it yourself.
UNFUNDED402The relay grants session keys only to accounts with a funded balance
TOP_UP_NOT_ACCEPTED409The market’s prices are behind. Send the same instruction again later.
RENOUNCE_NOT_ACCEPTED409The delivery’s work budget left cash waiting to be paid out. Send the same signed instruction again with a larger budget (--max-steps in the CLI), or later.
CodeHTTPMeaning
RATE_LIMITED429A request window is spent. window names which: your address (each instruction in a batch counts), your signer, or all callers.
ROOT_BUDGET_SPENT429The account has used the relay’s daily network-fee budget. Send it yourself, or wait for retryAfterMs.
RETRY_CAP_SPENT429The relay delivered this signed instruction its daily maximum of times
INTENT_IN_FLIGHT429An instruction in the request is part of a delivery the relay has sent and not yet confirmed. Do not send it again: wait for that delivery, then read state. The message says “wait for that transaction”. If the message says “did not reach the node; send it again”, the earlier delivery failed, and you can send the same request again after retryAfterMs.
GAS_ABOVE_CEILING503The network fee is above the relay’s ceiling
BUSY503The relay is at capacity
CHAIN_UNREACHABLE, CHAIN_READ_FAILED503The chain did not answer. The relay sent nothing.
CodeHTTPMeaning
SEND_FAILED502With preBroadcast: true, the relay sent nothing. With preBroadcast: null, the network may hold the transaction: treat it like exit 6 and wait for the deadline before you sign again.

A signed instruction can apply only once. Sending the same signed bytes again never applies it twice. Signing a new instruction for the same order can.