Multi Hop Swap v3 To v4

A workflow-focused guide to Performing a V3-to-V4 Multi-Hop Swap with the Universal Router - Discover the clever, multi-step process for chaining cross-version swaps and learn how V4's dynamic action constants solve the Universal Router's static input challenge.

1. Understanding the Uniswap Universal Router
An architectural breakdown to Understanding the Uniswap Universal Router - Dissect its powerful command-based design that unifies the entire Uniswap ecosystem, and trace the execution flow from the central `dispatch` logic to the v4 `unlockCallback`. Duration: 8min
2. v4 Swap Example
A structural breakdown to Executing Swaps with the Universal Router - Deconstruct the atomic transaction process by building the core `commands` and `inputs` parameters from scratch, and see how a single `V4_SWAP` command is composed of multiple low-level actions. Duration: 8min
3. Commands
A control-oriented breakdown to Universal Router Failure Handling - Explore the `execute` function's default atomic behavior for batched commands, and see how the most significant bit is used to create optional actions that can fail without reverting the entire transaction. Duration: 2min
4. Permit2 On Universal Router
A cross-repository trace to How the Universal Router Uses Permit2 for V4 Swaps - Follow the execution path from the `execute` entrypoint to the final `PERMIT2` call, and discover how an abstract `_pay` function bridges the generic V4 settlement logic with the router's specific payment implementation. Duration: 2min
6. Multi Hop Swap v3 To v4
A workflow-focused guide to Performing a V3-to-V4 Multi-Hop Swap with the Universal Router - Discover the clever, multi-step process for chaining cross-version swaps and learn how V4's dynamic action constants solve the Universal Router's static input challenge. Duration: 5min
7. Exercises Swap v3 To v4
Reading Time: 0min
8. Mixed Quoter
A simulation-based guide to Programmatically Getting a Uniswap V4 Swap Quote - Move beyond gas-intensive on-chain calculations and learn to get precise V4 swap outputs by simulating transactions on a mainnet fork with Foundry. Duration: 6min
9. Quoter Exercises
Reading Time: 0min

Course Overview

About the course

What you'll learn

Difference between Uniswap v3 and v4

Uniswap v4 PoolManager

Uniswap v4 Hooks

Uniswap v4 PositionManager

Uniswap v4 Universal Router

Uniswap v4 Singleton architecture and flash accounting

Uniswap v4 operations and lifecycle

Uniswap v4 multihopping and quoting

How to build a Uniswap v4 swap router

How to build a smart contract a liquidation bot executes

Course Description

Meet your instructors

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

Last updated on November 6, 2025