Skip to main content
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.
When using repay with router routing strategy, you must specify the debt holder via onBehalfOf argument.
Enabling zap to repay debt requires two steps:
  • Suppose there’s USDC debt
  • route from arbitrary token (WETH) to the debt token (USDC)
  • repay debt using the swap output by using the dynamic amount reference (useOutputOfCallAt)