> For the complete documentation index, see [llms.txt](https://lumagg.gitbook.io/lumagg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lumagg.gitbook.io/lumagg/on-chain-products/order-escrow-errors.md).

# Order Escrow Errors

The testnet Order Escrow contract exposes stable Soroban contract error codes for validation failures. Clients should treat the numeric code as stable and use the message only for display or logging.

Typical output is `Error(Contract, #<code>)`.

| Code | Name                     | Meaning                                            |
| ---: | ------------------------ | -------------------------------------------------- |
|    1 | `NotInitialized`         | The contract has not been initialized.             |
|    2 | `AlreadyInitialized`     | Initialization was already completed.              |
|    3 | `InvalidAmount`          | The input amount is zero or negative.              |
|    4 | `InvalidLimit`           | The limit price is zero or negative.               |
|    5 | `SameToken`              | Input and output tokens are identical.             |
|    6 | `ExpirationInPast`       | The expiration is not after the required start.    |
|    7 | `ExpirationTooFar`       | The expiration exceeds the maximum lifetime.       |
|    8 | `OrderNotFound`          | The requested order does not exist.                |
|    9 | `OrderNotOpen`           | The order is not open for the requested operation. |
|   10 | `OrderExpired`           | The order has already expired.                     |
|   11 | `OrderNotExpired`        | The order cannot yet be reclaimed.                 |
|   12 | `AmountExceedsRemaining` | The fill exceeds the remaining amount.             |
|   13 | `InvalidRouteAmount`     | Route amounts do not equal the requested input.    |
|   14 | `MinimumOutBelowLimit`   | The execution minimum is below the order limit.    |
|   15 | `InvalidChunk`           | The DCA chunk is zero or too large.                |
|   16 | `InvalidInterval`        | The DCA interval is zero.                          |
|   17 | `StartLedgerInPast`      | The DCA start ledger is earlier than current.      |
|   18 | `InvalidMinimumRate`     | The DCA minimum output rate is negative.           |
|   19 | `ChunkNotDue`            | The next DCA chunk is not due yet.                 |
|   20 | `ArithmeticOverflow`     | A checked arithmetic operation overflowed.         |

## Current Testnet Deployment

```
CCI3U3P7MPZNCA5L7KWTXNS7H7KV6AIZQ6ZY2FEOZPHTJIAVCRYPKXTM
```

An invalid DCA request with a past `start_ledger` returns `Error(Contract, #17)` (`StartLedgerInPast`) instead of a generic trap. This change applies to testnet only; the mainnet Aggregator was not upgraded.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://lumagg.gitbook.io/lumagg/on-chain-products/order-escrow-errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
