---
title: "Find optimal route between tokens (direct routes, zaps)"
method: POST
path: "/api/v1/shortcuts/route"
tags: ["shortcuts"]
---

# Find optimal route between tokens (direct routes, zaps)

`POST /api/v1/shortcuts/route`

## Request body

- RouteShortcutVariableInputs
  - `chainId` number, required — Chain ID of the network to execute the transaction on
  - `fromAddress` string, 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
  - `toEoa` boolean, nullable — Flag that indicates if gained tokenOut should be sent to EOA
  - `receiver` string — Ethereum address of the receiver of the tokenOut
  - `spender` string — Ethereum address of the spender of the tokenIn
  - `refundReceiver` string — Ethereum address of the receiver of any dust tokens that might be produced during the execution of actions
  - `amountIn` string[], required — Amount of tokenIn to swap in wei
  - `minAmountOut` string[] — Minimum amount out in wei. If specified, slippage should not be specified
  - `slippage` string — Slippage in basis points (1/10000). e.g. 50 = 0.50%. If specified, minAmountOut should not be specified
  - `fee` string[] — 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.
  - `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.
  - `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.
  - `ignoreAggregators` string[], nullable — A list of swap aggregators to be ignored from consideration
  - `ignoreStandards` string[], nullable — A list of standards to be ignored from consideration
  - `ignoreBridges` string[] — 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
  - `referralCode` string — Referral code that will be included in an on-chain event.
  - `tokenIn` string[], required — Ethereum address of the token to swap from. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
  - `tokenOut` string[], required — Ethereum address of the token to swap to. For ETH, use 0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
  - `destinationChainId` number — Chain ID of the network to bridge to and receive tokenOut

## Response `200`

- RouteShortcutTransaction
  - `gas` string, required
  - `amountOut` union, required
    - string
    - string[]
  - `blockNumber` number — Block number the quote was simulated against
  - `priceImpact` number, nullable — Price impact in basis points, null if USD price not found
  - `feeAmount` string[] — An array of the fee amount collected for each tokenIn
  - `ensoFeeAmount` string[] — An array of the enso fee amount collected for each tokenIn, when applicable
  - `metadata` ShortcutResponseMetadata, required
    - `bridgeRefundAssets` BridgeRefundAsset[], required — Protocol-specific refund destinations for bridge principal in the returned transaction. An entry does not guarantee that every bridge failure is refundable.
      - `protocol` 'cctp' | 'stargate' | 'ccip' | 'relay', required
      - `chainId` number, required
      - `token` string, required — Address of the bridge principal token that may be refunded
      - `recipient` string, required — Address that would receive the bridge principal refund
      - `symbol` string — Token symbol when metadata is available
  - `minAmountOut` union — The minimum allowable amount out after slippage
    - string
    - string[]
  - `createdAt` number, required — Block number the transaction was created on
  - `tx` Transaction, required
    - `data` string, required
    - `to` string, required
    - `from` string, required
    - `value` string, required
  - `route` Hop[], required — Simple description of meta actions the route takes
    - `tokenIn` string[], required
    - `tokenOut` string[], required
    - `protocol` string, required
    - `action` 'approve' | 'borrow' | 'borrowwithpositionid' | 'bridge' | 'deposit' | 'singledeposit' | 'singledepositwithpositionid' | 'multideposit' | 'multidepositwithpositionid' | 'tokenizedsingledeposit' | 'tokenizedmultideposit' | 'multioutsingledeposit' | 'depositclmm' | 'depositwithestimate' | 'encodedswap' | 'flashloan' | 'singletokenflashloan' | 'multitokenflashloan' | 'harvest' | 'nftborrow' | 'nftdeposit' | 'nftmultideposit' | 'nftmultiredeem' | 'nftredeem' | 'nftrepay' | 'permittransferfrom' | 'redeem' | 'singleredeem' | 'singleredeemwithpositionid' | 'multiredeem' | 'tokenizedsingleredeem' | 'tokenizedmultiredeem' | 'redeemclmm' | 'redeemwithestimate' | 'repay' | 'repaywithpositionid' | 'swap' | 'transfer' | 'transferfrom' | 'withdraw' | 'singlewithdraw' | 'singlewithdrawwithpositionid' | 'multiwithdraw' | 'route' | 'call' | 'split' | 'merge' | 'ondosplit' | 'ondomerge' | 'balance' | 'minamountout' | 'slippage' | 'fee' | 'ensofee' | 'paymasterfee' | 'depositposition' | 'add' | 'sub' | 'mul' | 'div' | 'min' | 'max' | 'isequal' | 'islessthan' | 'isequalorlessthan' | 'isgreaterthan' | 'isequalorgreaterthan' | 'not' | 'check' | 'toggle', required
    - `primaryAddress` string
    - `internalRoutes` string[]
    - `args` object
    - `sources` string[]
    - `poolAddresses` string[]
    - `estimatedAmountOut` string[] — Only available for split actions returned by the pathfinder routing engine. Display estimates use the planned split input, are ordered to match tokenOut, and are not execution guarantees
    - `chainId` number
    - `sourceChainId` number
    - `destinationChainId` number
    - `positionOut` string[] — Non-tokenized position ID for deposit actions
    - `via` 'cctp-forwarder' — Off-chain settler for this hop. Set when the hop is descriptive metadata rather than a weiroll call in `tx.data` — execution happens asynchronously via the named external system (e.g. Circle's CctpForwarder credits HyperCore on CCTP message receipt). Absent on hops that are actual on-chain weiroll calls.
  - `detailedRoute` string[] — Detailed description of the route
  - `userOp` UserOperation
    - `callData` string, required
    - `callGasLimit` string, required
    - `factory` string
    - `factoryData` string
    - `maxFeePerGas` string, required
    - `maxPriorityFeePerGas` string, required
    - `nonce` string, required
    - `paymaster` string
    - `paymasterData` string
    - `paymasterPostOpGasLimit` string
    - `paymasterVerificationGasLimit` string
    - `preVerificationGas` string, required
    - `sender` string, required
    - `signature` string, required
    - `verificationGasLimit` string, required
  - `bridgingEstimates` BridgeLatencyEstimate[] — Estimated bridging durations when applicable
    - `fromChainId` number, required
    - `toChainId` number, required
    - `token` string, required — Token bridged to the destination chain
    - `estimatedSeconds` number, required — Estimated bridge latency in seconds
    - `sendConfirmations` number — Send confirmations used for the estimation
    - `receiveConfirmations` number — Receive confirmations
    - `sendBlockTimeSeconds` number — Average block time assumed for the source chain (seconds)
    - `receiveBlockTimeSeconds` number — Average block time assumed for the destination chain (seconds)
    - `bridge` string — Bridge implementation or provider that produced the estimate
    - `source` 'defaults' | 'override' | 'fallback' — Source of the data (defaults, override, fallback)
    - `note` string — Optional note describing overrides or fallbacks applied
  - `validUntil` number — Unix timestamp (seconds) after which this quote expires. Transactions submitted after this time may revert.

## Other responses

- `400`

---

[API](https://skmtc.net/enso/apis/untitled-api.md) · [All operations](https://skmtc.net/enso/apis/untitled-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/enso/untitled-api/revisions/b70d36b7002b/schema)
