Skip to main content

What is the Enso Route API?

The Route API finds a path from a source asset or position into one destination and returns one signer-ready transaction.

J
Written by Javier Diaz

The Enso Route API finds a path from a source asset or position into one destination and returns one signer-ready transaction. Use it when Enso should choose the path — for a swap, a zap, a withdrawal, a migration, or a simple cross-chain route.

Definition

Route is the standalone POST /shortcuts/route endpoint. You specify the input, the destination, and protection such as slippage. Enso selects the path and returns a transaction your app can show and submit. It is not the same as the enso:route action used inside a Bundle request.

How it works

  1. Choose tokenIn, amountIn, and tokenOut (a token or a position token).

  2. Set the chain, and add destinationChainId only if the output is on another chain.

  3. Set slippage in basis points, or minAmountOut, but not both.

  4. Review expected output, minimum output, gas, price impact, and any approval.

  5. Submit required approvals, then the returned tx as-is.

How Enso does this

Call POST https://api.enso.build/api/v1/shortcuts/route with a Developer Portal key. See DeFi and Swap Routing and Get Started. If you need harvest, borrow, repay, checks, or a custom action order, use the Bundle API instead.

FAQ

Can Route land the user in a vault, not only a token?

Yes. Set tokenOut to the position token. That is a zap.

Is a cross-chain Route one atomic transaction?

No. Source confirmation and destination delivery are separate stages.

Related articles

  • What is the Enso Bundle API?

  • Route API vs Bundle API: which should I use?

  • How do I add a same-chain swap to my app?

  • How do I add cross-chain swaps to my app?

  • What is a zap in DeFi?

Sources

Did this answer your question?