Swapping Endpoints
- POSTCheck Approval
- POSTQuote
- POSTLimit Quote
- UniswapX Swapping
- Protocol Swapping
Liquidity Provisioning Endpoints
Reference Data Endpoints
Protocol Swapping
Crate Delegated Swap
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.
POST
/
swap_7702
curl --request POST \
--url https://trade-api.gateway.uniswap.org/v1/swap_7702 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"quote": {
"input": {
"token": "<string>",
"amount": "<string>"
},
"output": {
"token": "<string>",
"amount": "<string>",
"recipient": "<string>"
},
"swapper": "<string>",
"chainId": 1,
"slippage": 123,
"tradeType": "EXACT_INPUT",
"gasFee": "<string>",
"gasFeeUSD": "<string>",
"gasFeeQuote": "<string>",
"route": [
[
{
"type": "v3-pool",
"address": "<string>",
"tokenIn": {
"address": "<string>",
"chainId": 1,
"symbol": "ETH",
"decimals": "<string>",
"buyFeeBps": "<string>",
"sellFeeBps": "<string>"
},
"tokenOut": {
"address": "<string>",
"chainId": 1,
"symbol": "ETH",
"decimals": "<string>",
"buyFeeBps": "<string>",
"sellFeeBps": "<string>"
},
"sqrtRatioX96": "<string>",
"liquidity": "<string>",
"tickCurrent": "<string>",
"fee": "<string>",
"amountIn": "<string>",
"amountOut": "<string>"
}
]
],
"portionBips": 123,
"portionAmount": "<string>",
"portionRecipient": "<string>",
"routeString": "<string>",
"quoteId": "<string>",
"gasUseEstimate": "<string>",
"blockNumber": "<string>",
"gasPrice": "<string>",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"txFailureReasons": [
"SIMULATION_ERROR"
],
"priceImpact": 123,
"aggregatedOutputs": [
{
"token": "<string>",
"amount": "<string>",
"recipient": "<string>",
"bps": 123,
"minAmount": "<string>"
}
]
},
"smartContractDelegationAddress": "<string>",
"includeGasInfo": false,
"deadline": 123,
"urgency": "urgent"
}'
{
"requestId": "<string>",
"swap": {
"to": "<string>",
"from": "<string>",
"data": "<string>",
"value": "<string>",
"gasLimit": "<string>",
"chainId": 1,
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"gasPrice": "<string>"
},
"gasFee": "<string>"
}
Authorizations
Headers
The version of the Universal Router to use for the swap journey. MUST be consistent throughout the API calls.
Available options:
1.2
, 2.0
Body
application/json
Response
200
application/json
Create 7702 swap successful.
The response is of type object
.
curl --request POST \
--url https://trade-api.gateway.uniswap.org/v1/swap_7702 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"quote": {
"input": {
"token": "<string>",
"amount": "<string>"
},
"output": {
"token": "<string>",
"amount": "<string>",
"recipient": "<string>"
},
"swapper": "<string>",
"chainId": 1,
"slippage": 123,
"tradeType": "EXACT_INPUT",
"gasFee": "<string>",
"gasFeeUSD": "<string>",
"gasFeeQuote": "<string>",
"route": [
[
{
"type": "v3-pool",
"address": "<string>",
"tokenIn": {
"address": "<string>",
"chainId": 1,
"symbol": "ETH",
"decimals": "<string>",
"buyFeeBps": "<string>",
"sellFeeBps": "<string>"
},
"tokenOut": {
"address": "<string>",
"chainId": 1,
"symbol": "ETH",
"decimals": "<string>",
"buyFeeBps": "<string>",
"sellFeeBps": "<string>"
},
"sqrtRatioX96": "<string>",
"liquidity": "<string>",
"tickCurrent": "<string>",
"fee": "<string>",
"amountIn": "<string>",
"amountOut": "<string>"
}
]
],
"portionBips": 123,
"portionAmount": "<string>",
"portionRecipient": "<string>",
"routeString": "<string>",
"quoteId": "<string>",
"gasUseEstimate": "<string>",
"blockNumber": "<string>",
"gasPrice": "<string>",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"txFailureReasons": [
"SIMULATION_ERROR"
],
"priceImpact": 123,
"aggregatedOutputs": [
{
"token": "<string>",
"amount": "<string>",
"recipient": "<string>",
"bps": 123,
"minAmount": "<string>"
}
]
},
"smartContractDelegationAddress": "<string>",
"includeGasInfo": false,
"deadline": 123,
"urgency": "urgent"
}'
{
"requestId": "<string>",
"swap": {
"to": "<string>",
"from": "<string>",
"data": "<string>",
"value": "<string>",
"gasLimit": "<string>",
"chainId": 1,
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"gasPrice": "<string>"
},
"gasFee": "<string>"
}
Assistant
Responses are generated using AI and may contain mistakes.