latestOpenAPI 3.0.02026-08-2232150173.9 KB

b70d36b7002b

shortcuts

Find optimal route between tokens (direct routes, zaps)

get/api/v1/shortcuts/route

Query parameters

chainIdnumber required

Chain ID of the network to execute the transaction on

fromAddressstring required

Ethereum address of the wallet to send the transaction from

routingStrategy'ensowallet-v2' | 'router' | 'delegate' | 'router-legacy' | 'delegate-legacy' nullable

Routing strategy to use

executionMode'user' | 'backend'

Controls how quote is built based on execution mode

toEoaboolean nullable

Flag that indicates if gained tokenOut should be sent to EOA

receiverstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the receiver of the tokenOut

spenderstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the spender of the tokenIn

refundReceiverstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the receiver of any dust tokens that might be produced during the execution of actions

amountInstring[] required

Amount of tokenIn to swap in wei

[
  "1000000000000000000"
]
minAmountOutstring[]

Minimum amount out in wei. If specified, slippage should not be specified

slippagestring
Example:300

Slippage in basis points (1/10000). e.g. 50 = 0.50%. If specified, minAmountOut should not be specified

feestring[]

Fee in basis points per amountIn. Use 1-100. All-zero fees are ignored. Collection is on the source chain unless a cross-chain route sets destinationFeeReceiver.

[
  "100"
]
feeReceiverstring
Example:0x220866B1A2219f40e72f5c628B65D54268cA3A9D

The Ethereum address that receives the source-chain fee and remains the fallback when destination collection does not apply. Required if fee is provided.

destinationFeeReceiverstring
Example:0x220866B1A2219f40e72f5c628B65D54268cA3A9D

Optional destination-chain fee receiver. For a cross-chain route with destination execution, the requested fee is collected atomically from the delivered bridge asset on the destination chain. Otherwise feeReceiver remains the source-chain receiver.

ignoreAggregatorsstring[] nullable

A list of swap aggregators to be ignored from consideration

ignoreStandardsstring[] nullable

A list of standards to be ignored from consideration

ignoreBridgesstring[]

A list of bridges to be ignored from consideration

crosschainRouteMode'direct' | 'source' | 'destination' | 'sourceOrDestination' | 'full'

Controls cross-chain route complexity. direct uses only a bridge, source allows routing before the bridge, destination allows routing after the bridge, sourceOrDestination allows routing on either chain but not both, and full allows routing on both chains

referralCodestring
Example:0123456789ABCDEF

Referral code that will be included in an on-chain event.

tokenInstring[] required

Ethereum address of the token to swap from. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

[
  "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
]
tokenOutstring[] required

Ethereum address of the token to swap to. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

[
  "0x6b175474e89094c44da98b954eedeac495271d0f"
]
destinationChainIdnumber

Chain ID of the network to bridge to and receive tokenOut

Response

gasstring required
blockNumbernumber

Block number the quote was simulated against

priceImpactnumber nullable

Price impact in basis points, null if USD price not found

feeAmountstring[]

An array of the fee amount collected for each tokenIn

ensoFeeAmountstring[]

An array of the enso fee amount collected for each tokenIn, when applicable

createdAtnumber required

Block number the transaction was created on

detailedRoutestring[]

Detailed description of the route

validUntilnumber

Unix timestamp (seconds) after which this quote expires. Transactions submitted after this time may revert.

Example response

{
  "metadata": {
    "bridgeRefundAssets": [
      {
        "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "recipient": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
        "symbol": "USDC"
      }
    ]
  },
  "route": [
    {
      "via": "cctp-forwarder"
    }
  ]
}