Borrow, repay, and similar lending actions are Bundle cases. Compose them as ordered actions, generally with the delegate routing strategy, so protocol state stays with the user’s account.
Definition
Lending operations that must keep debt or collateral state at the user’s address are not a single tokenIn to tokenOut Route. They are explicit Bundle actions.
How it works
Use Bundle when Get Started lists the need as harvest, borrow, repay, leverage, or claim.
Set
routingStrategytodelegatewhen execution must retain protocol state atfromAddress.Put
borroworrepayin the action list with the inputs required by that protocol’s action metadata.Chain amounts with
useOutputOfCallAtwhen a later repay, swap, or check depends on an earlier output.Submit
txunchanged after any requiredpreTransactions.
How Enso does this
The Route quick start says to use the Bundle API for actions such as harvest, borrow, and repay. Get Started assigns those use cases to Bundle, not Route. Routing Strategies notes that some actions that must retain state at the wallet, including borrow, harvest, and repay, require that execution model. Look up current argument names in the Actions reference.
FAQ
Can I borrow with the Route API?
No. Use POST https://api.enso.build/api/v1/shortcuts/bundle.
Why is delegate recommended?
Borrow and repay keep protocol state at the account. The delegate strategy uses fromAddress as the execution context so that state is not left on a shared router.
Related articles
How do I build a leverage or looping position in one transaction?
How do I use Enso with a smart wallet?
Router vs delegate routing strategies
When should I use the Bundle API instead of Route?
How do I use a flashloan in an Enso bundle?
