Uniswap
Uniswap is the world's leading decentralized exchange (DEX) protocol, enabling permissionless token swaps on Ethereum and 25+ EVM-compatible blockchains through automated market making (AMM). The Uniswap Labs Trading API provides REST endpoints for quotes, swap execution, gasless UniswapX orders, liquidity provider (LP) position management, and wallet operations. Developers can build trading bots, portfolio managers, DeFi aggregators, and embedded swap UIs on top of the protocol.
3 APIs
8 Features
BlockchainCryptocurrencyDeFiDecentralized ExchangeLiquiditySwaps
The Uniswap Trading API provides REST endpoints for token swaps, bridges, liquidity management, and execution planning across 25+ blockchain networks. It supports swap quoting, ...
The Uniswap Subgraph API provides GraphQL endpoints for querying on-chain data across Uniswap protocol versions v1, v2, v3, and v4. Powered by The Graph Protocol decentralized n...
UniswapX is a gasless, auction-based ERC20 swap settlement protocol that routes orders through a competitive filler network. Swappers sign off-chain orders which are filled by f...
Token Swaps
Swap any ERC-20 token on 25+ EVM chains with optimal routing across Uniswap v2, v3, and v4 liquidity pools.
Gasless UniswapX Orders
Sign off-chain intent-based orders that are filled by competing fillers without requiring the swapper to pay gas fees directly.
Liquidity Provider Management
Create, increase, decrease, and manage concentrated liquidity positions on Uniswap v3 and v4 with fee tier and tick range control.
Cross-Chain Bridging
Bridge tokens across EVM networks using the unified quote and swap APIs with automatic routing to the best bridge provider.
Limit Orders
Submit limit orders that execute automatically when market conditions meet the specified price target.
Smart Wallet Support
Native support for EIP-7702 delegated accounts, ERC-4337 account abstraction, and EIP-5792 wallet capabilities.
Execution Plans
Create multi-step execution plans for complex DeFi workflows with step proofs for verification and tracking.
On-Chain Data via Subgraphs
Query historical and real-time on-chain data for pools, positions, swaps, and ticks via GraphQL subgraph endpoints.
Token Swap Integration
Embed token swap functionality in wallets, DApps, and portfolio managers using the Trading API's quote and swap endpoints.
DeFi Aggregator
Build a DEX aggregator that routes through Uniswap's liquidity alongside other protocols for best execution.
Liquidity Mining Bot
Automate LP position management — create, rebalance, and close positions based on market conditions using LP management endpoints.
On-Chain Analytics
Power analytics dashboards with historical pool, swap, and liquidity data from the Subgraph GraphQL API.
Cross-Chain Bridge UI
Build a bridge interface that quotes and executes cross-chain token transfers using the swap/bridge endpoints.
The Graph Protocol
Uniswap subgraphs are indexed and served by The Graph Protocol's decentralized network.
Ethereum
Primary deployment network for Uniswap v2, v3, and v4 smart contracts.
Polygon
Uniswap v3 deployed on Polygon PoS and zkEVM networks.
Arbitrum
Uniswap v3 deployed on Arbitrum One for low-cost swaps.
Optimism
Uniswap v3 deployed on Optimism for low-cost swaps.
Base
Uniswap v3 and v4 deployed on Base (Coinbase's L2 network).
UniswapX Fillers
Third-party filler bots compete to fill UniswapX gasless orders for best execution.
opencollection: 1.0.0
info:
name: Token Trading
version: 1.0.0
request:
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
items:
- info:
name: Approval
type: folder
items:
- info:
name: Check if token approval is required
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/check_approval
headers:
- name: x-permit2-disabled
value: ''
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Allows the requestor to check if the `walletAddress` has the required approval to transact the `token` up to the
`amount` specified. If the `walletAddress` does not have the required approval, the response will include a transaction
to approve the token spend. If the `walletAddress` has the required approval, the response will return the approval
with a `null` value. If the parameter `includeGasInfo` is set to `true` and an approval is needed, then the response
will include both the transaction '
- info:
name: Quote
type: folder
items:
- info:
name: Get a quote
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/quote
headers:
- name: x-universal-router-version
value: ''
- name: x-erc20eth-enabled
value: ''
- name: x-permit2-disabled
value: ''
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Requests a quote according to the specified swap parameters. This endpoint may be used to get a quote for a swap,
a bridge, or a wrap/unwrap. The resulting response includes a quote for the swap and the proposed route by which the
quote was achieved. The response will also include estimated gas fees for the proposed quote route. If the proposed
route is via a Uniswap Protocol pool, the response may include a permit2 message for the swapper to sign prior to making
a /swap request. The proposed ro
- info:
name: Order
type: folder
items:
- info:
name: Create a gasless order
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/order
headers:
- name: x-erc20eth-enabled
value: ''
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'The order endpoint is used to submit a UniswapX intent. If the `routing` field in the response to a quote is any
of `DUTCH_V2`, `DUTCH_V3`, `LIMIT_ORDER`, or `PRIORITY` this endpoint is used to submit your order to the UniswapX protocol
to be filled by the filler network. These orders are gasless because the filler will pay the gas to complete the transaction.
The order will be validated and, if valid, will be submitted to the filler network. The network will try to fill the
order at the quoted'
- info:
name: Get gasless orders
type: http
http:
method: GET
url: https://trade-api.gateway.uniswap.org/v1/orders
params:
- name: orderType
value: ''
type: query
description: The UniswapX order type to retrieve.
- name: orderId
value: ''
type: query
description: A transaction hash for an order. `orderId` or `orderIds` must be provided, but not both.
- name: orderIds
value: ''
type: query
description: A list of comma separated orderIds (transaction hashes). `orderId` or `orderIds` must be provided, but
not both.
- name: limit
value: ''
type: query
- name: orderStatus
value: ''
type: query
description: Filter by order status.
- name: swapper
value: ''
type: query
description: Filter by swapper address.
- name: sortKey
value: ''
type: query
description: Order the query results by the sort key.
- name: sort
value: ''
type: query
description: 'Sort query. For example: `sort=gt(UNIX_TIMESTAMP)`, `sort=between(1675872827, 1675872930)`, or `lt(1675872930)`.'
- name: filler
value: ''
type: query
description: Filter by filler address.
- name: cursor
value: ''
type: query
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Retrieve one or more gasless orders filtered, optionally filered by query param(s). The request must at minimum
include one of the following parameters: `orderId`, `orderIds`, `orderStatus`, `swapper`, or `filler`.'
- info:
name: Swap
type: folder
items:
- info:
name: Create swap calldata
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/swap
headers:
- name: x-universal-router-version
value: ''
- name: x-permit2-disabled
value: ''
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Create the calldata for a swap transaction (including wrap/unwrap) against the Uniswap Protocols. If the `quote`
parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates will be
**more precise** when the the response calldata would be valid if submitted on-chain.
- info:
name: Get swaps status
type: http
http:
method: GET
url: https://trade-api.gateway.uniswap.org/v1/swaps
params:
- name: txHashes
value: '0xc286f0adc6a9d6d26d6114df251d9b09d8bfafb2e00af5953193f6af92e110db'
type: query
description: On-chain transaction hashes. At least one of `txHashes` or `userOpHashes` must be provided.
- name: userOpHashes
value: '0xd47b609961a02483c9516d1f326244357e7e0b1d91569ebb4d119dff17e47330'
type: query
description: ERC-4337 UserOperation hashes. At least one of `txHashes` or `userOpHashes` must be provided.
- name: chainId
value: ''
type: query
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Get the status of swap or bridge transactions. Accepts on-chain transaction hashes (`txHashes`), ERC-4337 userOperation
hashes (`userOpHashes`), or both. At least one of the two must contain at least one item.
- info:
name: Create swap EIP 5792 calldata
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/swap_5792
headers:
- name: x-universal-router-version
value: ''
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Create the EIP 5792 calldata for a swap transaction (including wrap/unwrap and bridging) against the Uniswap Protocols.
If the `quote` parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates
will be **more precise** when the response calldata would be valid if submitted on-chain.
- info:
name: Create swap EIP 7702 calldata
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/swap_7702
headers:
- name: x-universal-router-version
value: ''
- name: x-erc20eth-enabled
value: ''
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Create the EIP 7702 calldata for a swap transaction (including wrap/unwrap and bridging) against the Uniswap Protocols.
If the `quote` parameter includes the fee parameters, then the calldata will include the fee disbursement. The gas estimates
will be **more precise** when the the response calldata would be valid if submitted on-chain.
Native ETH / UniswapX setup: When `x-erc20eth-enabled` is `true` and the input token is native ETH, the response may
include an additional native approval call '
- info:
name: Send
type: folder
items:
- info:
name: Create send calldata
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/send
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: This endpoint will generate a calldata for a send transaction based on the inputs. The calldata may be signed by
the `sender` to cause the specified `amount` of the `token` to be transfered from the `sender` to the `recipient`. The
successful response always includes estimated gas for the transaction.
- info:
name: SwappableTokens
type: folder
items:
- info:
name: Get bridgable tokens
type: http
http:
method: GET
url: https://trade-api.gateway.uniswap.org/v1/swappable_tokens
params:
- name: tokenIn
value: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
type: query
- name: tokenInChainId
value: '1'
type: query
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Returns the list of destination bridge chains for a given token on a given chain.
- info:
name: LimitOrderQuote
type: folder
items:
- info:
name: Get a limit order quote
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/limit_order_quote
body:
type: json
data: '{}'
docs: Get a quote for a limit order according to the provided configuration.
- info:
name: Liquidity
type: folder
items:
- info:
name: Check LP token approvals
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/lp/check_approval
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Checks whether the wallet has the required token approvals to perform an LP action (create, increase, decrease,
or migrate). Returns any needed approval transactions. If `simulateTransaction` is set to `true`, the response will
include gas fees for the approval transactions.
The `action` field specifies which LP operation the approval is for. Different actions may require different approvals
(e.g., V2 decrease requires approval of the LP token, V3 migrate requires approval of the V3 NFT).'
- info:
name: Create a V3 or V4 LP position
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/lp/create
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Creates a new LP position in a V3 or V4 pool (including full-range positions). You can create a position in an existing
pool by providing `existingPool` parameters, or create a new pool by providing `newPool` parameters (fee, tick spacing,
initial price, and optionally hooks for V4). The position's price range is specified via either `priceBounds` or `tickBounds`.
The server computes the dependent token amount. If `simulateTransaction` is set to `true`, the response will include
the gas fee.
- info:
name: Increase an LP position
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/lp/increase
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Increases liquidity in an existing position. Specify the independent token and amount; the server derives the dependent
token amount from the current pool state. Supports V2 (by token pair), V3, and V4 (by NFT token ID). If `simulateTransaction`
is set to `true`, the response will include the gas fee.
- info:
name: Decrease an LP position
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/lp/decrease
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Decreases liquidity in an existing position by a specified percentage. The server derives all position state (liquidity,
fees, ticks) from on-chain data. Supports V2 (by token pair), V3, and V4 (by NFT token ID). If `simulateTransaction`
is set to `true`, the response will include the gas fee.
- info:
name: Claim LP position fees
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/lp/claim_fees
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Claims accumulated trading fees from a V3 or V4 LP position. If `simulateTransaction` is set to `true`, the response
will include the gas fee for the claim transaction.
Note: V2 positions do not have claimable fees. V2 trading fees are automatically added to your LP token balance.'
- info:
name: Create a classic (V2) LP position
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/lp/create_classic
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Creates a full-range liquidity position in a Uniswap V2 pool. Specify the independent token and amount; the server
computes the dependent token amount based on the current pool ratio. If `simulateTransaction` is set to `true`, the
response will include the gas fee for the creation transaction.
- info:
name: Fetch Pool Information
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/lp/pool_info
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Fetches detailed information about one or more liquidity pools across Uniswap V2, V3, and V4. Returns pool state
including token addresses, reserves, liquidity, current tick, sqrtRatioX96, fee tier, tick spacing, and hook addresses
(V4).
Provide one of `poolParameters` or `poolReferences` (not both):
- `poolParameters`: Look up pools by token pair. Provide token addresses and optional fee/tickSpacing/hooks to find
matching pools.
- `poolReferences`: Look up specific known pools by their referen'
- info:
name: WalletEncode7702
type: folder
items:
- info:
name: Encode wallet transactions
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/wallet/encode_7702
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Encodes a list of transactions into a single transaction for smart contract wallet execution. All transactions must
have the same chainId.
- info:
name: WalletCheckDelegation
type: folder
items:
- info:
name: Get wallet delegation info
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/wallet/check_delegation
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Gets the current delegation status and message for a smart contract wallet across different chains. Returns delegation
information for each chain ID in the request.
- info:
name: Plan
type: folder
items:
- info:
name: Create an execution plan
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/plan
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Creates a multi-step execution plan for chained transactions. The plan breaks down complex multi-chain or multi-transaction
flows into sequential steps that can be executed by the client. Each step includes the method (transaction, message
signature, or batch calls), payload, and current status. The response includes the current step index to track progress
through the plan.
- info:
name: Get an execution plan
type: http
http:
method: GET
url: https://trade-api.gateway.uniswap.org/v1/plan/:planId
params:
- name: planId
value: ''
type: path
description: The unique identifier of the plan to retrieve.
- name: forceRefresh
value: ''
type: query
description: Whether to force refresh the plan status. Defaults to false. Completed plans cannot be refreshed.
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Retrieves an existing execution plan by its ID. Returns the full plan with current status and all steps. If forceRefresh
is set to true, the plan will be refreshed to check for any updates to step statuses. Note: Completed plans cannot be
refreshed.'
- info:
name: Default
type: folder
items:
- info:
name: Update an existing plan with step proofs
type: http
http:
method: PATCH
url: https://trade-api.gateway.uniswap.org/v1/plan/:planId
params:
- name: planId
value: ''
type: path
description: The unique identifier of the plan to update.
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: 'Updates an existing execution plan by submitting proof of completed plan steps (transaction hashes or signatures).
The endpoint retrieves the existing plan, attaches proofs to specified steps, verifies the proofs, and potentially regenerates
remaining steps if needed. Returns the full updated plan with current status. Note: Order IDs are not accepted in requests;
they are system-generated after receiving a signature.'
- info:
name: Wallet
type: folder
items:
- info:
name: Encode ERC-4337 UserOperation
type: http
http:
method: POST
url: https://trade-api.gateway.uniswap.org/v1/wallet/encode_4337
body:
type: json
data: '{}'
auth:
type: apikey
key: x-api-key
value: '{{x-api-key}}'
placement: header
docs: Builds and returns a fully-populated ERC-4337 v0.8 UserOperation for the given batch of calls. When a `paymasterUrl`
is provided the endpoint attempts gas sponsorship via the paymaster; the response indicates whether sponsorship was
granted and includes sponsor metadata when available.
bundled: true