allow immediate withdrawals via withdrawCollateral in multicall
introduce safe collateral check (all the same but uses more strict pricing strategy when evaluating collateral), activate it after immediate withdrawals or if account has enabled forbidden tokens
closeCreditAccount now requires account owner to repay debt via decreaseDebt and withdraw remaining funds via withdrawCollateral, the function exists primarily to return account to the factory
liquidateCreditAccount is reworked:
account remains open after liquidation with remaining funds
all transfers to/from liquidator are removed in favour of addCollateral and withdrawCollateral
liquidator now has a choice over tokens that would cover funds due to borrower (that prevents borrower from protecting against liquidation by having huge amount of illiquid token with $\mathrm{LT} = 0$ or above quota that liquidator must swap into underying in order to cover min remaining funds)
added externalCall and approveToken (currently without entry-points in the facade)
add collateralHints validation in fullCollateralCheck
BotListV3:
remove payments completely as now they can be performed via withdrawCollateral
bot's forbidden status is now global instead of per-manager
PriceOracleV3:
add safeConvertToUSD that for untrusted feeds uses minimum price of main and reserve feeds
WithdrawalManagerV3:
deprecated completely:
scheduled withdrawals removed in favour of withdrawCollateral
immediate withdrawals are no longer needed as blacklisted underlying can no longer block liquidation
In this PR:
CreditManagerV3
,CreditFacadeV3
:withdrawCollateral
in multicallcloseCreditAccount
now requires account owner to repay debt viadecreaseDebt
and withdraw remaining funds viawithdrawCollateral
, the function exists primarily to return account to the factoryliquidateCreditAccount
is reworked:addCollateral
andwithdrawCollateral
externalCall
andapproveToken
(currently without entry-points in the facade)collateralHints
validation infullCollateralCheck
BotListV3
:withdrawCollateral
forbidden
status is now global instead of per-managerPriceOracleV3
:safeConvertToUSD
that for untrusted feeds uses minimum price of main and reserve feedsWithdrawalManagerV3
:withdrawCollateral