Zap to repay debt from any position
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.repay
with router
routing strategy, you must specify the debt holder via onBehalfOf
argument.route
from arbitrary token (WETH) to the debt token (USDC)repay
debt using the swap output by using the dynamic amount reference (useOutputOfCallAt
)