Skip to main content

What is useOutputOfCallAt?

useOutputOfCallAt tells a later Bundle action to consume the output of an earlier action instead of a fixed amount. References are zero-based and must point backward.

J
Written by Javier Diaz

useOutputOfCallAt tells a later Bundle action to use the output of an earlier action instead of a hardcoded amount. That is how you chain a swap into a deposit, or a deposit into a check, without guessing the intermediate size.

Definition

A Bundle is an ordered list of actions. When the exact output of step 0 is not known at request time, step 1 can reference that output dynamically.

How it works

  • Set an amount field to { "useOutputOfCallAt": 0 } to consume the output of the first action (zero-based).

  • If that action returns an array, select an item with index, for example { "useOutputOfCallAt": 0, "index": 1 }.

  • References must point to an earlier output. A missing or future reference fails during bundle construction.

  • Some check actions do not expose a normal consumable output. Consult the action output table before chaining them.

How Enso does this

The Bundle API documents this reference object and shows it on later amountIn or amountOut fields, including the Enso slippage check. See also the Bundle Actions Reference.

FAQ

Can I reference a later action?

No. References are resolved against outputs already built. They must point at an earlier step.

Do I still set slippage on the first action?

You can set slippage on a route action and also add an enso slippage action on a later output. Follow the Actions reference for the check you need.

Related articles

  • How do I chain bundle actions together?

  • How do I add checks or slippage guards inside a bundle?

  • How do I bundle multiple DeFi actions into one transaction?

  • What is the Enso Bundle API?

  • What is a same-chain bundle?

Sources

Did this answer your question?