Repay
Repay

Arcadia · Acts onchain

Repays an Arcadia Margin account's debt to the lending pool it borrowed from. Repayment is open to anyone on any account: the program's account reads the account's debt when the plug runs, approves the pool for the smaller of the amount and that debt, and calls repay, which pulls exactly that much and burns the matching debt; the action returns what it repaid, and nothing is left approved. The All option repays the whole debt, or as much of it as the program's account holds of the token; funded from the wallet, the program's account takes from the wallet the smaller of the debt and the wallet's balance, read when the plug runs, and nothing more. An account that owes nothing refuses the repayment. Reach for it to close or shrink a loan before withdrawing collateral, or to defend an account's health factor, coiling the amount from a swap or a withdrawal earlier in the run.

On other protocols · 9