Skip to main content
GET
Optimal route between two tokens

Query Parameters

chainId
number
default:1

Chain ID of the network to execute the transaction on

fromAddress
string
required

Ethereum address of the wallet to send the transaction from

Example:

"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"

amountIn
string[]
required

Amount of tokenIn to swap in wei

Example:
tokenIn
string[]
required

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

Example:
tokenOut
string[]
required

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

Example:
routingStrategy
enum<string> | null

Routing strategy to use. in majority of cases you can use router. Use delegate with EOA when you want to specify a spender

Available options:
ensowallet,
router,
delegate,
router-legacy,
delegate-legacy
toEoa
boolean | null

Flag that indicates if gained tokenOut should be sent to EOA

receiver
string

Ethereum address of the receiver of the tokenOut

Example:

"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"

spender
string

Ethereum address of the spender of the tokenIn

Example:

"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"

minAmountOut
string[]

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

slippage
string
default:500

Slippage in basis points (1/10000), e.g. 50 = 0.50%. Takes precedence over minAmountOut.

Example:

"300"

fee
string[]

Fee in basis points (1/10000) for each amountIn value. Must be in range 1-100. By default the fee is collected from amountIn on the source chain. When destinationFeeReceiver is selected for destination execution, it is collected from the delivered bridge asset instead.

Example:
feeReceiver
string

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

Example:

"0x220866B1A2219f40e72f5c628B65D54268cA3A9D"

destinationFeeReceiver
string

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.

Example:

"0x220866B1A2219f40e72f5c628B65D54268cA3A9D"

ignoreAggregators
enum<string>[] | null

A list of swap aggregators to be ignored from consideration

Available options:
0x,
1inch,
openocean,
kyberswap,
native,
paraswap,
bebop,
barter,
sushiswap-router,
ooga-booga,
renegade,
uniswap,
rooster,
wowmax,
grapher,
hyperbloom,
hyperswap,
hyperflow,
fly,
eisen,
nordstern,
everlong,
bitget
ignoreStandards
string[] | null

A list of standards to be ignored from consideration

ignoreBridges
enum<string>[] | null

A list of bridges to be ignored from consideration for crosschain routes. Supported values: relay, stargate, ccip, cctp

Available options:
cctp,
stargate,
ccip,
relay
referralCode
string

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

Maximum string length: 16
Example:

"0123456789ABCDEF"

destinationChainId
number

Chain ID of the network to bridge to and receive tokenOut

crosschainRouteMode
enum<string>
default: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

Available options:
direct,
source,
destination,
sourceOrDestination,
full
refundReceiver
string

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

Example:

"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"

Response

gas
string
required
amountOut
string
required
priceImpact
number | null
required

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

feeAmount
string[]
required

An array of the fee amount collected for each tokenIn

minAmountOut
string
required

The minimum allowable amount out after slippage

createdAt
number
required

Block number the transaction was created on

tx
object
required

The tx object to use in ethers

route
object[]
required

The route the shortcut will use

ensoFeeAmount
string[]
required
metadata
object
required
transactionCost
string | null

Point-in-time lower-bound estimate of mandatory source-chain transaction fees in the native token smallest unit. Excludes priority fees, transaction value, bridge fees, and destination execution.

transactionCostUsd
string | null

Decimal string USD value of transactionCost. Null when the native-token price or source-chain fee estimate is unavailable.

preTransactions
object[]

Transactions that may need to be executed before the main shortcut transaction. Token approvals should be skipped when the current allowance is already sufficient.