Swapping via the Uniswap API
High-level overview of swapping through the Uniswap API
High Level Message Flow
The diagram below is an illustration of the token swap flow where steps in gray are taken through the Uniswap API and steps in red are written to the blockchain by the integrator.
- The integrator checks if they have given the necessary approval to the Permit2 contract to spend the token they intended to swap through a
/check_approvalrequest.- If the approval is not yet in place, a fully-formed transaction is returned to the integrator to sign.
- The integrator makes a request for quote for their desired swap using a
/quoterequest.- Quotes are requested whether the integrator is seeking to perform a token for token swap, a cross-chain bridge, or a token wrap/unwrap.
- The integrator specifies their desired execution paths (Uniswap protocols or UniswapX) through the
protocolsarray (see more below). - The integrator receives back the best available quote and a fully-formed transaction for signature to approve the the swap.
- Depending upon the desired outcome and selected
protocols, the integrator makes either an/orderor/swapAPI request/orderrequests are submitted when the swap will be filled by a UniswapX RFQ market maker. In this case the order is "gasless" because the market maker will write the transaction to chain to fill the swap./swaprequests are submitted when the swap will be filled by a "classic" v2, v3, or v4 Uniswap protocol pool, or in the event that the swap is a bridge or a token wrap/unwrap. This is a "gasful" transaction because the integrator will write the transaction to the chain to fill the swap.
UniswapX Minimum Quote Values
If using UniswapX protocols, quote requests require a minimum of 300 USDC equivalent on Mainnet and 1,000 USDC equivalent on L2 networks (Arbitrum, Base).
Requests below these thresholds will return "No quotes available." See Supported Chains for details.
For full request and response schemas for each endpoint, see the APIÂ Reference.