Repay

Repay on Arcadia

Base
Base

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 the moment its account data reads it below a floor, coiling the amount from a swap or a withdrawal earlier in the run.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

More on Arcadia · 7

On other protocols · 9