Repay
Repay

Aave V4 · Acts onchain

Repays debt the wallet owes on an Aave V4 spoke, premium first and drawn principal after. The socket approves the giver position manager and hands it the amount; the giver settles it against the wallet's debt on the spoke, so the position that shrinks is the wallet's while the socket only does the paying. The wallet approves the giver as a position manager on the spoke once. Set the amount to all to close the debt: the program reads the wallet's whole debt, interest and risk premium included, at execution and repays the smaller of that and what the wallet holds of the asset. Reach for it when a predicate on the health factor or the borrow rate says the position should shrink, to unwind a loop after the collateral has been sold, or ahead of a withdrawal that the debt would otherwise block.

On other protocols · 5