What this does
This plug unwinds an Aave position by flash-borrowing repay_amount of borrow_token to repay outstanding debt, then withdrawing withdraw_amount of supply_token and routing it through the solver. It asks the caller for repay_amount, borrow_token, aave_market, withdraw_amount, and supply_token. It fires only when the borrow_token produced by routing is greater than or equal to the flash loan repayment obligation saved as unwind_loan_owed, reverting otherwise. Doing this by hand or on a stale balance risks a routing return that fails to cover the loan owed, aborting the transaction.
Actions · 14














Related plugs · 8