[VEN-3321]: Liquidation Threshold and repay Improvements in Core Pool on BNB - #604
Open
Debugger022 wants to merge 122 commits into
Open
[VEN-3321]: Liquidation Threshold and repay Improvements in Core Pool on BNB#604Debugger022 wants to merge 122 commits into
Debugger022 wants to merge 122 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements the following features:-
[VEN-3321] - Add the concept of Liquidation Threshold to the core Pool on BNB.
[VEN-3322] - Dynamic Liquidation Incentive and Close Factor in core Pool on BNB.
[VEN-3323] - Define maximum Liquidation Incentive per seized asset in the core pool on BNB.
[VEN-233] - Repay logic improvisation
This pull request introduces significant enhancements and refactoring to the contracts, primarily to support dynamic liquidation incentives, improved health factor calculations, and integration with a new
LiquidationManagercontract. The changes include new interfaces and storage structures, updated function signatures, and expanded account health and liquidation logic.Liquidation and Account Health Enhancements
ComptrollerInterface.solto support dynamic liquidation incentives and close factor, health factor calculations, and detailed account snapshots, including overloaded methods for seize token calculations.LiquidationManager Integration
LiquidationManagercontract in both storage and interface files, and exposed its address via the Comptroller contract.Storage and Contract Refactoring
__oldCloseFactorMantissaSlot,maxLiquidationIncentiveMantissa) and moved toComptrollerV19Storage. Updated all relevant contract inheritance to use the new storage version. Also, removed the oldsetCloseFactorandsetLiquidationIncentivefunctions as they will now be calculated dynamically using theliquidationManager.Diamond Facet and Functionality Updates
FacetBaseandMarketFacetto use new health snapshot logic and ComptrollerLens integration, including new internal and external functions for health factor calculations and liquidation seize token calculations.Repay logic Improvisation
repayAmountcalculation in theVTokenfrom this to this:vars.repayAmount = repayAmount >= vars.accountBorrows ? vars.accountBorrows : repayAmount;