Index / LP management
LP management Uniswap v4 hooks
Rebalancing, rehypothecation, and position managers. Licensed Solidity excerpts with a link to the full source file.
BaseV4Hook
Abstract base that re-implements v4 pool internals inside the hook for custom curves.
Doppler
Whetstone bonding-curve hook: rebalance slugs before swap, migrate when proceeds cap hit.
DualPool
Uniswap ALF JIT hook: deploy multi-range LP around each swap, vault via ERC4626.
EulerSwap
Custom curve via beforeSwapReturnDelta: take input to Euler vaults, pay output, skip CLAMM math.
Full range
Force v2-style full-range LP: only the hook can modify liquidity, users mint a pool ERC20 instead.
JitVault
JIT lock blocks LP ops during swap; optional output skim accrues to vault balances.
Liquidity lock
afterAddLiquidity sets unlock time; beforeRemoveLiquidity reverts until lock expires.
LiquidityPenaltyHook
Withhold JIT LP fees in afterAddLiquidity and donate a linear penalty on early remove.
LpRewards
Pull buy-side token rewards, then flush() donates pending balance to in-range LPs.
MEV donate
Skim swap output to pending, then flush() donates to in-range LPs.
ReHypothecationHook
Park idle LP in yield sources, JIT a hook-owned position on beforeSwap, unwind afterSwap.
V2 pair hook
Run xy=k inside the hook: mint LP on the ERC20, NoOp the CLAMM swap with return-delta.
veLP
Curve-style vote-escrow on a v4 position: lock ticks, block early withdraw in beforeModifyPosition.