> For the complete documentation index, see [llms.txt](https://docs.peach.ag/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.peach.ag/documentation/arc/aggregator/core-features/validation-approvals-and-expiry.md).

# Transaction Safety

A quote, an allowance, a signature and a transaction receipt establish different facts. A safe integration checks each stage before moving to the next.

### Validation layers

| Layer            | Checks                                                                                                                   | Does not establish                                             |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| `ApiClient`      | HTTP status, application envelope and response shape                                                                     | Complete executable-plan validity                              |
| `ArcClient`      | Configured router, roles, tokens, amounts, fee arithmetic, deadlines, hashes, signature consistency and decoded calldata | Current balance/allowance or future chain state                |
| `eth_call`       | Whether the transaction executes against the simulated state                                                             | That it will succeed after the market changes                  |
| Execution Router | Authorized signer, plan and route bindings, nonces, roles and actual settlement                                          | A successful wallet UI or pending hash is not its final result |
| Receipt check    | Whether the mined transaction succeeded                                                                                  | A mined reverted transaction is not a completed swap           |

The SDK recovers the aggregator signature against the signer identified by the response; the contract enforces which signers are authorized. Do not treat signature consistency alone as a complete on-chain authorization check.

### Confirm and reuse the result

The Direct `swap()` response contains both the quote and transaction. Show its net expected output and signed minimum before confirmation, then authorize and submit that same result. For delegated swaps, show the prepared quote and `raw.amount_out_min` before the payer signs; build must retain the prepared terms.

Bind confirmation to the complete order and result, including tokens, input amount, accounts, recipient, routing, network, fees and slippage. A changed or expired result requires a new confirmation. See [Slippage](https://docs.peach.ag/documentation/arc/aggregator/core-features/slippage).

### Preserve the prepared result

Retain the full prepared object, including `constraints` and `raw`. Approval, signing and build methods validate detached snapshots so an asynchronous wallet operation cannot silently change the terms being signed. Changing fields manually invalidates these protections.

Direct results and completed delegated builds contain decoded execution data. Delegated prepare contains a quote summary and authorization without the full route; its pre-signing trust boundary is explained in [Delegated Swaps](https://docs.peach.ag/documentation/arc/aggregator/core-features/delegated-execution-with-permit2-witness).

### Inspect transaction data

`SwapTxRequest` uses `bigint` for `value`, optional `gas` and optional `gasPrice`. A ready execution transaction also includes `entrypoint: "executePlan"` and `amountOutMin: bigint`.

`execution.plan` contains version/signerVersion, chainId/router, payer/executor/recipient, tokenIn/tokenOut, funding/native modes, amountIn/minAmountOut/expectedAmountOut, quoteId, routeHash, settlementPolicyHash, customFeeBps/customFeeReceiver, deadline and nonce. `execution` also carries router parameters, logical pool IDs, amount modes and signatures. Treat these fields as inspection results; editing them cannot create a newly authorized plan.

### Spender checks

| Flow                 | Approve the input ERC-20 to                                    |
| -------------------- | -------------------------------------------------------------- |
| Aggregator Direct    | `prepared.approvalSpender`, the configured Execution Router    |
| Aggregator Delegated | Canonical Permit2 `0x000000000022D473030F116dDEE9F6B43aC78BA3` |

Do not approve the MemeHook or use a graduation dependency's Permit2 address for an aggregator swap. Check allowance against the accepted result's input amount and validated spender. Arc supports fixed-input swaps.

### Time units and expiry

| Value                                        | Unit                                                 |
| -------------------------------------------- | ---------------------------------------------------- |
| `quote_ts`                                   | Unix milliseconds                                    |
| `deadlineSecs` / `deadline_secs`             | Relative seconds requested when preparing            |
| Decoded `plan.deadline` and Witness deadline | Absolute Unix seconds                                |
| API `timeout`                                | Milliseconds for fetch and reading the response body |

The SDK defaults to 120-second deadlines and a 10,000 ms HTTP timeout. The server can impose stricter limits, especially on delegated artifacts. Relative deadlines are bounded against response-arrival time and must still be live when revalidated.

Check the deadline after any token approval. Direct expiry requires a new `swap()` result and confirmation; delegated expiry requires a new prepare, confirmation and payer signature. Extending an old JSON field does not extend signed authorization.

### Retry boundaries

Requests for an unsigned transaction result may be refreshed with bounded backoff; replacement terms need new acceptance. Cancel stale UI requests. Prepare again after expiry or changed terms. Build retries remain constrained by the same artifact and server attempt limits.

Do not automatically resend a transaction when a wallet or RPC call times out after submission. First inspect the transaction hash, receipt and executor nonce. A fresh quote must not become a second trade while the first transaction is still pending.


---

# 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://docs.peach.ag/documentation/arc/aggregator/core-features/validation-approvals-and-expiry.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.
