Skip to main content

Universal Router Contract

The Universal Router executes swaps across V2 and V3 pools via an encoded command interface. In practice, you do not need to encode commands yourself — the Swap API generates the calldata for you. For the concept overview, see Universal Router Concepts.

Key Functions

execute

Executes a sequence of commands in order.
You typically do not call execute() directly. Use the Swap API to generate the { to, data, value } object, then send it as a transaction.

Command Types

Usage Pattern

The recommended pattern is to use the Swap API to generate calldata:

Error Handling

Common revert reasons:

ABI