ERC-4626 Wrapper Overview
Understand the ERC4626 Wrapper Hook, a Uniswap v4 hook that wraps and unwraps ERC-4626 vault shares against their underlying asset at the vault's own exchange rate.
ERC4626WrapperHook exposes an ERC-4626 vault as a Uniswap v4 pool. One side of the pool is the vault's share token (the wrapper currency), the other is vault.asset() (the underlying currency). A swap in one direction deposits the underlying into the vault and returns freshly minted shares; a swap in the other direction redeems shares and returns the underlying. Conversion always happens at the vault's reported exchange rate, so a swap settles exactly as vault.deposit or vault.redeem would, reached through the swap interface routers and aggregators already speak to.
The pool holds no liquidity and charges no fee. It is a conversion venue, not a market: no price discovery, no LP position, and no slippage beyond the vault's own rounding. All swap-time logic lives in beforeSwap, which absorbs the entire swap and returns a BeforeSwapDelta describing the conversion.
Concepts
- Wrapper Pools: pool rules, hook permissions, and contract hierarchy
- Pool Initialization: how the token pair and fee are validated
- Swap Mechanics: the wrap and unwrap paths and delta accounting
- Exchange Rate and Rounding: how the vault prices every swap
- Exact Input and Exact Output: which swap types are supported
- The Routing Twin: how quotes are served
- Extending the Hook: the overridable seams for subclasses
Guides
- Integration: route, quote, and execute wrapper hops
Security
See ERC-4626 Wrapper Security for the security model, invariants, and audit.