LLMs.txt: agent-readable Markdown index of this site at /llms.txt

Swapping FAQ

Find answers to common Uniswap API integration questions about authentication, quotes, routing, rate limits, Permit2 approvals, UniswapX, error handling, fees, and support.

Use this page to find answers to the questions Uniswap API integrators ask most often, grouped by integration phase: enabling your API key, requesting quotes, executing swaps, handling Permit2 and errors, looking up reference data, and reaching support without leaving the docs.

API Enablement

How long does it take to integrate the API?

Integration of the API can be done in less than two weeks. We provide sample code to help get you off the ground quickly. To get started, reach out to request an API key. If you are not yet in touch with Uniswap Labs, register your interest in integrating the API through the Uniswap Developer Platform.

What are the API rate limits?

By default, each API key is rate limited to 6 requests per second. If a higher rate is needed, please reach out through the help button in the Uniswap Developer Platform.

How do I authenticate API requests?

All requests require an API key, which must be provided in the x-api-key header of each request along with Content-Type: application/json and Accept: application/json. Example:

curl -X POST https://trade-api.gateway.uniswap.org/v1/quote \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"tokenIn":"0x...","tokenOut":"0x...","amount":"1000000",...}'
Is there an OpenAPI / OAS specification I can use to build a client?

Yes. AI builders can consume the full Open API Specification (OAS) at https://trade-api.gateway.uniswap.org/v1/api.json.

What Permit2 address do I need to whitelist for approvals?

The Permit2 address for all chains we support EXCEPT zkSync is: 0x000000000022D473030F116dDEE9F6B43aC78BA3.

The Permit2 address for zkSync is: 0x0000000000225e31D15943971F47aD3022F714Fa.

Quotes and Quoting

What parameter determines if I receive a gasless quote?

When the /quote endpoint's routingPreference is set to BEST_PRICE, the endpoint will attempt to find a quote that nets users the best execution price for a trade. Assuming the protocols are not limited, the endpoint will attempt to get a gasless order and a Uniswap Protocol swap quote, calculate which is currently providing the best price to the user including transaction costs, and return that quote.

Integrators of the API who only want gasless quotes may limit the protocols considered to just gasless options (e.g. UniswapX - see Swap Routing for more details).

There are some scenarios where the API will not be able to get a gasless quote, even if the integrator attempts to force it. The most common reason for this (on chains where UniswapX is supported) is that the gas price of the swap is too high relative to the value of the trade. In cases where the gas cost is 20% or more of the total trade value, the API will always return Uniswap Protocol swap quotes (if permitted by protocols) or fail.

How often are quotes refreshed?

Whenever you request a quote from the APIs, a new check is performed to get the freshest pricing.

How do you recommend setting slippage?

We recommend using our automatic slippage option in the /quote request. However, you may use your own slippage algorithm and directly populate your preferred slippage in the /quote request. When setting your own slippage, we recommend setting a low slippage for stable-to-stable swaps (ex. 20bps) and a higher slippage for stable-to-non-stable swaps and non-stable-to-non-stable swaps (since there is more price volatility between these pairs).

How should I handle failed quotes?

If a quote fails, the response includes helpful information to understand the problem with the request. The most common quote failure reason is that no route can be found for the quoted pair. This can occur for various reasons, including: all available routes would exceed the slippage tolerance, insufficient liquidity for the requested quote size, or no available route through the specified protocols. We recommend retrying the quote but modifying one or more parameters of the requested quote (ex. protocols used, slippage allowed, or the size of the swap).

How do I quote the native token?

See How Do I Swap Native Tokens?. Note, to quote the native token via UniswapX you must set the x-erc20eth-enabled header in your quote request to true.

Why am I getting "No Quotes Available" as a response?

A quote response with "No Quotes Available" means that the Uniswap router was unable to find a route for the proposed swap. This can happen for a number of reasons, many of which can be easily avoided by understanding the API constraints. While not exhaustive, some of the most common issues are:

  • There is insufficient liquidity to fill the swap
  • If making a bridge request, the selected token cannot be bridged between the two selected networks (check Supported Bridges)
  • If making a UniswapX-only request, the amount is less than 1000 USDC equivalent for L2s or less than 300 USDC for L1s (see Supported Chains)
  • The request is requesting a bridge and swap (currently not supported)
What are the valid values for the protocols field?

The possible values are V2, V3, V4, UNISWAPX_V2, and UNISWAPX_V3. To perform a swap using only UniswapX protocol liquidity, specify protocols as UNISWAPX_V2 or UNISWAPX_V3. Multiple UniswapX protocols may not be specified in the same request.

