Skip to main content
GET
/
api
/
v1
/
shortcuts
/
quote
Quote from a token to another
curl --request GET \
  --url https://api.enso.build/api/v1/shortcuts/quote
{
  "amountOut": "<string>",
  "route": [
    {
      "tokenIn": [
        "<string>"
      ],
      "tokenOut": [
        "<string>"
      ],
      "protocol": "<string>",
      "action": "<string>",
      "primary": "<string>",
      "internalRoutes": [
        "<string>"
      ],
      "args": {},
      "chainId": 123,
      "sourceChainId": 123,
      "destinationChainId": 123
    }
  ],
  "priceImpact": 123,
  "feeAmount": [
    "<string>"
  ],
  "ensoFeeAmount": [
    "<string>"
  ]
}

Query Parameters

chainId
number
default:1

Chain ID of the network to execute the quote on

fromAddress
string

Ethereum address of the wallet to quote from

Example:

"0xd8da6bf26964af9d7eed9e03e53415d37aa96045"

tokenIn
string[]
required

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

Example:
[
"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
]
tokenOut
string[]
required

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

Example:
[
"0x6b175474e89094c44da98b954eedeac495271d0f"
]
amountIn
string[]
required

Amount of tokenIn to swap in wei

Example:
["1000000000000000000"]
routingStrategy
enum<string> | null

Routing strategy to use

Available options:
ensowallet-v2,
router,
delegate,
router-legacy,
delegate-legacy
fee
string[]

Fee in basis points (1/10000) for each amountIn value. Must be in range 0-100. If specified, this percentage of each amountIn value will be sent to feeReceiver

Example:
["100"]
feeReceiver
string

The Ethereum address that will receive the collected fee. Required if fee is provided

Example:

"0x220866B1A2219f40e72f5c628B65D54268cA3A9D"

ignoreAggregators
string[] | null

A list of swap aggregators to be ignored from consideration

ignoreStandards
string[] | null

A list of standards to be ignored from consideration

Response

amountOut
string
required
route
object[]
required

The route selected for the quote

priceImpact
number | null

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[]