Fee machinery
The concept is that fees are a path statistic. This is what ships.
The C-pool accumulator
A claim is over the active interval, computed by a Uniswap v3-style
flipped per-tick accumulator: each tick stores fOutside, flipped on crossing, and a position
carries an entry snapshot. A crossing costs one flip regardless of how many classes reference the
tick.
The compounding identity survives intact: a quote injection is a floor translation — the same additive shift for every active position, independent of and — so ladder spacing and ordering are preserved.
Per-holder state is one slot per (holder, class) plus a settle-on-transfer hook. claim() pays a
holder's accrued fees and leaves untouched, and a late depositor starts at zero claimable with
no contribution to anyone's pot.
Where the pot sits — outside the curve, inside the share:
| counts? | |
|---|---|
| toward , price, liquidity, the floor | no — the invariant reads the curve quote only |
| toward the share | yes — a share is a claim on the position plus accrued fees |
That separation is the point: compounding would otherwise move the floor, and the whole reason classes are fungible with zero per-holder path state is that fees live outside share value.
The mint fee
Newly earning C-pool exposure pays key.mintFee times the increase in earning liquidity, in quote.
The creator fixes this rate in the key. The current local contracts require
2 * swapFee <= mintFee <= 2%.
The fee goes to the protocol treasury when configured. Otherwise it is distributed through to pre-existing active liquidity before the new position's snapshot. With neither a treasury nor active liquidity to receive it, no fee is pulled. The minter receives full pro-rata shares.
Dormant and capped-out mints do not pay this fee. Edits receive credit for existing earning exposure and pay on the net increase. For example, a 2 bp mint fee on costs 0.20 quote units, in addition to the position's required reserves.
includes swap income and any mint fees routed to active LPs. The displacement identity describes swap segments; distributed mint fees add separate increments.
The swap-fee tax
C-pool swap income is credited before any payout tax. The market's policy sets swapFeeTax at
initialization, bounded at 25% and fixed for that market. On a claim or burn, the taxed portion is
reserved for the protocol when a treasury is configured. Fee views report the holder's net amount.
Fixed swap fees and variance measurements
Both pool types charge the fixed swapFee selected at creation. The current C-pool key has no
alpha, kappa or phiMin fields. The variance statistic remains available for comparing
fee income with realized LVR.
The matched gain describes a variance-based pricing model. The following estimator discussion records the earlier dynamic-fee design; it does not describe the fee charged by current contracts.
How the estimator samples
One observation per swap. A swap books its own total regardless of how many ticks it crossed. The swap is the economic event; ladder geometry must not price it.
That replaced per-segment sampling, which was wrong twice over. Variance is quadratic, so chopping one move into pieces gives : an identical move of measured 1988 bp of fee crossing no ticks and 491 bp crossing four — a 4× swing from ladder density alone. And there was no time dimension at all: two swaps in one block and two a thousand blocks apart left byte-identical state, so a quiet hour decayed nothing.
Accumulated within a block, folded on the next. Swaps in the same block sum into a block total, which enters the EMA when a later block opens. Silent blocks decay it, one factor each, bounded at 8 steps.
Note is a separate accumulator and still integrates per segment — it is total realized quadratic variation for the edge readout, not the fee kernel, and finer sampling is correct there.
Why the decay is
Not a tuning choice. By the swap law each swap executes at the log-midpoint of its own move, so the pool price is already an EMA of the external price with weight per trade. Setting makes the variance kernel that prices LVR track the same weighting the pool actually trades at, rather than measuring one thing and charging for another. It is the LVR-protection mechanism, not a smoothing parameter.
A slow lags what it prices — undercharging through a volatility spike, exactly when LVR is worst, then overcharging long after the move is done — and it spreads one large trade's penalty across later traders (≈3 swaps at , ≈100 at 0.01).
Both ends are bounded
A floor of 1 bp (default 2 bp), because the estimator is cold in exactly the windows an attacker picks.
A cap of 25%. An arbitrageur closes a gap only when , so is the half-spread and the cap bounds the worst spread the pool will quote. Under a one-block jump quotes next block, so the cap binds for one-block moves above ~56% — depegs and exploits, not routine flow — decaying by per silent block.
In that earlier design, , and were key fields. They are absent from the current fixed-fee key.
The F-pool ships fixed with a computable kernel
is constant, but accrues anyway — one slot, one add per touched leg — so the fee the kernel would quote and the edge stay computable by anyone, on-chain, in a pool that has no fee accounting at all.