Uniswap V4 Sniper: Hooks & What Changes for Launch Bots

By Merunas Grincalaitis (X · GitHub · DEV · Hashnode · Telegram), Founder & Lead MEV Engineer at MEV DAO — Ethereum smart contract, Flashbots & MEV builder since 2017. Last updated: October 2026.

TL;DR: A Uniswap V4 sniper cannot use legacy Uniswap V2 (Pair.swap) or V3 (Pool.swap) bot scripts, because Uniswap V4 replaces individual pool contracts with a single PoolManager singleton contract, EIP-1153 transient-storage flash accounting (unlock / unlockCallback), and customizable Hooks (beforeSwap, afterSwap, beforeInitialize). Worse for naive bots, V4 lets token creators embed dynamic 99% Block 0 anti-snipe fees or MEV-tax auctions directly inside the pool's Hook contract rather than the ERC-20 token bytecode. To win V4 launches without getting taxed or trapped, your Uniswap sniper bot must simulate both the ERC-20 token and the IHooks contract inside revm before submitting a Flashbots bundle.

Part of the Ethereum Sniper Bots, Token Launches & Honeypot Defense Topic Cluster: Start with our Pillar Guide, How Ethereum Sniper Bots Work: Same-Block Buys With Flashbots (and the Real Risks), for the complete architectural blueprint. This guide focuses specifically on uniswap v4 sniper with production Ethereum mainnet parameters and runnable verification steps.

For five years, almost every retail Uniswap sniper bot on Ethereum watched UniswapV2Factory.PairCreated or UniswapV3Factory.PoolCreated and routed swaps through a standard router contract.

With Uniswap V4 live on Ethereum mainnet, that architecture is completely turned upside down. If your sniper bot only inspects the ERC-20 token contract for taxes and ignores the V4 Hook address encoded in the pool's PoolKey, a malicious beforeSwap hook can confiscate 99% of your ETH even when the ERC-20 token contract itself is a clean, 0%-tax OpenZeppelin ERC-20! Here is how a modern Uniswap V4 sniper works in 2026.

Architecture diagram of uniswap v4 sniper workflow on Ethereum showing Launch Tx Detected, Anvil Tax/Sell Sim, Block-0 Bundle Sign, and Builder Coinbase Tip
Figure 1: End-to-end Ethereum execution pipeline for uniswap v4 sniper (Launch Tx Detected → Anvil Tax/Sell Sim → Block-0 Bundle Sign → Builder Coinbase Tip).

Uniswap V2 vs. Uniswap V3 vs. Uniswap V4 Sniper Architecture

Technical Dimension Uniswap V2 Sniper Bot Uniswap V3 Sniper Bot Uniswap V4 Sniper Bot (2026)
Pool Architecture Separate UniswapV2Pair contract deployed per token pair Separate UniswapV3Pool contract deployed per fee tier Single PoolManager Singleton Contract holds all pools in one state tree
Launch Detection Event PairCreated(token0, token1, pair, ...) + addLiquidityETH PoolCreated(...) + NonfungiblePositionManager.mint Initialize(PoolId id, Currency currency0, Currency currency1, uint24 fee, int24 tickSpacing, IHooks hooks, ...) + modifyLiquidity
How Swaps Execute Direct pair.swap() transfer-in/transfer-out pool.swap() with uniswapV3SwapCallback poolManager.unlock(data) → unlockCallback using EIP-1153 transient storage deltas (take / settle)
Native ETH Support Wrapped WETH (0xC02a...) required Wrapped WETH required Native ETH (Currency.wrap(address(0))) supported directly (saves ~4,500 gas per snipe!)
Where Anti-Snipe Traps Live Inside the ERC-20 token's _transfer() function Inside the ERC-20 token's _transfer() function Inside the IHooks contract (beforeSwap / afterSwap delta overrides!) AND/OR the ERC-20 contract

You can compare how we handle V2, V3, and V4 launch routing on our Ethereum Sniper Bot: Flashbots Same-Block Sniping on Uniswap page and inspect our open-source V2/V3/Flashbots foundation in the ethereum-sniper-bot-flashbots GitHub repo.

Change #1: The `PoolManager` singleton and EIP-1153 transient storage

In Uniswap V2 and V3, deploying a new pool cost $15–$60 in gas because the factory deployed a brand-new smart contract on-chain. In Uniswap V4, every single pool lives inside one master contract: PoolManager.

When a Uniswap V4 sniper executes a Block 0 buy, it does not call a standalone pool address. Instead:

  1. Your custom Solidity/Yul executor contract calls poolManager.unlock(calldata).
  2. PoolManager sets an EIP-1153 transient storage lock (TSTORE) and immediately calls back unlockCallback(bytes calldata data) on your executor contract.
  3. Inside unlockCallback, your executor calls poolManager.swap(poolKey, swapParams, hookData).
  4. PoolManager updates transient balance deltas (int256) in memory without transferring tokens yet.
  5. Your executor settles the negative ETH delta (paying native ETH directly—no WETH wrapping required!) via poolManager.settle{value: ethAmount}() and claims the positive token delta via poolManager.take(currency1, recipient, tokenAmount).

Because V4 supports native ETH (address(0)) and EIP-1153 transient storage (TLOAD / TSTORE cost only 100 gas instead of 5,000–20,000 gas for SSTORE), a custom Yul/Solidity Uniswap V4 sniper executor uses 30% to 45% less gas than a V3 swap—giving your bundle a massive bundleGasPrice advantage in Block 0!

