> 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/fees-and-claims.md).

# Fees & Claims

Net earnings, protocol share, claims and delegated permissions.

Trading fees earned by a range are distributed through a net LP ledger. Claims pay earnings in the pool’s original currencies; they do not exchange assets or mint a reward token.

### From gross fees to net earnings

The Hook collects gross trading fees, deducts the effective protocol share, and distributes the remainder through net per-share accumulators. Owner checkpoints and Q128 remainders preserve each holder’s entitlement.

The protocol share applies to fee income, not deposited or withdrawn principal. Direct deposits and withdrawals have no percentage fee on principal. See [Fees](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/fees-and-keeper-policy) for trading fees.

The configurable protocol share is at most **2000 bps (20%)**; that ceiling is not the current rate. On-chain `claimFeeBps(poolId)` is the current configured rate, while `effectiveClaimFee(rangeId)` incorporates synchronization history. Do not apply today’s rate retroactively to all earnings.

For example, 100 gross fee units, a 5% protocol share and constant 10% ownership yield 9.5 units before rounding.

### Read and prepare a claim with the SDK

Use the Market client created with **`prepare: true`** in [Quickstart](https://docs.peach.ag/documentation/arc/adaptive-pools/quickstart). The example estimates earnings and prepares a self-claim for review, using the caller’s intended recipient and accepted `maxFeeBps`. It does not broadcast.

```typescript
import {
  getMarketPoolId,
  getMarketRangeId,
  type MarketClient,
  type MarketClaimParams,
} from "@masterpeach/market-sdk";
import type { Address } from "viem";

export async function prepareOwnFeeClaim(
  client: MarketClient,
  input: MarketClaimParams & { readonly owner: Address },
) {
  const { owner, ...params } = input;
  const rangeId = getMarketRangeId(
    getMarketPoolId(params.key),
    params.tickLower,
    params.tickUpper,
    params.key.tickSpacing,
  );
  const earnings = await client.estimateClaimableFees({
    hook: params.key.hooks, rangeId, owner,
  });
  if (earnings.data.paused) throw new Error("Fee claims are paused");
  if (!earnings.data.hasClaimableAmount) return { earnings, prepared: null };
  const prepared = await client.prepareClaim(params);
  if (!prepared.context.preflight) throw new Error("Use prepare: true");
  if (prepared.request.account.toLowerCase() !== owner.toLowerCase())
    throw new Error("Wallet owner changed; refresh and prepare again");
  return { earnings, prepared };
}
```

`earnings.data.token0` and `token1` use their respective token’s base units:

| Field           | Meaning                                                                 |
| --------------- | ----------------------------------------------------------------------- |
| `settled`       | Net fees already included in the owner’s owed balance                   |
| `synchronized`  | Net fees accumulated by the Hook but not checkpointed to this owner     |
| `pending`       | Additional whole base units estimated from uncollected PoolManager fees |
| `claimable`     | `settled + synchronized + pending`                                      |
| `remainderX128` | Fractional carry; do not add it as an integer token amount              |

`getPosition().data.settledOwed0/1` is only the settled portion. Do not combine gross growth with net checkpoints; the SDK uses one fixed-block snapshot and rejects invalid or settling reads. Estimates remain available while paused and may change before execution. Retain zero-share positions with historical owed fees; fractional carry survives claims, transfers and full exits.

### Claim flows and fee limits

| SDK method                                                                 | Purpose                                                                                     |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `prepareClaim({ key, tickLower, tickUpper, to, maxFeeBps })`               | Connected signer claims their own fees                                                      |
| `prepareClaimFeesBatch({ items, to })`                                     | Connected signer claims 1–100 items on the same chain and Hook, to one recipient            |
| `prepareClaimFeesFor({ key, tickLower, tickUpper, owner, to, maxFeeBps })` | Separate delegated-claim path requiring range claim authorization and deployment acceptance |
| `prepareWithdrawAndClaim(preview, to, maxFeeBps)`                          | Withdraws principal and claims fees together                                                |

Each batch item has `{ key, tickLower, tickUpper, maxFeeBps }`. Group by `(chainId, hookAddress.toLowerCase())`; the SDK does not split batches or support delegated batch claims. An error reverts the whole transaction. Empty payouts may be skipped after validation.

`maxFeeBps` caps the effective protocol share: an integer **0–2000**, denominator 10,000, independent of swap-fee pips or price slippage. Exceeding the user’s cap reverts; do not silently raise it. Claims have no on-chain deadline; optional `validForSeconds` only limits local submission with preflight enabled.

### Ownership, pauses and confirmation

Share and claim permissions are independent: `getShareAuthorization` reports both; `getClaimOperator` reads range claim authorization. Share approval does not grant fee collection. A claim operator can choose the recipient and fee cap. Its permission survives transfers, exits and redeposits until explicitly revoked with `prepareSetClaimOperator({ key, tickLower, tickUpper, operator, approved: false })`. Transfers checkpoint both parties, so previously earned fees remain with the original owner.

The built-in mainnet presets have `claimOperator: "unverified"`. With `prepare: true`, delegated-claim preparation is rejected until that deployment capability is separately reviewed. Do not turn off preflight or automatically promote the capability. Ordinary self-claims do not require claim-operator acceptance.

Global or pool pauses block claims and combined withdrawal/claim. **Principal-only withdrawal remains available** and does not pay earnings. See [Providing Liquidity](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/providing-liquidity) for the separate exit flow.

After user confirmation, use Quickstart’s same-client send-and-receipt helper; require `result.status === "confirmed"`. A successful claim can have no payout events; reconcile matching Hook, owner, range and recipient events, then refresh earnings and balances. Keep the transaction hash on timeout and check its result before retrying.

Source: [SDK earnings and permissions](https://git.techpilots.org/web/peach/peach-ts-sdk/-/blob/b5fc5bacdbee2364128044a4afe793682fa323f4/packages/market/docs/earnings.md), [claim preparation and receipts](https://git.techpilots.org/web/peach/peach-ts-sdk/-/blob/b5fc5bacdbee2364128044a4afe793682fa323f4/packages/market/src/actions/write/transactions.ts).

Earlier direct-contract reference for the older `314ed215` baseline: [Ramp ledger, claims and authorization](https://github.com/peachbuild/adaptive-pools/blob/314ed2151367d3edb6f9045f05f5eb18567f5aa6/src/core/Ramp.sol), [ClaimFeePolicy historical rate protection](https://github.com/peachbuild/adaptive-pools/blob/314ed2151367d3edb6f9045f05f5eb18567f5aa6/src/ledger/ClaimFeePolicy.sol); its pause and withdrawal rules differ from the SDK baseline described above.


---

# 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/fees-and-claims.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.
