Half I requested whether or not an AMM floor fashioned. Half II ran pool state ahead. Half III contrasted reserves with ebook depth. This piece runs the AMM protection layer: mounted price vs state-responsive price.
Half III ended on dynamic charges as proof that the fixed-fee pool was under-defended-not as proof that hooks beat a ebook. Uniswap v4 dynamic charges make the protection layer callable: a hook can learn pool state and set the price per swap.
The design query is narrower than “can the hook observe extra fields?” Below this constant-function market maker (CFMM) setup — particularly a constant-product market maker (CPMM) — does an additional discipline add info, or solely rescale a response the invariant already implies?
I put Campbell et al. (2025) and Baggiani et al. (2025) into the identical Rust lab. Campbell et al. provide the fixed-fee LP goal and the routing mechanism: when CEX buying and selling is dear, a stale AMM can nonetheless entice elementary move by charging a low sufficient price. Baggiani et al. provide the coverage query — whether or not observation-based charges can beat a static optimum. 4 insurance policies share one FeePolicy interface and the identical Monte Carlo paths: mounted 6 bps, mounted 10 bps, oracle-gap, and inventory-gap.
The bridge is market-making management. Campbell et al. outline what the pool is attempting to guard: price income internet of stale-price loss. Baggiani et al. change the price from a scalar parameter right into a coverage over market state. A CLOB maker does this by means of spreads, measurement, cancels, and publicity limits when move turns poisonous. A programmable AMM can not reproduce the entire ebook, however price is its smallest spread-like protection.
The Campbell baseline
It is a baseline verify, not a fee-design breakthrough. A CEX or oracle reference strikes earlier than the pool value does. Arbitrage closes the hole; the LP absorbs LVR. Campbell et al. formalize that setting with arbitrageurs, elementary merchants, and a passive LP. Hedged PnL is price income minus monitoring error.
Within the lab, oracle_gap_bps is pool value vs CEX value in bps-the publicity window earlier than arb trades. arb_delta closes the hole every step; hedged_pnl data what the LP saved internet of LVR.
With a ten bps CEX price, the optimum AMM price lands close to 6 bps. Increased charges extract extra per arb commerce however widen the no-trade band and lose elementary move. I reproduced the sweep in Rust-1 to 100 bps on one GBM path, then 500-path Monte Carlo.

Under 6 bps, arb retains buying and selling however the price doesn’t cowl LVR. Above 6 bps, the pool retains some arb income however loses elementary move to the CEX.
Price as a coverage
Dynamic charges are management legal guidelines over observations. Manufacturing hooks override the price in beforeSwap or through updateDynamicLPFee. The simulation makes use of the identical floor: observe state, select price, run arb and elementary trades.
FeeObservation carries oracle hole (bps), stock skew, and up to date realized volatility. On this comparability, realized volatility is recorded however not used within the price rule. Every step calls coverage.price(&obs) earlier than trades execute.
FixedFeePolicy reproduces the Campbell baseline. In these runs, price is saved as a fraction ( 1 bps = 0.0001, so base_fee = 0.0006). The 2 dynamic insurance policies are:
- OracleGapFeePolicy: price = base_fee + 0.04 × |oracle_gap_bps| / 10 000, clamped to [1, 20] bps
- InventoryGapFeePolicy: price = base_fee + 0.01 × |inventory_skew|, clamped to [1, 20] bps
Oracle-gap expenses extra when the pool has drifted from the CEX. Stock-gap expenses extra when reserve composition is imbalanced. Similar interface; totally different acknowledged sign.
Oracle-gap beats mounted 6 bps on each path
Throughout 500 paired Monte Carlo paths, oracle-gap beat mounted 6 bps on each path: imply Δ hedged PnL +15.2, minimal +8.

The comparability is paired by seed: mounted, oracle-gap, and inventory-gap run on the identical GBM path and demand attracts. The delta distribution is the helpful statistic as a result of it asks what modified when solely the price rule modified.

