Uniswap v4 Hooks
How v4's hooks turn an AMM pool into programmable infrastructure — custom logic at every stage of a swap — plus the singleton architecture and the new risks that programmability introduces.
Programmable Liquidity Pools
Uniswap v4 introduced hooks: smart contracts that plug into a liquidity pool and run custom logic at specific moments — before and after a swap, before and after liquidity is added or removed, and at pool initialisation. Earlier Uniswap versions were fixed: every pool behaved the same way. Hooks make a pool programmable, so developers can attach custom behaviour to an otherwise standard AMM. This turns Uniswap from a fixed product into a platform other people build on top of.
What Hooks Enable
With hooks, a pool can do things the base AMM never could: charge dynamic fees that change with volatility, run on-chain limit orders, auto-compound or redistribute fees, implement time-weighted average price (TWAMM) orders that execute large trades gradually, capture or redistribute MEV, gate access, or feed custom oracles. Because the hook runs at defined points in the swap/liquidity lifecycle, it can modify or extend behaviour while the core pool math stays standard and audited. The result is an ecosystem of specialised pools built on shared, battle-tested plumbing.
- Hooks are contracts that run custom logic at set points in a pool's lifecycle
- They make Uniswap pools programmable rather than one-size-fits-all
- Enables dynamic fees, on-chain limit orders, TWAMM, custom oracles, MEV capture, and more
- The core AMM stays standard; hooks extend it at defined moments
Key Takeaways
- v4 hooks turn a pool into programmable infrastructure
- Custom logic runs before/after swaps and liquidity changes
- Developers build specialised pools on shared, audited core plumbing
Related Content
Related Coins
Key Terms
More Topics
Browse all 179 topicsNon-USD Stablecoins & On-Chain FX
Why almost all stablecoins are dollar-denominated, the growing set of euro and other-currency stablecoins, and how on-chain foreign exchange could reshape cross-border payments and remittances.
Crypto Lending: CeFi vs DeFi
How borrowing and lending crypto works across centralized platforms and DeFi protocols, why the 2022 CeFi lenders collapsed, and how over-collateralized DeFi lending differs structurally.
Fully Homomorphic Encryption (FHE)
How FHE lets computation run directly on encrypted data without ever decrypting it, why that is a holy grail for on-chain privacy, and the performance reality that still limits it.
Cryptographic Accumulators
How accumulators compress a whole set into one short value and prove membership (or non-membership) with tiny proofs — the primitive behind efficient allowlists, state proofs, and stateless clients.
Permit2 & Signature Approvals
How Permit2 and EIP-2612 replace clunky, dangerous unlimited token approvals with signed, time-boxed permissions — improving UX and safety, and where the new signature surface can still be abused.
Account Abstraction: Paymasters & Bundlers
A deep dive into the ERC-4337 machinery beyond the wallet: how bundlers relay user operations, how paymasters sponsor or tokenise gas, and the economics and trust of gasless transactions.
Decentralized AI Training & Inference
How crypto networks try to coordinate distributed AI compute, training, and inference — Bittensor, Akash, Ritual and others — the token incentives involved, and the hard technical limits.
Quadratic Funding
How quadratic funding uses a matching pool and a square-root formula to fund public goods by breadth of support rather than size of wallet — the math, why it fights plutocracy, and how sybils break it.
References & further reading
- primaryUniswap v4 documentation
Official docs for hooks, the singleton, and flash accounting.
archived copy ↗