> 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/adaptive-pools/core-features/validation-and-examples.md).

# Integration Checklist

Checks for Arc swaps, liquidity and claims, with executable fee examples.

Use this checklist before enabling an Arc integration. Validate the actual target deployment and transaction flow against the matching contract version.

### SDK transaction acceptance

Use `@masterpeach/market-sdk@1.0.1`, public root imports and the reviewed deployment preset. Keep the following checks when shortening examples:

Explicit `prepare: true` for funds operations, plus separate `verifyDeployment()`; neither installing the package nor a successful read enables a capability. Correct chain, wallet owner, token decimals, complete PoolKey and spender. Amounts are bigint base units; shares/liquidity are not token units. Exact, bounded allowances to the intended Hook/Router/Permit2; confirm each approval and obtain a fresh quote afterward. User-reviewed maximum spend, minimum output/shares, recipient, fee cap and chain-time deadline. Never use unlimited approval or zero protection as a shortcut. Same-client prepare → explicit user-confirmed send → saved hash → `result.status === "confirmed"`. Check actual receipt results and recover pending/ambiguous transactions before retrying. Native funds cover both value and gas; Quoter gas is not full-transaction gas. Paused principal-only withdrawal is distinct from blocked claims and combined withdrawal/claim.

Current mainnet presets keep `claimOperator: "unverified"` and management disabled. Delegated claims, Compound and fee-inclusive Rebalance need separately accepted claim capability and independent range authorization; do not promote flags or disable preflight to make an example run.

Examples in [Quickstart](https://docs.peach.ag/documentation/arc/adaptive-pools/quickstart), [Providing Liquidity](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/providing-liquidity), [Fees & Claims](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/fees-and-claims) and [RWA Calendar](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/rwa-calendar-and-fee-curve) are checked against `main@b5fc5ba`. Typechecking proves API usage, not funded execution or deployment acceptance.

### Trading acceptance

* Verify chain, Hook, PoolManager, configuration, initialized state and any router or Quoter deployment.
* Cover both directions, ordinary keeper/cap boundaries, RWA sessions and exact time boundaries, and Mid-block reference transitions.
* Isolate route branches and roll back reverted state; preserve integer rounding, zero outputs and partial-fill outcomes.
* Simulate actual router calldata, settlement, amount bounds and deadlines. Accept exact-output separately if offered.

### Liquidity and claim acceptance

* Test deposits and partial/full withdrawals in range, below range and above range; confirm actual principal, shares and receipts.
* Check spender-specific approvals, amount maxima/minima, deadline equality and expiry, recipient validation and insufficient balances.
* Verify that withdraw leaves earnings unclaimed, withdrawAndClaim pays them, and a full exit can leave claimable owed fees.
* Test the effective protocol-share cap, historical configuration changes, original-currency payouts and whole-unit/Q128 rounding.
* Separate share approval from range claim delegation; test unauthorized claims, operator-chosen recipients and explicit revocation after exit/redeposit.
* Test global and pool pause behavior against the exact deployment. The current SDK baseline allows principal-only withdrawal while paused; claims and combined withdrawal/claim remain pause-sensitive. The older `314ed215` reference blocks principal withdrawal too; do not substitute one version's operation matrix for another.
* For batch claims, test grouping by chain/Hook, 1–100 items, validated empty entries and atomic rollback on one failing item.

### Gas and activation boundaries

Gas must be measured for the destination router, settlement and tick path. The helper’s separate on-chain call allowance is 200,000 gas; it is not a full-route gas guarantee.

Before enabling production routing, verify all supported addresses/managers, both directions, ordinary/keeper boundaries, RWA calendar boundaries, Mid-block reference transitions, clone/rollback behavior, exact rounding and partial-fill outcomes. Verify the destination router's actual calldata and settlement in an execution simulation. Exact-output, if offered, needs separate amount and settlement acceptance. Activating chain discovery, refresh schedules and public API routing is aggregator-side work, not an automatic result of accepting a document.

Peach's LP fee-claim policy affects the distribution of collected LP income; it is not an extra per-swap fee to add to these formulas. PoolManager protocol fees are another independent mechanism. The supported snapshots use zero protocol fee; this scope does not introduce protocol-fee compatibility logic. These are historical reference snapshots; nonzero PoolManager protocol fees require separate implementation and acceptance.

### Executable fee example

This Python 3 snippet is self-contained and uses arbitrary-precision integers. Inputs must already be valid configurations. It computes the fee rate only; use the v4 AMM engine to calculate token amounts.

```python
E6 = 1_000_000

def ordinary_fee(raw, pool_floor, pool_cap, keeper_fee=0, expiry=0, timestamp=0):
    fee = min(raw, pool_cap)
    if timestamp < expiry and keeper_fee != 0:
        fee = min(max(keeper_fee, max(fee // 2, pool_floor)), pool_cap)
    return fee

def midblock_extra(opening, current, zero_for_one, threshold, fraction, cap):
    # Python arbitrary-precision integers preserve the full uint160 square.
    if opening == 0 or current == opening or fraction == 0 or cap == 0:
        return 0
    if (current > opening) != zero_for_one:
        return 0
    deviation = abs(current * current - opening * opening) * E6 // (opening * opening)
    return min(deviation * fraction // E6, cap) if deviation >= threshold else 0

ordinary = ordinary_fee(900, 100, 6000, keeper_fee=300, expiry=101, timestamp=100)
extra = midblock_extra(10000, 10100, True, 1000, 500000, 15000)
assert (ordinary, extra, min(ordinary + extra, 6000)) == (450, 10050, 6000)
assert ordinary_fee(900, 100, 6000, 300, 101, 101) == 900  # expired at equality
assert ordinary_fee(3_000_000, 100, 6000, 100, 101, 100) == 3000
```

Historical Arc block: 27252638. Historical RPC reproduction requires an archive-capable node. A current eth\_call or a snapshot first resolved from latest is a different test context.


---

# 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/adaptive-pools/core-features/validation-and-examples.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.