Stock-gap additionally beat mounted 6 bps on each path, however imply acquire was solely +1.8 -roughly one-eighth of oracle-gap’s benefit.
Stock skew collapses into oracle hole
Stock skew will not be a brand new sign right here. In a CPMM, each fields are monotone capabilities of the identical quantity-deviation between AMM and CEX value:
oracle_gap_bps = (P_amm − P_cex) / P_cex × 10 000
inventory_skew = (P_amm − P_cex) / (P_amm + P_cex)
When arb retains the pool close to the CEX value, P_amm ≈ P_cex and the skew denominator is roughly 2 × P_cex:
inventory_skew ≈ oracle_gap_bps / 20 000

InventoryGapFeePolicy applies the identical sign at decrease acquire—the step-level audit within the repo exhibits why. The +1.8 imply acquire is amplitude, not a distinct sign.
That is particular to constant-product swimming pools the place arb constantly aligns pool value with the exterior reference. In pegged-pool designs, reserve imbalance can transfer whereas marginal value stays close to peg, so stock can carry info not captured by present oracle hole. Curve’s offpeg_fee_multiplier is geared toward that regime, not at CPMM-style rescaling.
What a hook ought to take a look at subsequent
If the function is reserve-derived in CPMM, assume redundancy till proven in any other case. Present oracle hole is the primitive; stock skew, reserve ratio, and pool value are capabilities of it. Including them doesn’t develop the data set. It rescales the response.
The subsequent candidate will not be one other reserve-derived discipline. It’s path-derived or exterior:
- Realized volatility: not recoverable from instantaneous CPMM state
- Order-flow imbalance: directional stress inside a block, seen earlier than the swap executes
- Oracle latency: time since final dependable exterior replace
- Poisonous-flow proxy: share of current quantity from arb vs elementary demand
These break collinearity as a result of the invariant doesn’t encode them. The take a look at: does the function add info past present oracle hole below the identical path and demand assumptions?
Closing
Half II ran two settings: a seeded path the place charges beat LVR, and a deterministic shock the place LP-vs-hold stayed adverse. The coverage layer issues right here: oracle-gap dynamic charges beat mounted 6 bps on each sampled path, whereas inventory-gap provides solely a small carry as a result of the 2 alerts are practically collinear.
That doesn’t show dynamic charges rescue LP economics in manufacturing. The run makes use of illustrative parameters (σ = 4%, μ = 0, 100 Y elementary demand per step, CEX price = 10 bps). The acquire nonetheless will depend on multiplier, demand, and volatility regime, even when the sign relationship is structurally redundant below the CPMM invariant.
Manufacturing must be stricter than simulation. This reduced-form world has no fuel public sale, block latency, queue dynamics, or LP repositioning value. A hook that freely explores price settings with LP capital can develop into statistical playing as soon as these frictions enter. The safer model begins from a champion rule, deviates solely when edge clears value and uncertainty, and might abstain.
Below CPMM, most price innovation is management regulation, not info. The subsequent take a look at is strict: add a path-derived function (realized volatility or order-flow proxy), verify orthogonality to oracle hole on the identical paths, then maintain it provided that paired PnL improves at matched danger.
Appendix: supply
- Half I: The token appeared twice. The AMM market fashioned as soon as.
- Half II: Earlier than MEV, I Constructed a Rust AMM Lab to Measure Pool State.
- Half III: Hyperliquid Exhibits What a Market Appears Like With out an AMM Pool.
- Github Repo: amm-lab, Campbell simulation and dynamic-fee coverage runs
- Campbell: Campbell, S., Bergault, P., Milionis, J., and Nutz, M. (2025). arXiv:2508.08152.
- Baggiani: Baggiani, L., Herdegen, M., and Sánchez-Betancourt, L. (2025). arXiv:2506.02869.
This publish was initially printed on my private weblog: https://egpivo.github.io/2026/07/21/dynamic-fees-amm-signal-matters.html
Dynamic Charges in AMMs: When the Sign Issues was initially printed in The Capital on Medium, the place persons are persevering with the dialog by highlighting and responding to this story.