For more information, please visit Swap Routing.

Can I do a wrap/unwrap through UniswapX?

No. Wrapping/unwrapping is not supported through UniswapX protocols at all, and a request to wrap/unwrap when protocols is set to any UniswapX protocol will fail. To perform a wrap/unwrap or bridge action, do not specify values for protocols or routingPreference.

Please also note, UniswapX only supports WETH right now and ETH is not supported. You will never get a UniswapX response if ETH is the input token.

How fresh do quotes need to be before broadcasting?

Quotes are time-sensitive due to price volatility and token pairs. Uniswap recommends refreshing quotes if they are more than 30 seconds old before broadcasting, and using the deadline parameter to prevent execution of stale quotes.

Swapping

How can I simulate a swap before submitting it?

Whenever you request a quote from our endpoints we will automatically simulate the quote to ensure that the result will be a viable route should you decide to proceed to the swap step. Further, when you make a request to the /swap endpoint, you may request that the calldata we generate be simulated to further ensure that it is valid and will be processed. (Note that simulation is not a guarantee that a swap will be successful onchain as factors including gas and slippage may change between the time of the /swap response and you placing the transaction onchain).

After /quote, when do I call /swap versus /order?

Check the top-level routing field in the /quote response:

  • If routing is DUTCH_V2, DUTCH_V3, or PRIORITY → call POST /order (UniswapX).
  • If routing is CLASSIC, WRAP, UNWRAP, or BRIDGE → call POST /swap (AMM).
What values can the routing field in a /quote response take?

The possible values are:

  • CLASSIC: Standard AMM swap through Uniswap pools
  • DUTCH_V2: UniswapX Dutch auction V2
  • DUTCH_V3: UniswapX Dutch auction V3
  • PRIORITY: UniswapX MEV-protected priority order
  • WRAP: ETH to WETH wrap
  • UNWRAP: WETH to ETH unwrap
  • BRIDGE: Cross-chain bridge
What are the /swap_5792 and /swap_7702 endpoints?

POST /swap_5792 generates batch transactions for EIP-5792. POST /swap_7702 generates swap calldata which can be executed by a Uniswap 7702 delegation contract (not necessarily any EIP-7702 delegation contract).

If you know your end user has a Uniswap 7702 wallet delegation, you can use this to get a calldata which will provide the swapper with a smoother experience including batched/chained transactions.

Why should I never modify the data field of the swap response?

The data field contains the encoded contract call and must always be present as a non-empty hex string (not "" or "0x"). The API endpoints return pre-validated and correct data; modifying its value may cause funds to be lost or onchain transaction reverts.

Permit2

When is permitData returned in the /quote response?

The API will return a permitData in the /quote response when one must be signed in order to perform the swap. The API will return "permitData": null in the /quote response when no permit needs to be signed.

What values does the permitAmount parameter accept?

The permitAmount parameter accepts 'FULL' or 'EXACT'. 'FULL' is the maximum uint256 amount of the token, and 'EXACT' is a limited amount of the token scoped for just this swap.

(On exact-in swaps the 'EXACT' amount is exactly how much you will spend, whereas on exact-out it will be a bit more than what you need to account for slippage.)

Can I reuse a Permit2 signature from a previous quote?

No. A Permit2 signature returned in /quote applies only to that specific quote. If you fetch a new quote, you must also use the new Permit2 message. Reusing an older signature will cause the swap to fail. Always use the Permit2 signature from the /quote response which you are submitting to the /swap endpoint.

Error Handling

What HTTP status codes does the API return?
  • 200: Request succeeded
  • 400: Invalid request (validation error)
  • 401: Invalid API key
  • 429: Rate limit exceeded
  • 500: API error (retry with backoff)
  • 503: Temporary unavailability (retry)
What does an HTTP 400 "Request validation error" mean?

Request validation errors are returned when a request does not contain the minimum required set of fields or has other syntactical errors. Some examples are a required field (ex. autoSlippage in the /quote endpoint) is not populated, or an address is missing a character (eg. is 39 characters long instead of 40). These errors typically include a specific error message which describes the field which could not be interpreted.

What does an HTTP 401 Unauthorized error mean?

All API requests must be authenticated through the inclusion of a valid API key in the header of the request. If you do not have an API key, you may create one through the Uniswap Developer Platform. 401 errors may also be returned if the request has malformed or missing required headers, or if headers contain unsupported values.

The API is specific about request header validation. In particular, ensure that your accept and content-type headers only include the value application/json.

Reference Data

Can I query all tokens available to trade?

