Uniswap v4 hooks bait DeFi traders with fake swap quotes

Share This Post


Liquidity aggregator 0x said on Sept. 14 that it had seen an alarming increase in malicious Uniswap v4 hooks over recent weeks, designed to quote one price and settle at another.

In the most extreme trades it observed, users received as much as 50% less at execution than the amount displayed in the quote.

An aggregator searches many pools, estimates their output, and typically favors the route promising the most tokens. A malicious pool can win the order by looking unusually attractive during that comparison.

Uniswap v4 hooks show when the best quote becomes the attack surface

In its analysis of Uniswap v4 hooks, 0x said it examined 84,163 hooks across six chains using static analysis, dynamic analysis, and settled-trade observations. In the dataset, labeled as of Sept. 11, 0x classified 19.4% as safe, 54.2% as malicious, and 26.4% as likely malicious.

The report separately said 0x had observed malicious routes deliver up to half less than quoted, a maximum shortfall rather than a typical outcome.

One Base hook trading the ETH/NVDAc showed 6,516 fills, including 3,946 charged fills. Fees ranged from 0% to 18%, with an 18% median when charged, and the hook collected $143,037 in total fees as of Sept. 11.

Uniswap v4 hooks are optional external contracts that can run around key pool actions. Uniswap’s developer documentation says hooks can execute before or after a swap, while selected permissions can adjust balance deltas.

This flexibility also enables legitimate features such as dynamic fees and custom accounting. Uniswap warns users that independent third parties write hooks and that the code may be malicious or cause unintended consequences.

Permissionless code can enter a price competition whose output looks objective to the person approving the trade.

Imagine Wallet A offers 100 tokens and Wallet B offers 98, so Wallet A wins the screen comparison. If its selected pool recognizes the quote request and later settles for 80, Wallet B’s apparently worse offer was the better trade.

When the best quote losesWhen the best quote loses
Infographic illustrates how a malicious liquidity hook can turn the best displayed swap quote into worse execution, while route screening changes the outcome.

In July, routing infrastructure provider Enso documented what it called toxic pools, including a Polygon Uniswap v4 hook that used execution-environment signals and an Ethereum Curve pool whose oracle behavior changed under simulation-like conditions.