> 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/launchpad/launchpad-pro/core-features/uniswap-v4-hooks/fee-settlement-and-state.md).

# Fee Settlement and State

Hook settlement converts eligible launch-token fees to Quote and credits revenue into FeeEscrow. It runs separately from a Distributor's buyback, vesting or Holder-reward flows.

## Begin → Settle → Finalize

Call these methods on the Hook proxy:

| Step          | Method                                                    | Caller / condition                                               |
| ------------- | --------------------------------------------------------- | ---------------------------------------------------------------- |
| Begin         | `beginPoolFeeSweep(token, minConversionQuoteOut)`         | `Factory.feeSweepOperator()`; active pool; no open settlement    |
| Partner pages | `settlePoolFeeSweepPartners(poolId, epochId, partnerIds)` | Anyone; nonempty page of unsettled Partners active in that epoch |
| Finalize      | `finalizePoolFeeSweep(poolId, epochId)`                   | Anyone; all required Partner accounting settled                  |

Use the actual `epochId` returned by Begin or its event. `settlingEpoch(poolId)` returns zero when idle; otherwise it returns **epochId + 1**. This Hook epoch is a settlement batch, separate from a Holder reward Epoch.

Begin credits settled platform and Creator Quote revenue. Partner pages credit Partner Quote revenue. Finalize closes the batch; it does not wait for beneficiaries to claim.

## Partial conversion and rounding

If conversion input contains launch tokens, Begin requires nonzero `minConversionQuoteOut`. Use a current executable quote. `maxInternalPriceImpactBps` limits square-root-price movement, not spot-price percentage.

A price limit can leave input unconverted. Keep that remainder in its pending/carry ledger. New Partner fees after Begin enter a later epoch. Reconcile actual consumed input, converted output and Escrow credits from events and current state.

Hook conversion allocates integer rounding residuals across its revenue ledgers. The final remaining Partner-conversion Quote rounding amount is credited to the last Partner of the completing page. These rules are specific to Hook settlement; do not apply them to Splitter share allocation.

## Check progress and claim

Discover active Partners from epoch events/state and check `partnerSettled` before submitting pages. A repeated or missing Partner can prevent completion.

Curve and Hook `pendingCreator` include their `pendingCreatorTax` detail; adding them double-counts tax. For actual core claimable revenue, read `FeeEscrow.balanceOfToken(recipient, asset)` or `partnerBalance(partnerId, asset)`. Settlement callers cannot redirect these credits. Partner freeze preserves crediting but blocks that Partner's claim.

Continue with [Fees and Claims](https://docs.peach.ag/documentation/arc/launchpad/launchpad-pro/core-features/fees-and-claims) or [Revenue Distribution](https://docs.peach.ag/documentation/arc/launchpad/launchpad-pro/core-features/revenue-distribution).


---

# 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/launchpad/launchpad-pro/core-features/uniswap-v4-hooks/fee-settlement-and-state.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.
