How to create a Uniswap v4 hook (with or without code)
11 November 2026
There are two ways to create a Uniswap v4 hook. If you want a pool with rules like a tax, anti-snipe or a liquidity lock, you don't need to code at all. If you want behaviour nobody has built yet, you write the hook yourself. Here is how both work.
Option 1: no code (a few minutes)
- Open Create and pick a chain.
- Choose your rules from 15 ready-made ones and set the numbers.
- Paste your token, pick a pair (ETH or a stablecoin) and a starting price.
- Sign one transaction. Your pool goes live with the hook attached.
More detail in our Uniswap hook builder guide.
Option 2: write it in Solidity
- Set up the project. Most developers use Foundry with OpenZeppelin's uniswap-hooks library, which gives you a tested
BaseHookto build on. - Choose your permissions. In
getHookPermissions(), switch on only the moments you need, for examplebeforeSwapto change fees orafterSwapto take a cut. Fewer permissions means less risk and an easier review. - Write the logic. Implement the matching functions, such as
_beforeSwapor_afterSwap. Taking tokens from a trade needs the "return delta" permissions as well. - Test against real Uniswap code. Deploy the v4 PoolManager in your tests and run real swaps and liquidity changes through your hook, including edge cases like tiny and huge trades.
- Mine the address. Uniswap reads a hook's permissions from the last bits of its address, so the hook must be deployed with CREATE2 and a salt that gives the right address. See how to deploy a Uniswap v4 hook.
- Deploy, verify and create a pool. Publish the source on the block explorer so others can read it, then initialize a pool with your hook in the pool key.
Which should you pick?
- No code if you are launching a token and want proven rules today.
- Solidity if your idea is new: a new kind of market, custom pricing, or a protocol built around the hook.
- In between: Advanced starts from the tested rules and lets AI add custom code from a plain-English description, then deploys your own hook. See how that works.
Before you launch
Whoever made it, traders will check what your hook can do. See what the hook safety report looks at, so your hook passes.
Try it on your own token. Pick the rules, sign one transaction, no code.Create a hook