Skip to content

Wip partial#242

Open
VladyslavBudiukWOOF wants to merge 130 commits into
mainfrom
wip-partial
Open

Wip partial#242
VladyslavBudiukWOOF wants to merge 130 commits into
mainfrom
wip-partial

Conversation

@VladyslavBudiukWOOF
Copy link
Copy Markdown
Collaborator

No description provided.

…ebtRemainingValue decrement

Track remaining debt directly instead of accumulating seized value, moving the baseBorrowMin check post-seizure to avoid a two-step rounding cascade.
Simplify the main seizure branch and add an early break when debt is fully repaid.
vlad-woof-software and others added 23 commits April 15, 2026 10:43
…ationState struct

Move per-asset seizure logic into a dedicated `_absorbCollateral` internal function.
Replace ad-hoc loop variables with a `LiquidationState` struct (debtRemainingValue,
isHealthy, isFullDebtClosure) threaded across iterations. Add isFullDebtClosure mode
to handle dust debt that spans multiple collateral assets. Fix repayAndSupplyAmount
call to use the correct pre-update oldPrincipal.
…ng ones

Added new test scenarios for partial liquidation logic. Updated legacy tests to use
realistic collateral factor defaults. Temporarily skipped tests that are currently
failing — will be fixed in follow-up commits.
…terals to cover the debt, but full siezure becomes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants