# Error responses

Order and cancel errors are usually returned as a vector with same length as the batched request.

Below is a list of possible batched error responses:

| Error source | Error type                        | Error string                                                                       |
| ------------ | --------------------------------- | ---------------------------------------------------------------------------------- |
| Order        | Tick                              | Price must be divisible by tick size.                                              |
| Order        | MinTradeNtl                       | Order must have minimum value of $10.                                              |
| Order        | MinTradeSpotNtl                   | Order must have minimum value of 10 {quote\_token}.                                |
| Order        | PerpMargin                        | Insufficient margin to place order.                                                |
| Order        | ReduceOnly                        | Reduce only order would increase position.                                         |
| Order        | BadAloPx                          | Post only order would have immediately matched, bbo was {bbo}.                     |
| Order        | IocCancel                         | Order could not immediately match against any resting orders.                      |
| Order        | BadTriggerPx                      | Invalid TP/SL price.                                                               |
| Order        | MarketOrderNoLiquidity            | No liquidity available for market order.                                           |
| Order        | PositionIncreaseAtOpenInterestCap | Order would increase open interest while open interest is capped                   |
| Order        | PositionFlipAtOpenInterestCap     | Order would increase open interest while open interest is capped                   |
| Order        | TooAggressiveAtOpenInterestCap    | Order rejected due to price more aggressive than oracle while at open interest cap |
| Order        | OpenInterestIncrease              | Order would increase open interest too quickly                                     |
| Order        | InsufficientSpotBalance           | (Spot-only) Order has insufficient spot balance to trade                           |
| Order        | Oracle                            | Order price too far from oracle                                                    |
| Order        | PerpMaxPosition                   | Order would cause position to exceed margin tier limit at current leverage         |
| Cancel       | MissingOrder                      | Order was never placed, already canceled, or filled.                               |

Important: Some errors are a deterministic function of the payload itself, and these are instead returned earlier as part of pre-validation. In this case only one error is returned for the entire payload, as some of these errors do not apply to a specific order or cancel.

Examples include: empty batch of orders, non-reduce-only TP/SL orders, order too far from reference price, and some forms of tick size validation.&#x20;

For API users that use batching, it's recommended to handle the case where a single error is returned for a batch of multiple orders. In this case, the response could be duplicated `n`times before being sent to the callback function, as the whole batch was rejected for this same reason.

For API users that use historical orders, a list of all the cancel / reject historical order statuses can be found [here](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/error-responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
