# Errors

## Error object

Every error has the same shape, the error object, on every endpoint and on the
WebSockets. A request-level REST error puts it in `data`:

```json
{
  "status": "error",
  "data": {
    "code": "request_uncertain",
    "detail": "request_uncertain",
    "msg": "request outcome is unknown; reconcile through orderUpdates or openOrders before retrying",
    "maybeSent": true
  },
  "server_time_ms": 1790085600000
}
```

| Field | Meaning |
| --- | --- |
| `code` | What to do about the error, one of the 14 codes below. Branch on it. |
| `detail` | The cause, for your logs and for support. It holds the value that `code` held before the 14 codes. Do not branch on it, except on the values that [Details that are a contract](#details-that-are-a-contract) lists. Expect new values without notice. |
| `msg` | A message for people. |
| `maybeSent` | `true` when the action reached the venue or may have. Absent otherwise. |
| `retryAfterMs` | The milliseconds to wait before a retry can succeed. Present only when Mosaiq knows the wait. |
| `cap` | On `limit_reached` only: the limit of your cap tier that refused the action. It is a contract, like the values that [Details that are a contract](#details-that-are-a-contract) lists. See [The limit in `cap`](#the-limit-in-cap). |

Read an error in this order. `maybeSent` says whether the action may have
reached the venue, then `code` says what to do. Most clients need nothing more.
When you need a finer reaction than `code` gives, read the contract signal of
that code: `cap` on `limit_reached`, or a `detail` value that
[Details that are a contract](#details-that-are-a-contract) lists. Log the
other `detail` values, and never branch on `msg`: it is for people and can
change.

Read `maybeSent` before you act on `code`. When it is `true`, the action may
execute or may already have executed. Check it on
[`orderUpdates`](/api/websocket#orderupdates) or
[`openOrders`](/api/open-orders) before you send it again, whatever the
`code`. When `maybeSent` is absent, Mosaiq proves that it sent nothing to the
venue, and you can send the action again without a check. One `code` can come
with or without `maybeSent`. The field depends on what happened to the action,
not on the code.

## Retry delays

`retryAfterMs` is a hint. Without it, use your own backoff. Its absence does
not mean that a retry fails: `code` says whether to retry. These errors carry
it:

| `detail` | `retryAfterMs` is |
| --- | --- |
| `rate_limited` | The time until the budget that refused the request admits one again: your exchange budget, the HTTP budget of your IP, the API key budget, invitation redemptions, or new WebSocket connections. |
| `account_operation_in_progress` | The longest time that the pause can still last. |
| `maintenance_in_progress` | The time until the maintenance ends, when its end is known. |
| `congestion_share_exhausted` | The wait of your share of the Hyperliquid allowance. When this refusal ends an order, its `failed` row on `orderUpdates` carries the same wait, in an `update` and in a `snapshot`. |
| `send_capacity` | On an `orderUpdates` row: the wait until Mosaiq's own rate budget admits the order again, when Mosaiq knows it. In a `snapshot`, the part of the wait that is left. The item error of `POST /v1/exchange` never carries it. |
| `broker_capacity` | On an item or a `withdraw` error: the time until the move between your USDC balance and your [token cash](/api/exchange#token-cash) lands, when Mosaiq knows it. On a live `orderUpdates` row: the time until margin reaches the venue account, when Mosaiq knows it. |

`inflight_limit_exceeded`, the cap on concurrent WebSocket connections, and a
busy maintenance subscription carry no `retryAfterMs`. Their slot frees when an
answer arrives or a connection closes, not at a known time.

## What to do

| `code` | What to do |
| --- | --- |
| `temporarily_unavailable` | Retry with backoff, or after `retryAfterMs`. |
| `rate_limited` | Slow down. A budget at Mosaiq is spent: your own, or, for a withdrawal, the rolling cap that all clients share. |
| `out_of_service` | Stop retrying and alert. For `venue_contained`, stop sending actions to the affected venue. See [Details that are a contract](#details-that-are-a-contract). |
| `invalid_request` | Fix the request. Never send it again unchanged. |
| `limit_reached` | Reduce the size, add funds, or close positions, then retry. |
| `trading_restricted` | Wait until the market or the account reopens. A reduce-only order can often pass: [Details that are a contract](#details-that-are-a-contract) says when. |
| `order_not_found` | Do not retry. The order is gone, filled or cancelled. Update your book. |
| `blocked_by_other_action` | Another action on this order blocks this one. Wait until `orderUpdates` shows the outcome of the other action on this order, then retry. |
| `duplicate_id` | Check whether your earlier action with this id went through, then use another id. |
| `unauthorized` | Refresh your token, or send a Para JWT where the endpoint takes the wallet session. |
| `forbidden` | Fix the onboarding or ownership problem. No retry fixes it. |
| `venue_rejected` | The venue received the action and refused it. Send it again with other parameters, such as the price, the deadline, or the size. Only `orderUpdates` rows carry this code. Read the row's `status` to know whether the order ended or is still live (for example after a refused modify), and use `failure.detail` and `failure.reason` for diagnostics. |
| `request_uncertain` | Mosaiq does not know whether the action went through. Reconcile through `orderUpdates` or `openOrders` before any retry. |
| `internal_error` | Reconcile, then report the bug. |

Earlier releases sent `blocked_by_other_action` as `order_busy`. Only the name
changed: the causes, the `detail` values, and the reaction are the same.

The endpoint pages list their errors with the HTTP status, `code`, and `detail`
of each. One `code` can come with several HTTP statuses, so branch on `code`.

## Where errors appear

The error object appears in these places:

* A request-level REST error: `data`, as in the example above.
* A refused item of a [`POST /v1/exchange`](/api/exchange#response) batch: the
  item itself, with `"status": "error"` and its `cloid` when known.
* The [write WebSocket](/api/exchange-websocket#frames): with
  `nestedFormat=false`, its answers are the REST bodies above with the frame's
  `id` first. A frame refused whole carries the object in `data`, and a
  refused item is the REST item. The default `post` envelope carries the same
  object ([Migrate from the post envelope](/api/exchange-websocket#migrate-from-the-post-envelope)).
* A WebSocket subscription error: `data` of a message with
  `"status": "error"`.
* An [`orderUpdates`](/api/websocket#orderupdates) row: `failure`, with
  `reason` and `rawCode` instead of `msg`.

## The limit in `cap`

A `limit_reached` error carries `cap` when a limit of your cap tier refused the
action. `cap` names that limit, so you can react to one limit apart from the
others without reading `msg`. Its values keep their names and their meaning.

```json
{
  "code": "limit_reached",
  "detail": "cap_exceeded",
  "msg": "cap exceeded: initial margin usage cap exceeded",
  "cap": "max_initial_margin_usage_rate"
}
```

Each value is the [`userCaps`](/api/clearinghouse-state#positions-and-margin) field of
the limit, in `snake_case` and without its `Usdc` suffix:

| `cap` | `userCaps` limit |
| --- | --- |
| `max_initial_margin_usage_rate` | `maxInitialMarginUsageRate`, against the `initialMarginUsageRate` of the account. |
| `max_open_orders` | `maxOpenOrders` |
| `max_single_order_notional` | `maxSingleOrderNotionalUsdc` |
| `max_open_order_notional` | `maxOpenOrderNotionalUsdc` |
| `max_gross_notional` | `maxGrossNotionalUsdc` |
| `max_asset_venue_notional` | `maxAssetVenueNotionalUsdc` |
| `max_outcome_owner_payout` | The outcome payout cap of the tier, over the open outcome payout of every account of the owner. `userCaps` does not show it. |

A `limit_reached` error without `cap` comes from another limit:

* the margin of the account;
* a priority fee that a reduce-only order cannot pay;
* a spot buying power or token balance;
* the payout cap of one outcome over every account
  (`cap exceeded: max_outcome_payout`);
* the funds of a withdrawal or a transfer;
* a reduce-only order;
* the number of sub-accounts.

Mosaiq answers the first limit that refuses the order. For a perp order, it
checks the limits of the tier first, then the margin of the account, then
`max_initial_margin_usage_rate`. So an order above both the margin and the
initial margin usage rate gets `cap exceeded: not enough margin`, without
`cap`. For a spot order, Mosaiq checks the buying power or the token balance
before the limits of the tier.

Expect new `cap` values when the tier gains a limit. Handle an unknown value
like a `limit_reached` error without `cap`.

## Details that are a contract

`code` groups causes that call for the same reaction. A few causes call for
another reaction, or close another scope, than the rest of their code. Their
`detail` values below are a contract: they keep their name and their meaning,
and no other cause of the same `code` answers them. Branch on them beside
`code`. Every other `detail` value can change without notice.

| Code | Detail | Where | What to do |
| --- | --- | --- | --- |
| `temporarily_unavailable` | `venue_recovering` | Items | The venue of the item is recovering, or halted after a failure. Mosaiq refuses orders on it until [`venueData.meta.recovery`](/api/clearinghouse-state#venue-status) shows the venue ready, and a halted venue can still take reduce-only orders. Orders on the other venues are not affected. Stop placing on that venue until then instead of retrying each order. |
| `temporarily_unavailable` | `market_data_not_carried` | Subscribe requests of [`/v1/market-data/ws`](/api/market-data-websocket#the-subscribe-answer) | This gateway carries no book of that market until it restarts: the venue listed it under a new market id, or it is a Hyperliquid market that did not trade when the gateway started. Orders on the market are not affected. Subscribe to it again after the next reconnect that follows a `1012` close, not in a loop. |
| `temporarily_unavailable` | `execution_lane_quarantined` | Items | Mosaiq suspended one of the venue accounts that send your orders on that venue while it checks the order state of that account. Orders that go through another venue account of Mosaiq can still pass. Retry with a growing backoff. |
| `rate_limited` | `congestion_share_exhausted` | Items and `orderUpdates` rows | Hyperliquid is congested for the venue account that sends your order, and your account used its share of that account's allowance. Only Hyperliquid places of orders that can rest are refused, and never a reduce-only one. Keep quoting on the other venues, and retry the place after a short delay. |
| `rate_limited` | `token_account_rate_limited` | Items | Your account used the request budget of its own Hyperliquid token sub-account. Only spot and outcome orders of the account are refused; perp orders are not affected. Slow down your spot and outcome orders and retry them after a short delay. |
| `rate_limited` | `withdraw_limit_exceeded` | Requests | The rolling withdrawal cap is reached (see [`withdraw`](/api/exchange#withdraw)). Do not retry the same amount at once: retry when the rolling window has room, or with a smaller amount. |
| `out_of_service` | `venue_contained` | Items | Mosaiq refuses your places, modifies, and cancels on the contained venue. This includes mass cancel targets. Mosaiq cancels your open orders there. Each order appears as `cancelled` on `orderUpdates` with `cancelCause` set to `venue_contained`. You can keep sending actions to other venues. Stop sending actions to the contained venue until the operator reopens it. |
| `trading_restricted` | `operations_halted` | Items and requests | Mosaiq halted one market, one asset on one venue, after repeated liquidation failures on it. Stop sending orders to that market. Immediate reduce-only placements and cancels still pass, except for an account in liquidation: every placement of that account on the halted market is refused with this detail, and its cancels pass. On a `withdraw` or a `transfer`, the account holds a position on a halted market. |
| `trading_restricted` | `token_account_unavailable` | Items | Your first spot or outcome buy needs a Hyperliquid sub-account for your account, and Mosaiq has none free. Only spot and outcome buys of the account are refused; perp orders are not affected. Stop sending token buys instead of retrying each one. |
| `trading_restricted` | `pooled_tokens_present` | Items | Your account still holds tokens on the pooled Mosaiq account, so Mosaiq does not give it a sub-account yet. Only spot and outcome buys of the account are refused; perp orders are not affected. Stop sending token buys instead of retrying each one. |
| `trading_restricted` | `token_trading_not_enabled` | Items | Mosaiq has not opened spot or outcome trading for your account, or closed it. Mosaiq opens each account on its own, so a sub-account of yours does not share the trading of its master. Only the buys of the closed market type are refused: sells of the tokens you hold, cancels and perp orders pass. Ask Mosaiq to open your account instead of retrying each buy. |
| `trading_restricted` | `outcome_trading_disabled` | Items | Outcome trading is off on Mosaiq. Every outcome order is refused; spot and perp orders are not affected. Stop sending outcome orders instead of retrying each one, until Mosaiq turns outcome trading on. |
| `trading_restricted` | `liquidation_in_progress` | Items | A liquidation of the account is under way. Every place and modify on every market is refused, reduce-only placements included, and cancels pass. Stop quoting on the account until [`userEvents`](/api/websocket#userevents) shows `liquidationFinished`. |
| `trading_restricted` | `inactive_market` | Items, and [lifecycle messages](/api/market-data-websocket#market-lifecycle) of `/v1/market-data/ws` | The market is not active on that venue: on a perp, the venue paused it, and positions on it stay open. Do not send orders to it until the [market catalog](/api/clearinghouse-state#market-lifecycle) shows it active, or a perp's `lifecycle.state` `trading`. On the market-data socket the coin stays subscribed, and its books resume by themselves. |
| `trading_restricted` | `market_reduce_only` | Items, and [lifecycle messages](/api/market-data-websocket#market-lifecycle) of `/v1/market-data/ws` | The venue takes only reduce-only orders on that perp market. On a Lighter market, an order without `reduceOnly` that reduces your position passes too (see [Reduce-only](/api/exchange#reduce-only)). Send reduce-only orders there until the [market catalog](/api/clearinghouse-state#market-lifecycle) shows its `lifecycle.state` `trading`. Its books go on. |
| `trading_restricted` | `market_settled` | Items, and the refused coins and [lifecycle messages](/api/market-data-websocket#market-lifecycle) of `/v1/market-data/ws` | The venue settled that perp market. Mosaiq closes your position there at the venue's settlement price, in a [`userFills`](/api/user-fills) row. Do not send orders to it. Wait for a new listing in the [market catalog](/api/clearinghouse-state#market-lifecycle): its `lifecycle.listing` grows and its `lifecycle.state` reads `trading`. On the market-data socket the coin leaves the subscription: subscribe to it again after the relist. |
| `trading_restricted` | `execution_risk_control_blocked` | Items | A venue safety control refuses new exposure on that venue. Reduce-only placements and cancels pass. A buy modify can lower size or price if it increases neither. A sell modify can lower size at the same price. Retry risk-increasing orders there with a growing backoff. |
| `trading_restricted` | `venue_reduce_only` | Items | An operator put the venue in `user_reduce_only`. Mosaiq refuses each place on that venue that can add exposure, spot and outcome orders included, and each perp modify that can. Reduce-only placements and cancels pass. A perp order without `reduceOnly` that reduces your position on that venue passes too, as a reduce-only order (see [Reduce-only](/api/exchange#reduce-only)). A buy modify can lower size or price if it increases neither. A sell modify can lower size at the same price. Mosaiq cancels your open orders without `reduceOnly` there. Each one appears as `cancelled` on `orderUpdates` with `cancelCause` set to `venue_reduce_only`. You can keep trading on other venues. Stop sending orders that add exposure to that venue until the operator reopens it. |

## Errors of every endpoint

| HTTP | `code` | `detail` | Meaning |
| --- | --- | --- | --- |
| `400` | `invalid_request` | `invalid_query` | A query parameter is missing or has the wrong type, or `user` is not an EVM address. |
| `404` | `invalid_request` | `not_found` | Unknown path. |
| `405` | `invalid_request` | `method_not_allowed` | Wrong method. |
| `500` | `internal_error` | `internal_error` | Unexpected failure. |

## Exchange errors

Every error carries the [error object](#error-object): `code`,
`detail`, `msg`, and `maybeSent`, `retryAfterMs` or `cap` when they apply.
Branch on `code`. [What to do](#what-to-do) says what to do for each. The tables
below give the `detail` values of each `code` on this endpoint and on the write
WebSocket. A `detail` names the cause for your logs and for support, and it can
change without notice, except the values that
[Details that are a contract](#details-that-are-a-contract)
lists.

Any error that ends a request or an item after one of its actions may have left
carries `maybeSent: true`, whatever its `code`. For example, a `mass_cancel`
that fails after some of its cancels launched answers its error with
`maybeSent: true`.

### Request-level errors

| `code` | `detail` | HTTP | Meaning |
| --- | --- | --- | --- |
| `temporarily_unavailable` | `funding_settlement_pending` | 409 | Funding settlement is pending for the account. Retry the withdrawal or transfer after settlement completes. |
| `temporarily_unavailable` | `venue_unavailable` | 503 | Every `place` or `modify` item of a REST request met the degraded Lighter transaction quota before its launch. Nothing was sent. |
| `temporarily_unavailable` | `risk_engine_stalled` | 503 | `withdraw` or `transfer` while the risk engine is stalled or [cancel-only](/api/exchange#cancel-only-mode); item-level on `place` and `modify`. |
| `temporarily_unavailable` | `startup_recovery_in_progress` | 503 | `withdraw` or `transfer` until [startup recovery](/api/exchange#startup-recovery) is complete on every venue; item-level on `place` and `modify` on a venue that has not recovered yet. Retryable. |
| `temporarily_unavailable` | `risk_core_unavailable`, `gateway_unavailable` | 503 | Mosaiq cannot process the request. These errors can also appear on individual items. |
| `rate_limited` | `withdraw_limit_exceeded` | 429 | The rolling withdrawal cap that all clients share is reached. A [contract detail](#details-that-are-a-contract). |
| `rate_limited` | `rate_limited` | 429 | HTTP or exchange budget exceeded. `retryAfterMs` gives the time until the budget admits a request again. |
| `rate_limited` | `inflight_limit_exceeded` | 429 | WebSocket only: the client IP already has 128 requests in flight across its connections. Resend once a response arrives. |
| `out_of_service` | `treasury_not_configured` | 503 | Deposits are unavailable; no receiving address is configured. |
| `out_of_service` | `gateway_out_of_service` | 503 | Mosaiq is out of service. The request was not sent, and every retry fails the same way until Mosaiq restores service. Also item-level. |
| `invalid_request` | `wallet_required` | 400 | The JWT holds several EVM wallets and `X-Tessera-Wallet` is missing. |
| `invalid_request` | `invalid_json`, `unsupported_media_type` | 400 / 415 | Body is not JSON. |
| `invalid_request` | `invalid_request` | 422 | Body parses but has unknown or ill-typed fields (including a `place` or `modify` carrying `fastCancel` on REST; on WebSocket the detail is `bad_request`), a decimal string that is not plain, or a USDC `amount` that breaks its rule (see [Fields](/api/exchange#fields)). |
| `invalid_request` | `bad_request` | 400 | Generic validation failure, including an empty batch, a `modify` batch that names one `c` twice, and malformed/unknown-field WebSocket frames (including a `place` or `modify` carrying `fastCancel`). |
| `invalid_request` | `invalid_cancel` | 400 | Empty cancel batch. |
| `invalid_request` | `batch_too_large` | 400 | More than 20 actions, or a request too large for Mosaiq to record durably. Nothing was sent; split the request before sending it again. |
| `invalid_request` | `unknown_venue` | 400 | Unknown venue code in `mass_cancel.venues`. |
| `invalid_request` | `invalid_transfer_id`, `same_account` | 400 | `transfer` input that breaks a rule. See [Transfer refusals](/api/exchange#transfer-refusals). |
| `limit_reached` | `insufficient_available_funds` | 403 | Withdrawal exceeds withdrawable funds, or another withdrawal is pending. |
| `temporarily_unavailable` | `broker_capacity` | 403 | Withdrawal exceeds withdrawable funds, and your token cash covers the difference. Mosaiq moves it back to your USDC balance; `retryAfterMs` says when to retry. See [token cash](/api/exchange#token-cash). |
| `limit_reached` | `insufficient_funds` | 403 | `transfer` above the `withdrawableUsdc` of `from`. |
| `trading_restricted` | `operations_halted` | 403 | `withdraw` or `transfer` while the account holds a position on a market that Mosaiq halted (one asset on one venue). A [contract detail](#details-that-are-a-contract). |
| `duplicate_id` | `transfer_id_reused` | 409 | `transfer` whose `transferId` names a transfer with other accounts or another amount. |
| `unauthorized` | `unauthorized` | 401 | Missing or invalid bearer token. |
| `unauthorized` | `wallet_auth_required` | 401 | `withdraw` or `transfer` sent with an API key. |
| `forbidden` | `master_account_required` | 403 | `deposit` sent with the API key of a sub-account. |
| `forbidden` | `not_whitelisted`, `not_registered` | 403 | Wallet not allowlisted, or no account yet. |
| `forbidden` | `wallet_required`, `wallet_not_connected` | 403 | The JWT holds no EVM wallet, or `X-Tessera-Wallet` names a wallet that the JWT does not hold. |
| `forbidden` | `account_not_owned` | 403 | `transfer` between accounts that are not all the owner's. |
| `request_uncertain` | `request_uncertain` | 503 | Mosaiq cannot confirm whether it accepted the request. It may still execute; check `orderUpdates` or `openOrders` before retrying. Always with `maybeSent: true`. Also item-level. |
| `internal_error` | `internal_error` | 500 | Unexpected failure; also item-level. With `maybeSent: true` when an action of the request may have left before the failure. |

### Item-level errors

Item-level errors (`data[]`) without `maybeSent` are refusals made before any
venue effect. An `orderUpdates` row can follow an item error with
`maybeSent: true`, or a launch that fails after the action became durable (see
[Response](/api/exchange#response)):

| `code` | `detail` | Meaning |
| --- | --- | --- |
| `temporarily_unavailable` | `gateway_unavailable` | Mosaiq could not accept this item, so it was not sent. Check the other batch results separately. |
| `temporarily_unavailable` | `market_metadata_missing` | The venue market lacks metadata needed to build the order, or Mosaiq has no fee rate for the market. The item was not sent. Retry later. |
| `temporarily_unavailable` | `margin_unavailable`, `oracle_unavailable` | Mosaiq cannot price margin for the market. |
| `temporarily_unavailable` | `spot_unavailable` | Mosaiq cannot take the spot order now: spot trading is closed, the spot market has no registration or fee rate, or Mosaiq could not read the funds of the order. The item was not sent, and perp orders are not affected. Retry later. |
| `temporarily_unavailable` | `venue_unavailable` | Mosaiq cannot send to the venue now. Venue state needed for admission is missing or stale, the venue connection is not ready, the venue queue is full, execution is disabled for the venue, or Lighter execution is degraded after quota exhaustion. Nothing was sent. |
| `temporarily_unavailable` | `omnibus_position_not_reducible` | Lighter keeps the market reduce-only, and the position of Mosaiq's account on that venue does not let your reduce-only place or modify reduce it: the position is flat, or short for a sell, or long for a buy. Lighter would not execute the order, so Mosaiq did not send it. Retry later. |
| `temporarily_unavailable` | `send_capacity` | Mosaiq's own send capacity for this venue is full, so Mosaiq did not send the item. The request quota of Mosaiq's Hyperliquid account is part of this capacity. The venue is not congested, and it is not your rate limit. Reduce-only places and modifies get this error too. This item error carries no `retryAfterMs`: retry after a short delay, and wait longer after each new refusal. A refusal after the launch shows on the [`orderUpdates`](/api/websocket#orderupdates) row instead, where `failure.retryAfterMs` gives the wait when Mosaiq knows it. Earlier Mosaiq versions answered `venue_busy` for this refusal. Now `venue_busy` means that the venue is congested, and it comes only on an [`orderUpdates`](/api/websocket#orderupdates) row, never as an item error. |
| `temporarily_unavailable` | `open_order_capacity` | The Hyperliquid account of Mosaiq that would rest this `Alo` holds as many open orders as Mosaiq allows it, which stays below the Hyperliquid limit per address. Nothing was sent. Reduce-only `Alo` orders get this error too. Orders that do not rest, such as `Ioc` and market orders, and placements that replace an order are not affected. Retry after a short delay. |
| `temporarily_unavailable` | `maintenance_in_progress` | A fresh venue-status source reports maintenance in progress. Place and modify are temporarily refused, including on HIP-3 venues and Lighter Robinhood. Cancels are not refused for maintenance. When the window that the [maintenance topic](/api/exchange-websocket#venue-trading-stops) shows in progress for the venue has an end, `retryAfterMs` is the time left until that end. The refusal can last up to 15 seconds after it. It ends earlier when Mosaiq reaches the venue again. Orders on the other venues are not refused, also for an account that holds positions on the venue in maintenance. A withdrawal, a transfer out or a move from pooled cash to token cash of an account that holds a position on the venue gets this detail too, whatever the age of the venue's prices: nothing moved, and the account can cash out once each market of the venue has a new price. Another account gets it when its margin reads a market of the venue that has no fresh price. A withdrawal or a transfer answers HTTP 409 with no `retryAfterMs`. A token buy that needs pooled cash gets the detail on its item, inside an HTTP 200. A move from token cash back to pooled cash is not refused. See [maintenance announcements](/api/exchange-websocket#maintenance-announcements) for timing and source coverage. |
| `temporarily_unavailable` | `cash_out_venue_down` | A withdrawal, a transfer out or a move from pooled cash to token cash reads the price of a market of a venue that is down for a cause other than an announced maintenance, as a recovery. These cash-outs value your account at fresh prices only, and that market has none, so nothing moved. A withdrawal or a transfer answers HTTP 409, and a token buy gets the detail on its item, inside an HTTP 200. Retry once the venue is back. Orders and account reads are not affected: `clearinghouseState` values the positions of a down venue at their last price, with `withdrawableUsdc` at `null`. |
| `temporarily_unavailable` | `maintenance_awaiting_prices` | The maintenance of the venue ended, and a market of the venue has no new price yet. Place and modify on the venue are refused until each of its markets has a price that Mosaiq received after the maintenance. Cancels are not refused. The item was not sent. Retry after a short delay. A withdrawal, a transfer out or a move from pooled cash to token cash of an account that holds a position on the venue gets this detail too, and so does another account whose margin reads a market of the venue that has no fresh price: nothing moved. A withdrawal or a transfer answers HTTP 409, and a token buy gets the detail on its item, inside an HTTP 200. |
| `temporarily_unavailable` | `pre_venue_resource_timeout` | Mosaiq could not prepare the action for submission within 2 seconds. Nothing was sent. Retry after a short delay. |
| `temporarily_unavailable` | `broker_capacity` | The placement carries `priorityFeeBps`, and the Mosaiq HYPE stake on Hyperliquid cannot pay that fee. Nothing was sent. `msg` is `priority fee capacity on hyperliquid is temporarily unavailable; retry shortly, or send the order without priorityFeeBps`. A token buy that your token cash cannot pay, while your withdrawable USDC covers the difference, also gets this detail: nothing was sent, and Mosaiq moves your own USDC to your token cash, as [token cash](/api/exchange#token-cash) describes. So does a perp order that your margin cannot cover, while your token cash covers the difference: Mosaiq moves your token cash back to your USDC balance. A venue refusal for Mosaiq's pooled margin is not an item error. It shows on `orderUpdates` as `failure.detail` `broker_capacity`, possibly with `failure.retryAfterMs`. So does a spot buy that the Mosaiq spot balance on the venue cannot pay. See [Rebalancing](/concepts/rebalancing). |
| `temporarily_unavailable` | `venue_recovering` | The venue of the item is recovering, or halted after a failure. A [contract detail](#details-that-are-a-contract). |
| `temporarily_unavailable` | `startup_recovery_in_progress` | Mosaiq has not finished [startup recovery](/api/exchange#startup-recovery) on the venue of the item. Every `place` and `modify` on that venue is refused, reduce-only placements included. The item was not sent. Retry after a short delay. |
| `temporarily_unavailable` | `risk_engine_stalled`, `risk_core_unavailable` | The risk engine cannot admit the item; retry later. In [cancel-only mode](/api/exchange#cancel-only-mode), every `place` and `modify` gets the detail `risk_engine_stalled`. |
| `temporarily_unavailable` | `execution_lane_quarantined` | Trading on that venue account is suspended while Mosaiq checks its order state. A [contract detail](#details-that-are-a-contract). |
| `temporarily_unavailable` | `venue_cloid_keys_unavailable` | Mosaiq cannot seal the venue cloid of this place with your account's key. Nothing was sent. Retry the item. See [Find your orders in venue data](/api/exchange#find-your-orders-in-venue-data). |
| `temporarily_unavailable` | `account_operation_in_progress` | You connected with `cancelAllOnDisconnect=true`, and Mosaiq moves USDC on the Hyperliquid account that carries the item. Mosaiq refuses your places and modifies on that account until the move is done, reduce-only included. `retryAfterMs` and `msg` give the longest the pause can still last, in milliseconds. Retry after a short delay. Cancels, Lighter, and the other Hyperliquid account are not affected. See [Account operations](/api/optimizing-latency#account-operations). |
| `rate_limited` | `congestion_share_exhausted` | Hyperliquid is congested for the venue account that sends your order, and your account used its share of that account's allowance. Each account's share follows its Hyperliquid maker volume of the previous UTC day on that venue account, and what one account leaves goes to the others. This place was not sent. `retryAfterMs` gives the wait before a retry, and `msg` ends with it, as `retry in <ms> ms`. Only places of orders that can rest on the book count toward the share. Cancels, `Ioc` and market orders, and modifies, `replaces` included, neither count nor are refused this way. Reduce-only orders count but are never refused. A place that its cancel held can get this error after it became durable. Its order then shows one `failed` row on `orderUpdates` with `failure.code` `rate_limited`, the detail `congestion_share_exhausted`, and the same wait in `failure.retryAfterMs`. A [contract detail](#details-that-are-a-contract). |
| `out_of_service` | `gateway_out_of_service` | Mosaiq could not accept this item, so it was not sent, and it accepts no item until Mosaiq restores service. Check the other batch results separately. |
| `out_of_service` | `venue_contained` | The operator contained the venue of this item. A [contract detail](#details-that-are-a-contract). |
| `invalid_request` | `unknown_asset`, `unknown_venue`, `symbol_mapping_missing` | The market does not exist on that venue. |
| `invalid_request` | `unsupported` | Ambiguous placement: `slippage` with `p`/`t`, `p` or `t` alone, or none of them. Also `expiresInMs` sent on a placement other than `lighter` or `lighter:robinhood` `Alo`, `priorityFeeBps` when priority fees are off or the limit of your account is 0 bp, on a Lighter order, on a spot `Alo` order, on an outcome order, on a `Gtc` order, or on a reduce-only `Alo` order. Also `replaces` on Lighter, on a spot market, or with `priorityFeeBps`, and `expiresAfter` on Lighter or on a spot market. A modify of a spot or outcome order gets it too, with the `msg` `modify is not supported on spot and outcome markets; cancel and place a new order`. |
| `invalid_request` | `unsupported_tif` | `t` is not `Ioc` or `Alo`. |
| `invalid_request` | `unsupported_order_type` | Modify targets a market order. |
| `invalid_request` | `invalid_slippage` | `slippage` outside `(0, 0.5]`. |
| `invalid_request` | `invalid_expiry` | `expiresInMs` outside `610000`–`2592000000`, or `expiresAfter` more than 24 hours ahead. |
| `invalid_request` | `deadline_unreachable` | `expiresAfter` has passed, or leaves less than the minimum for the order type when Mosaiq prepares the item, or, for a modify, when Mosaiq finds the order or once the venue confirmed it. The minimum is 150 ms for `Alo` and 450 ms for `Ioc` and market orders. A modify takes the minimum of the order it modifies. The item was not sent. The same item cannot succeed later: send a later deadline. |
| `invalid_request` | `invalid_priority_fee` | `priorityFeeBps` is not above 0, is finer than 0.0001 bp, or is above the limit of your account (8 bp unless Mosaiq raised it, at most 20 bp). `msg` names the limit. |
| `invalid_request` | `invalid_cloid` | `c` is not lowercase non-zero 128-bit hex. |
| `invalid_request` | `bad_request`, `invalid_price`, `invalid_precision`, `min_notional` | Size or price failed fitting or limits. `invalid_price` also covers a limit price outside the venue price band around the oracle price. `bad_request` also covers a Lighter modify whose new size is below the quantity already filled, including a fill that landed while the modify was being admitted, and a placement whose `replaces` names an order it cannot replace. A Hyperliquid perp modify is not refused for the minimum value: Hyperliquid cancels the order and refuses the new one (see [Modify](/api/exchange#modify)). |
| `limit_reached` | `cap_exceeded` | Exceeds a `userCaps` limit or available margin. `cap` names the `userCaps` limit, such as `max_initial_margin_usage_rate` or `max_open_orders`. It is absent when the margin of the account, the priority fee of a reduce-only order, or a spot balance refused the order. See [The limit in `cap`](#the-limit-in-cap). An outcome buy whose room under a payout cap is below the minimum notional of the market gets it too, and `msg` names the cap: `max_outcome_owner_payout`, also in `cap`, or `max_outcome_payout`, without `cap`. See [outcome markets](/api/exchange#outcome-markets). |
| `limit_reached` | `reduce_only` | No reducible position, or the reducible position changed while a reduce-only modify was being admitted. Also `reduceOnly` on a spot or outcome market. |
| `trading_restricted` | `inactive_market` | The market is inactive on that venue. A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `market_reduce_only` | The venue takes only reduce-only orders on that perp market, and the order does not reduce your position there. A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `market_settled` | The venue settled that perp market. A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `execution_risk_control_blocked` | A venue safety control blocks risk-increasing execution on that venue. It also refuses the places and modifies of one account on one venue after that venue stopped knowing one of the account's orders, even after a recovery. A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `venue_reduce_only` | An operator put the venue of this item in `user_reduce_only`, and the item can add exposure. Nothing was sent. A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `operations_halted` | Trading is halted on this market (one asset on one venue). A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `liquidation_in_progress` | A liquidation of the account is under way. See [Liquidation](/concepts/liquidation). A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `token_account_unavailable` | Your first token buy needs a Hyperliquid sub-account for your account, and Mosaiq has none free. Nothing was sent or reserved. A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `pooled_tokens_present` | Your account still holds tokens from the pooled Mosaiq account, so Mosaiq does not give it a sub-account yet. Nothing was sent or reserved. A [contract detail](#details-that-are-a-contract). |
| `trading_restricted` | `token_trading_not_enabled` | Mosaiq has not opened spot or outcome trading for your account, so it takes no buy of that market type. Nothing was sent or reserved, and your account got no sub-account. A [contract detail](#details-that-are-a-contract). |
| `limit_reached` | `token_account_required` | A spot or outcome sell of an account that has no Hyperliquid sub-account yet: it holds no tokens to sell there. Nothing was sent. Your first token buy gets you one, once Mosaiq opened token trading for your account. |
| `temporarily_unavailable` | `token_account_not_reconciled` | Your Hyperliquid sub-account is not reconciled yet: it was just given to your account, or Mosaiq reconnected to Hyperliquid. Nothing was sent. Retry in a few seconds; perp orders are not affected. |
| `temporarily_unavailable` | `execution_price_unavailable` | An outcome market order found no reference price: the side that it takes is empty, Hyperliquid's book could not be read, or Mosaiq used its book reads for the minute. Nothing was sent. Retry, or send an `Ioc` limit order. |
| `invalid_request` | `market_expired` | The outcome market of the order stopped trading at its expiry before Mosaiq received or admitted the order. Nothing was sent. |
| `trading_restricted` | `outcome_trading_disabled` | Outcome trading is off on Mosaiq. Nothing was sent. A [contract detail](#details-that-are-a-contract). |
| `temporarily_unavailable` | `token_account_closed` | A fault keeps your Hyperliquid sub-account closed to new outcome orders until Mosaiq reconciles it. Nothing was sent, cancels still go through, and perp orders are not affected. A fault of the outcome lane alone leaves spot orders open. A fault of the account part closes both lanes, so your spot orders get `temporarily_unavailable` with the detail `spot_unavailable` at the same time. |
| `rate_limited` | `token_account_rate_limited` | Your Hyperliquid sub-account is out of venue requests. Nothing was sent; cancels still go through. Mosaiq reads its request budget again on your next order at least 10 seconds later. No `retryAfterMs`. A [contract detail](#details-that-are-a-contract). |
| `order_not_found` | `order_not_found_for_cancel` | `c` does not match a live order (cancel and modify). A modify also gets this error when its target filled or was cancelled while the modify was being admitted. When the venue sees first that the order ended, the modify answers `accepted`, and its `orderUpdates` row shows the same `failure.code` and `failure.detail`, with `maybeSent: true`. A placement gets it when its `replaces` matches none of your orders on that venue. |
| `blocked_by_other_action` | `in_flight_admission_conflict` | Another action on this order, such as its place or another cancel, is still being accepted. This cancel was not sent. Wait until `orderUpdates` shows the outcome of that action, then retry the cancel. |
| `blocked_by_other_action` | `modify_in_flight` | An earlier modify on this order remains unresolved after the two-second confirmation wait. This item was not sent. Wait for the earlier outcome on `orderUpdates` before retrying. A placement gets it when a modify of the order it `replaces` is unresolved. |
| `blocked_by_other_action` | `reduce_only_transition_in_flight` | Another reduce-only order of yours on this market, venue and side is still being replaced, and this order would exceed your position until that replacement ends. This item was not sent. Wait until `orderUpdates` shows the outcome of that replacement, then retry. |
| `blocked_by_other_action` | `modify_placement_not_confirmed` | On Lighter, the venue has not confirmed the placement. On Hyperliquid, the placement failed or its outcome is uncertain. This modify was not sent. Check `orderUpdates` before retrying it. A placement gets it when the venue has not confirmed the order it `replaces`, or when that order may still be on the book while not open. |
| `duplicate_id` | `duplicate_cloid` | Open order with this `c`, or `c` repeated in the batch. |
| `request_uncertain` | `request_uncertain` | Mosaiq cannot confirm whether it accepted the action. It may still execute, so an `orderUpdates` row can follow; check `orderUpdates` or `openOrders` before retrying. Always with `maybeSent: true`. |
| `internal_error` | `internal_error` | Unexpected failure. With `maybeSent: true` when the item may have launched before it, for example a cancel that joined another cancel of its order whose launch ended without a verdict. |

These old item codes no longer appear, in `code` or in `detail`, because they
described venue outcomes:
`place_rejected`, `place_failed`, `place_uncertain`, `modify_rejected`,
`modify_failed`, `modify_uncertain`, `cancel_rejected`, `cancel_failed`,
`cancel_uncertain`, `cancel_not_on_book`, `cancel_target_filled`,
`cancel_target_rejected`, `cancel_timeout`, and `preemptive_cancel`. Read the
outcome on `orderUpdates` instead. The `cancelled` item status is gone too.
