Note on Approvals: When using
routingStrategy
: router
, you must first approve the Enso contract to spend your tokens.
The code samples below include the necessary client.getApprovalData()
step, which generates the required approval transaction
to be signed before the main routing transaction.redeem
a part of exisingWETH
collateral for theaWETH
positionroute
to swap the redeemed collateral (WETH) to a different position (WBTC)deposit
the swapped position (WBTC) as collateral for the existing debt