shortcuts

Find optimal route between tokens (direct routes, zaps)

Changed on
get/api/v1/shortcuts/route

Request

  • Base URL
    https://api.enso.finance
  • URL
    https://api.enso.finance/api/v1/shortcuts/route
  • Auth
    HTTP bearer

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

includeTransactionCostboolean

Include point-in-time source-chain transaction cost estimates in native units and USD, plus USD values for reported bridge fees

useIntentAddressboolean

Route a cross-chain request through an intent address on the destination chain. The bridge delivers to that address, then a keeper runs the destination route and sends tokenOut to the receiver. When omitted, intents are used if both chains support them. Set to false to use a bridge callback instead. Ignored for same-chain routes.

spenderstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the spender of the tokenIn

refundReceiverstring
Example:0xd8da6bf26964af9d7eed9e03e53415d37aa96045

Ethereum address of the receiver of any dust tokens produced during execution. Required for routes to Solana.

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

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

effort'light' | 'medium' | 'high' | 'max'

Latency/quality trade-off for pathfinding and aggregator querying. light returns fastest over a reduced search space (short aggregator wait with early return once two usable quotes arrive, fewer candidate paths, no destination-side bridge routing), medium waits the full short window over the full search space, high is the default balanced behavior, and max queries all aggregators in parallel with an extended wait for best execution (higher CU cost)

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

Destination token addresses. Solana mints are case-sensitive; native SOL uses 11111111111111111111111111111111.

receiverstring

Destination recipient. Required for cross-chain routes; Solana uses a case-sensitive Base58 address.

destinationChainIdnumber

Chain ID of the network to bridge to and receive tokenOut

allowAsyncboolean

Allow async redeems, where tokenOut is paid after the transaction. An async route returns amountOut, minAmountOut and priceImpact as null and describes the payout in async. Cannot be combined with minAmountOut or useIntentAddress, intents do not support async redeems.

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. On an intent route a late transaction still bridges, but the bridged token is refunded on the destination chain instead of being swapped.

transactionCoststring nullable

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.

transactionCostUsdstring nullable

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

Example response

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

Changes

    • warning

      added the new mayan enum value to the /// response property for the response status

    • info

      added the enum value mayan to the property items/ of the query request parameter ignoreBridges

    • info

      added the new optional query request parameter effort