Skip to main content
POST
/
swap_5792
Create swap EIP 5792 calldata
curl --request POST \
  --url https://trade-api.gateway.uniswap.org/v1/swap_5792 \
  --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": "v2-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>"
          },
          "reserve0": {
            "token": {
              "address": "<string>",
              "chainId": 1,
              "symbol": "ETH",
              "decimals": "<string>",
              "buyFeeBps": "<string>",
              "sellFeeBps": "<string>"
            },
            "quotient": "<string>"
          },
          "reserve1": {
            "token": {
              "address": "<string>",
              "chainId": 1,
              "symbol": "ETH",
              "decimals": "<string>",
              "buyFeeBps": "<string>",
              "sellFeeBps": "<string>"
            },
            "quotient": "<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>"
      }
    ]
  },
  "permitData": {
    "domain": {},
    "values": {},
    "types": {}
  },
  "deadline": 123,
  "urgency": "urgent"
}'
{
  "requestId": "<string>",
  "from": "<string>",
  "chainId": 1,
  "calls": [
    {
      "to": "<string>",
      "data": "<string>",
      "value": "<string>",
      "gasLimit": "<string>",
      "maxFeePerGas": "<string>",
      "maxPriorityFeePerGas": "<string>",
      "gasPrice": "<string>"
    }
  ],
  "gasFee": "<string>"
}

Authorizations

x-api-key
string
header
required

Headers

x-universal-router-version
enum<string>
default:1.2

The version of the Universal Router to use for the swap journey. MUST be consistent throughout the API calls.

Available options:
2.0

Body

application/json
quote
object
required
  • Classic Quote
  • Wrap/Unwrap Quote
  • Bridge Quote
permitData
object | null

the permit2 message object for the customer to sign to permit spending by the permit2 contract.

deadline
number

The unix timestamp at which the order will be reverted if not filled.

urgency
enum<string>
default:urgent

The urgency impacts the estimated gas price of the transaction. The higher the urgency, the higher the gas price, and the faster the transaction is likely to be selected from the mempool. The default value is urgent.

Available options:
normal,
fast,
urgent

Response

Create 5792 swap successful.

requestId
string
required

A unique ID for the request.

from
string
required
chainId
enum<number>
required

The unique ID of the blockchain. For a list of supported chains see the FAQ.

Available options:
1,
10,
56,
130,
137,
324,
480,
1868,
8453,
10143,
42161,
42220,
43114,
81457,
7777777,
1301,
84532,
11155111
calls
object[]
required
gasFee
string

The total estimated gas cost of this transaction (eg. gasLimit multiplied by maxFeePerGas) in the base unit of the chain.

I