> 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-keeper-policy.md).

# Fees

How dynamic LP fees, directional premiums and keeper updates are resolved.

### Understand the charges

| Charge                               | What it applies to                                                                                                                          |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Pool trading fee                     | Swap input, through normal V4 fee-aware math. The quote already includes it.                                                                |
| Protocol share of LP earnings        | Collected position trading-fee income, before net earnings are credited. It is not another percentage of swap input or deposited principal. |
| Network gas                          | Transaction execution, including approvals and failed transactions.                                                                         |
| Optional interface or routing charge | A separate application charge, if that integration specifies one; not covered by the pool fee cap.                                          |

The pinned direct liquidity flow has no percentage deposit or withdrawal fee on principal. Price changes and changes in the asset mix still affect what an LP receives. [Fees & Claims](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/fees-and-claims) explains earnings settlement and the protocol-share limit.

### Ordinary swap fee

All swap fees use pips with denominator **1,000,000**: 1 pip = 0.0001%; 100 pips = 1 bp = 0.01%; 700 pips = 0.07%; 6000 pips = 0.6%. Calendar times, keeper expiry and pause deadlines use integer Unix seconds. Tick direction is independent of token labels: `zeroForOne=true` sells currency0 for currency1 and decreases sqrt-price; false sells currency1 for currency0 and increases sqrt-price.

For direction `d`, let `C = maxFee(poolId)`, `F = pokeFloor(poolId)`, `K[d]` be the keeper side, and `Texp` its common expiry. Let `B(t)` be the base policy: configured `flatPips` for Default, or the [RWA curve](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/rwa-calendar-and-fee-curve). Let `premium` apply only when `d == premiumZeroForOne`:

```
raw[d,t] = B(t) + (premium if d == premiumZeroForOne else 0)
A[d,t]   = min(raw[d,t], C)

if t < Texp and K[d] != 0:
    ordinary[d,t] = min(max(K[d], max(floor(A[d,t] / 2), F)), C)
else:
    ordinary[d,t] = A[d,t]
```

Apply the cap **before** computing the keeper's 50% lower bound. A zero keeper side falls back to autonomous policy for that direction only. Equality at expiry means **expired**. `MAX_POKE_TTL` is 72 hours in the pinned source. The setter restricts nonzero keeper fees to the configured floor/cap and requires at least one nonzero side; the execution-time half-autonomous guard can still raise a valid keeper value.

`poolFloor` is the configured keeper lower bound, not an unconditional additional fee and not a replacement for RWA curves. RWA uses the minimum of open/overnight/closed floors as this bound. `MAX_POKE_DISCOUNT_BPS = 5000` describes the 50% bound, not a fee to add. Raw peaks/premiums are evaluated before the final cap and may exceed 1,000,000 pips.

| Example             | Inputs                                                | Ordinary result            |
| ------------------- | ----------------------------------------------------- | -------------------------- |
| Directional premium | base 700, premium 200 on 0→1, no keeper               | 900 on 0→1; 700 on 1→0     |
| Keeper lower guard  | raw 900, floor 100, cap 6000, active keeper 300       | `max(300,450,100) = 450`   |
| Integer half        | raw 701, floor 100, active keeper 100                 | `floor(701/2) = 350`       |
| Expiry              | previous 900/300 example, `t == Texp`                 | 900                        |
| Cap before half     | raw 3,000,000, cap 6000, floor 100, active keeper 100 | 3000; without keeper: 6000 |

`ABSOLUTE_MAX_FEE` is immutable per deployment and bounds valid pool caps. Both recorded Arc snapshots report 1,000,000; the synthetic sequence harness uses 20,000. Do not confuse either with a universal pool fee or with the configured Mid-block cap. Read deployment and per-pool caps. The sample live pool caps are 6000 for Default and 50,000 for RWA at the recorded block. These are historical recorded Arc snapshots and synthetic harness settings, not a guarantee of current deployment settings or production acceptance. Re-read current deployment and per-pool caps before integration.

### Three fee getters

| Getter                    | Meaning                                                                                                      |
| ------------------------- | ------------------------------------------------------------------------------------------------------------ |
| `autonomousFee(poolId,d)` | Uncapped autonomous base plus the applicable directional premium, evaluated at the call's block timestamp    |
| `currentFee(poolId,d)`    | Ordinary LP fee after cap/keeper resolution; **excludes Mid-block**                                          |
| `executionFee(poolId,d)`  | Ordinary fee plus current-block Mid-block policy, using the stored observation and current PoolManager price |

These getters do not themselves establish an observation. They also do not replace the swap-path pause check. A paused pool may still return fee values successfully.

Optional [Mid-block policy](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/mid-block-policy-and-observations) is applied after the ordinary fee. See those pages for the complete RWA and Mid-block algorithms rather than adding independent fees twice.

### SDK fee display

With the [Quickstart client](https://docs.peach.ag/documentation/arc/adaptive-pools/quickstart), use `getCurrentFees(poolId, block)` for `fee0For1Pips` / `fee1For0Pips` and pause flags. Use Reader-backed `getFeeBreakdown(poolId, zeroForOne, block)` for `baseFeePips`, premium, capped autonomous fee, override and `finalFeePips`. Keep related results on the same returned block.

Those SDK fee results exclude the Mid-block surcharge. `quoteSwap` / `quoteSwapExactOutput` simulate the selected-pool swap; do not subtract a trading fee again from their amounts. A fee read does not show that a swap is executable. Preview RWA time curves with `previewFeeAt`; details are in [RWA Calendar](https://docs.peach.ag/documentation/arc/adaptive-pools/core-features/rwa-calendar-and-fee-curve).

Fee displays use pips; claim caps use bps. User slippage is also expressed in bps but protects token amounts, not the configured fee rate. Keep these separate in UI and transaction parameters.


---

# 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-keeper-policy.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.
