VolatilePair Overview
Understand VolatilePair, a Uniswap v4 hook that sets a separate LP fee for each swap direction on pools of volatile pairs.
VolatilePair is a Uniswap v4 dynamic fee hook for volatile pairs such as ETH/USDC. On every swap, the hook uses a custom algorithm to set swap fees. Both the ask and bid fees are determined by the algorithm.
There are four design goals accomplished by the dynamic fee:
- Constant spread in calm blocks. The pool aims to quote a fixed spread.
- LPs share backrun value. When a large trade moves the price, fees in the backrun direction are raised to capture a share of backrun value.
- Lower LVR. The side that informed flow trades on pays more. The total spread stays the same.
- Less sandwiching. The mid-block extra makes the back leg of a sandwich pay more.
Only Uniswap Labs can create VolatilePair pools. Uniswap Labs creates each pool and sets its fee parameters in the same transaction. See Pool Creation and Configuration.
Concepts
- Dynamic Fees: overview of the dynamic fee algorithm with a worked example
- Permanent Fee: how the fees change after a price move
- Temporary Fee: the one-block fee on the backrun side
- Mid-Block Fees: how the fee grows within a block
- Pool Creation and Configuration: who can create pools, and where fee parameters are stored
Guides
- Swap Against a VolatilePair Pool: quote and execute swaps
- Provide Liquidity on VolatilePair: deposit and withdraw
Repositories
- Uniswap/v4-hooks-public: hook source and tests
Deployments
See VolatilePair Deployments for hook addresses and pool parameters.
Security
See VolatilePair Security for the trust model, invariants, and audit.