Change #2: How V4 Hook bitmaps work (`beforeSwap`, `afterSwap`, and `beforeReturnDelta`)

In Uniswap V4, every pool is identified by a PoolKey struct containing currency0, currency1, fee, tickSpacing, and an IHooks hooks contract address.

Cleverly, Uniswap V4 encodes which lifecycle hooks are active directly in the leading bits of the Hook contract's 20-byte Ethereum address (mined via CREATE2 salt grinding):

// Uniswap V4 Hook Permission Flags encoded in the Hook contract address:
// Bit 7 (1 << 151): beforeSwap
// Bit 6 (1 << 150): afterSwap
// Bit 3 (1 << 147): beforeSwapReturnDelta (DANGER: Can alter swap amounts/take 99% fee!)
// Bit 2 (1 << 146): afterSwapReturnDelta  (DANGER: Can confiscate output tokens!)

Look closely at beforeSwapReturnDelta and afterSwapReturnDelta! If a pool's Hook address has those permission bits enabled, the Hook contract can legally intercept your swap inside beforeSwap() or afterSwap() and override the token delta—taking 99% of your ETH or returning 0 tokens on a sell, even if the ERC-20 token contract itself has 0% tax and is verified on Etherscan!

4 new V4 Hook traps every `uniswap sniper bot` must simulate in 2026

When our MEV DAO Ethereum Sniper Bot detects a pending PoolManager.initialize or modifyLiquidity transaction in the mempool, it runs an instant revm simulation across both the token and the IHooks contract to check for four V4-specific traps:

  1. Dynamic Launch-Decay Fee Hooks (LPFeeLibrary.DYNAMIC_FEE_FLAG): Many legitimate V4 launches use a hook that charges an 80% fee in Block 0, 50% in Block 1, and decays to 1% by Block 5. If your Uniswap V4 sniper fires blindly in Block 0 without checking getFee(), you instantly lose 80% of your buy. Our simulator checks the exact net token output across Block 0, Block 1, and Block 2 and waits for the exact block where the hook fee drops below your maxTax threshold (see Anti-Snipe Token Launches on Ethereum: Deadblocks, Max-Wallet, High Tax).
  2. Asymmetric Sell-Block Hooks (afterSwap Honeypots): A scammer deploys a standard ERC-20 token paired with a custom V4 Hook. On buys (zeroForOne == true), beforeSwap returns normal deltas. On sells (zeroForOne == false), beforeSwap reverts unless tx.origin == hookOwner! Always simulate a round-trip buy + sell through PoolManager.swap in eth_callBundle / revm (see How to Detect a Honeypot Token on Ethereum Before You Buy).
  3. hookData Whitelist Signatures: Some V4 launch hooks require a cryptographic signature inside the bytes calldata hookData parameter during the first 10 minutes of trading. If hookData is empty, the swap reverts.
  4. Hook-Based MEV Auctions (Angstrom / Priority Fee Hooks): Certain V4 pools auction off the first swap in each block to whoever pays the highest hook fee or builder tip.

Frequently asked questions

Can a Uniswap V2 or V3 sniper bot snipe Uniswap V4 token launches?

No. Uniswap V4 does not deploy individual pair contracts or use UniswapV2Router02. All V4 liquidity lives inside the singleton PoolManager contract and requires an executor that implements IUnlockCallback (unlockCallback) with transient storage delta settlement (settle and take).

How can a Uniswap V4 pool be a honeypot if the ERC-20 token has 0% tax and renounced ownership?

Because in Uniswap V4, the pool's attached Hook contract (IHooks) executes custom logic on every swap (beforeSwap and afterSwap). If the Hook address has the beforeSwapReturnDelta or afterSwapReturnDelta permission bits set, the Hook itself can take a 99% tax or revert all sells without touching the ERC-20 contract code.

How do I tell if a Uniswap V4 pool uses a Hook?

Inspect the PoolKey struct passed to PoolManager.initialize(). If poolKey.hooks is 0x0000000000000000000000000000000000000000, the pool is a standard hookless V4 pool and cannot run custom hook traps. If poolKey.hooks is a non-zero address, your Uniswap V4 sniper must simulate a buy + sell through that exact PoolKey before bidding.

Does Uniswap V4 make Block 0 sniping cheaper on gas?

Yes! Because V4 uses EIP-1153 transient storage (TSTORE/TLOAD) for flash accounting and supports native ETH directly without wrapping into WETH first, a gas-optimized V4 snipe uses 30%–45% less gas than a V2 or V3 snipe.

Does the MEV DAO Ethereum Sniper Bot support Uniswap V2, V3, and V4 launches?

Yes. Our MEV DAO Ethereum Sniper Bot automatically detects whether liquidity is being added to Uniswap V2, V3, or V4 PoolManager, runs a full round-trip buy/sell simulation (including V4 Hooks), and submits an atomic Flashbots bundle.


Want to snipe Uniswap V2, V3, and V4 launches with automatic Hook simulation and 0% per-trade taxes? Start your 3-day free trial at mevdao.org/subscribe, or message me directly on Telegram (@merunas) if you need custom Uniswap V4 hook or bot development.

← More on Sniper Bots All articles