Bundle routing with non-standard ways to interact with protocols Enso supports
enso:route
isn’t enough for protocols with unique function signatures (e.g., requiring a referral code as an argument), you can use the /bundle
endpoint.
By chaining actions like enso:route
and enso:call
, you can combine optimal routing with custom contract calls.
USDT
for STAKED_HYPE
, and then deposit it for LHYPE
, through a contract whose deposit
function requires a custom communityCode
argument.
USDT
, which is a required first step to grant the router permission for the swap.
enso:route
. The router swaps USDT
for STAKED_HYPE
. The receiver
is critically set to the ENSO_ROUTER
itself so it can hold the tokens for the next steps.
erc20:approve
. The Enso Router approves the final HYPE_DEPOSITOR
contract, using { useOutputOfCallAt: 1 }
to dynamically set the approval amount to the exact output from the previous swap.
enso:call
. The router calls the final deposit
function, passing the dynamic swap amount (again with { useOutputOfCallAt: 1 }
), the user’s address as the recipient, and the required static communityCode
.
Updated