What this does
This plug unwinds an Aave position by flash-borrowing borrow_token to repay debt, withdrawing supply_token collateral, and routing that collateral through the solver to cover the flash loan. It asks the caller for repay_amount, borrow_token, aave_market, withdraw_amount, and supply_token. It fires when the borrow_token gain from routing is greater than or equal to the flash loan repayment obligation saved as unwind_loan_owed, and aborts otherwise. Sequencing the flash loan, repay, withdraw, and route by hand, or on a stale balance, risks a revert or leaving the loan uncovered.
Actions · 14














Related plugs · 8