Salar Saeedi

Blockchain research · Analysis

What Uniswap v4 hooks change in a swap quote

A v4 pool can run hook callbacks around swap and liquidity operations. Here is what to inspect before comparing it with another route.

Salar Saeedi2 min read
Three-stage illustration — What Uniswap v4 hooks change in a swap quote

Two swap routes may trade the same pair through Uniswap v4. One can use a conventional pool while the other uses a hook with additional logic. Their output, the conditions for execution and even how an integration handles a failed quote can differ.

Start with the selected pool

A hook is a contract that a v4 pool can associate with lifecycle callbacks. The available callbacks include points before or after swaps and modifications to liquidity. A hook can participate at the points it is configured for, so the pool’s hook address matters to the route.

Source · Uniswap v4 developer documentation on hooks

Compare the result along the whole route

Quotes should use the path proposed for execution, including the actual pool and relevant hook data. If one path involves pool conditions that the app cannot reproduce or explain, show its limits in the quote or omit it from executable options.

Source · Uniswap v4 developer documentation on hooks · Uniswap developer documentation on swaps

Record what happened when a quote fails

Save the chain, pool, hook and time of the observed quote. Report whether quoting failed or a signed trade reverted. These are different points in the user journey and deserve different recovery messages.

What to take away

Name the hook in route details and measure success by executable trade conditions. A small difference in quoted output can come with a meaningful change in behavior.

References

Related work in the portfolio