---
title: "Optimal route between two tokens"
method: GET
path: "/api/v1/shortcuts/route"
tags: ["DeFi Shortcuts"]
---

# Optimal route between two tokens

`GET /api/v1/shortcuts/route`

Calculates optimal transaction with the best route between two tokens, which may involve several actions that interact with various DeFi protocols. This single call already quotes internally and returns executable calldata along with `amountOut` and `gas`, so there is no separate quote step to call beforehand. <Tip>To enter a non-tokenized position, use GET&nbsp;`shortcuts/route/nontokenized`.</Tip>

## Query parameters

- `chainId` number
- `fromAddress` string, required
- `amountIn` string[], required
- `tokenIn` string[], required
- `tokenOut` string[], required
- `routingStrategy` 'ensowallet' | 'router' | 'delegate' | 'router-legacy' | 'delegate-legacy', nullable
- `toEoa` boolean, nullable
- `receiver` string
- `spender` string
- `minAmountOut` string[]
- `slippage` string
- `fee` string[]
- `feeReceiver` string
- `ignoreAggregators` string[], nullable
- `ignoreStandards` string[], nullable
- `ignoreBridges` string[], nullable
- `referralCode` string
- `destinationChainId` number
- `refundReceiver` string

## Response `200`

- RouteShortcutTransaction
  - `gas` string, required
  - `amountOut` string, required
  - `priceImpact` number, nullable, 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` Transaction, required
    - `data` string, required
    - `to` string, required
    - `from` string, required
    - `value` string, required
  - `route` Hop[], required — The route the shortcut will use
    - `tokenIn` string[], required
    - `tokenOut` string[], required
    - `protocol` string, required
    - `action` string, required
    - `primary` string, required
    - `internalRoutes` string[], required
    - `args` object, required
    - `chainId` number
    - `sourceChainId` number
    - `destinationChainId` number
  - `ensoFeeAmount` string[], required

## Other responses

- `400`

---

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