Architecture
Understand UniswapX reactors, fill contracts, and direct fill settlement paths across supported order formats.
Reactors
Order Reactors settle UniswapX orders. They validate a specific order type, resolve inputs and outputs, execute against a filler strategy, and verify fulfillment.
Reactors process orders using the following steps:
- Validate the order
- Resolve the order into inputs and outputs
- Pull input tokens from the swapper to the fill contract using
Permit2andpermitWitnessTransferFromwith the order as witness - Call
reactorCallbackon the fill contract - Verify that the output tokens were received by the output recipients
Reactors implement the IReactor interface which abstracts the specifics of the order specification. This allows for different reactor implementations with different order formats to be used with the same interface, allowing for shared infrastructure and easy extension by fillers.
Current reactor implementations:
| Reactor | Description |
|---|---|
PriorityOrderReactor | Settles orders via filler competition using priority gas fees |
V2DutchOrderReactor | Settles linear decay Dutch orders using block timestamp for auction decay |
V3DutchOrderReactor | Settles linear decay Dutch orders using block number instead of timestamp, enabling finer granularity on chains like Arbitrum (250ms block resolution) |
ExclusiveDutchOrderReactor | Settles linear decay Dutch orders with exclusivity period before decay begins |
LimitOrderReactor | Settles simple static limit orders |
Fill Contracts
Order fill contracts fill UniswapX orders. They specify the filler's strategy for fulfilling orders and are called by the reactor with reactorCallback.
Sample fill contract implementations are provided in the UniswapXÂ repo:
| Contract | Description |
|---|---|
SwapRouter02Executor | Fills orders using Uniswap v2 and Uniswap v3 via the SwapRouter02Â router |
For filler implementation and operational guidance, see the Filler Integration Overview.
Direct Fill
If a filler wants to fill orders using funds on-hand rather than a fill contract, they can do so gas efficiently using the directFill macro by specifying address(1) as the fill contract. This will pull tokens from the filler using msg.sender to satisfy the order outputs.
More details on the UniswapX protocol are available in the UniswapX Whitepaper and the UniswapXÂ Repo.