Skip to content

FLO-3 panic if topUpSource deposit leaves position liquidatable#242

Open
holyfuchs wants to merge 1 commit intomainfrom
holyfuchs/FLO3-rebalancing-topupsource
Open

FLO-3 panic if topUpSource deposit leaves position liquidatable#242
holyfuchs wants to merge 1 commit intomainfrom
holyfuchs/FLO3-rebalancing-topupsource

Conversation

@holyfuchs
Copy link
Member

Closes: #212

Description

Fixes FLO-3. _rebalancePositionNoLock was depositing whatever it could pull from topUpSource without verifying the position was actually rescued. If the source was underfunded, the backup funds would end up in a still-liquidatable position and be seized.

After the deposit, we now assert health >= 1.0. If the position remains liquidatable the transaction panics and reverts, leaving the source funds untouched.

@holyfuchs holyfuchs requested a review from a team as a code owner March 6, 2026 11:19
@holyfuchs holyfuchs changed the title fix(rebalance): panic if topUpSource deposit leaves position liquidatable FLO-3 panic if topUpSource deposit leaves position liquidatable Mar 6, 2026
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-3: Automatic Rebalancing Drains topUpSource Even if the Position Remains Liquidatable

2 participants