v1

latestOpenAPI 3.0.02026-07-142115792.8 KB
Swap

Create swap EIP 5792 calldata

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.

post/swap_5792

Headers

x-universal-router-version'1.2' | '2.0'

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

Request body

deadlinenumber

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

urgency'normal' | 'fast' | '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.

Example request

{
  "quote": {
    "route": [
      [
        {
          "tokenIn": {
            "symbol": "ETH"
          },
          "tokenOut": {
            "symbol": "ETH"
          }
        }
      ]
    ]
  }
}

Response

Create 5792 swap successful.

requestIdstring required

A unique ID for the request.

fromstring required
chainId1 | 10 | 56 | 130 | 137 | 324 | 480 | 1868 | 8453 | 10143 | 42161 | 42220 | 43114 | 81457 | 7777777 | 1301 | 84532 | 11155111 | 143 | 196 required

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

gasFeestring

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