Skip to content

FLO-23: attempt topUpSource rebalance before manual liquidation#250

Open
holyfuchs wants to merge 1 commit intomainfrom
holyfuchs/FLO-23-liquidation-rebalance
Open

FLO-23: attempt topUpSource rebalance before manual liquidation#250
holyfuchs wants to merge 1 commit intomainfrom
holyfuchs/FLO-23-liquidation-rebalance

Conversation

@holyfuchs
Copy link
Member

Closes: #232

Calls _rebalancePositionNoLock(force: true) at the start of manualLiquidation before evaluating position health. If the configured topUpSource has sufficient funds to restore health, the liquidation reverts, preventing third parties from liquidating positions that the user has properly secured.

@holyfuchs holyfuchs requested a review from a team as a code owner March 9, 2026 17:17
Copy link
Member

@jordanschalm jordanschalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this suggestion from the audit is a good idea.

It's important to let users add collateral or pay debt from their preferred source when possible, but I think attempting that here risks preventing liquidations from occurring smoothly. Calling into the top-up source during a liquidation involves executing user-provided code. What if the top-up source reads its position's health and panics if health<1?

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.

FLO-23: Manual Liquidations Bypass Configured Top-up Sources

2 participants