Repay variable-rate USDC debt directly on the lending market.
Goal: Repay outstanding variable-rate USDC debt.
Preconditions: USDC approval to LendingMarket.
repay(marketParamsUSDC, assets, shares, onBehalf, data)
For asset-based repay: set assets = usdcToRepay, shares = 0, onBehalf = user, data = ""
assets = usdcToRepay
shares = 0
onBehalf = user
data = ""
To repay max via shares: set shares to the user's borrow shares and assets = 0
shares
assets = 0
Views
LendingMarket.getUserPosition(marketParamsUSDC, user) (pre/post) → borrowAssets
LendingMarket.getUserPosition(marketParamsUSDC, user)
borrowAssets
LendingMarket.market(idUSDC) → totalBorrowAssets (consider accrueInterest(marketParamsUSDC) before reading)
LendingMarket.market(idUSDC)
totalBorrowAssets
accrueInterest(marketParamsUSDC)
LendingMarket.position(idUSDC, user) (optional)
LendingMarket.position(idUSDC, user)
Events
EventsLib.Repay (assets, shares)
EventsLib.Repay
EventsLib.AccrueInterest (optional, if triggered)
EventsLib.AccrueInterest
Last updated 16 days ago