No, at this time we do not offer an endpoint to query all tokens which are tradable. For more information on tradable tokens, see our guide on Supported Chains and Tokens.

Which Universal Router address do I whitelist for my wallet or application?

The full list of Universal Router addresses per chain (which you may need to whitelist for your wallet(s)/application) is published in Supported Chains & Tokens. For the avoidance of any doubt, the most up to date list of routers is also maintained in GitHub.

How often are new tokens added, and are they immediately tradeable?

As new tokens are created they are automatically detected and made available for swapping within minutes of creation. New tokens may not be immediately swappable as it is dependent on there being sufficient liquidity in a pool for swapping to take place. The Verified tokens list is updated periodically as new tokens are supported by major centralized exchanges.

Where can I find the list of unsupported tokens?

Uniswap Labs maintains a list of "unsupported" tokens, for which swapping is not permitted through any method due to legal or regulatory restrictions, at https://unsupportedtokens.uniswap.org/. If one or both tokens in the swap pair are on the unsupported token list, no quote will be returned.

Which testnets are supported?

The supported testnets are Unichain Sepolia (chain ID 1301), Base Sepolia (84532), and Ethereum Sepolia (11155111). All listed testnets are accessible via the API; only Ethereum Sepolia and Unichain Sepolia are available as testnets on the Uniswap web interface. See Supported Chains & Tokens for the corresponding Universal Router addresses.

Mechanics of UniswapX

Why do UniswapX quotes have more slippage than the tolerance I set?

Quotes in UniswapX work differently than they do in the Uniswap AMMs. While AMM quotes return the market price with some buffer for slippage, UniswapX works to get users price improvement over the market price. The difference between the best and worst price in a UniswapX order is called its spread.

When you set a Slippage Tolerance in your quote request, you're only setting the amount below the market price you are willing to accept. UniswapX will still return a spread larger than your slippage tolerance when it's able to find a price above the market price.

What is a priority quote?

UniswapX supports multiple auction types that take advantage of different properties of different chains. When you request a UniswapX quote, depending on the chain, the API will return the following quote/auction:

  • Mainnet: DutchV2
  • Arbitrum: DutchV3
  • Base: Priority

In other words, a Priority quote is a specific UniswapX auction type. Uniswap will notify you of the auction type being used in the quote response. For more information on different auction types, see UniswapX Auction Types.

Which chains and protocol versions does UniswapX support?

UniswapX v2 is supported on Mainnet (chain ID 1), Arbitrum (42161), and Base (8453). UniswapX v3 is supported on Arbitrum (42161).

If you submit a quote request with protocols set to UNISWAPX_V2 or UNISWAPX_V3 on a chain not listed above, the request will fail. For most integrators, Uniswap recommends utilizing UNISWAPX_V2.

Commercial

Are there restrictions on how I can integrate the API?

The API is free to integrate into any application including whitelabeled swap experiences, wallets, mobile apps, and more. However, you are responsible for ensuring that your integration complies with our API Terms of Use.

We are very flexible regarding how you decide to offer the API through your application. Developers may create a whitelabel swap experience, add swapping to a custodial wallet, integrate the APIs into a mobile application, and more.

Can I restrict token pairs available to my users?

The APIs do not offer a way to restrict which tokens may be requested to the API, but your application may apply rules to restrict the list of tokens which your end users can access.

Can I trial the API?

Yes, sign up for a free developer account at Uniswap Developer Platform. From there you can generate API keys and test at your own speed.

Fees

Is there a cost to use the API?

No, the API is free to use.

How can I set my own fees?

API Integrators can set their own fee by providing the fee they will take from the swapper in their /quote request. See the integratorFees fields. The integratorFees field does not permit setting a fee greater than 5% of the swap value.

Does Uniswap take positive slippage as fees?

No. Uniswap Labs never takes positive slippage. All price improvement achieved at execution is for the benefit of the end swapper.

Support

How do I submit a ticket?

Use the Uniswap API help form to reach the team without leaving this page. Note that we are unable to provide technical assistance with troubleshooting your code, deployment, or workflow.

What information should I include when reporting an API issue to support?

When reporting issues, include:

  • Request ID from API response
  • Full request/response payloads (sanitize sensitive data)
  • Chain ID and transaction hash (if applicable)
  • Timestamp of the request
Is there a sandbox environment?

No, we do not offer a sandbox environment. Tests can be performed against our supported testnets through the production endpoints.

Do you offer any developer dashboards, metrics, monitoring, or usage?

At this time we do not provide any developer dashboards, metrics, monitoring, or usage reports. However, we hope to bring these to you soon as we continue to improve our API service offerings.