-
Notifications
You must be signed in to change notification settings - Fork 2
Enforce liquidation pause and warmup period checks #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: jord/94-liquidation-integrate-dex
Are you sure you want to change the base?
Enforce liquidation pause and warmup period checks #118
Conversation
Add pause/warmup validation to manualLiquidation() by calling the existing _assertLiquidationsActive() function. Implement previously empty test stubs for pause and warmup scenarios, and add test helper functions and governance transaction for pause control. Changes: - Call _assertLiquidationsActive() in manualLiquidation() - Add pause_liquidations.cdc governance transaction - Implement testManualLiquidation_liquidationPaused() - Implement testManualLiquidation_liquidationWarmup() - Add pauseLiquidations() and getLiquidationParams() test helpers All 20 liquidation tests pass, including the 2 new tests. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Add pause/warmup validation to manualLiquidation() by calling the existing _assertLiquidationsActive() function. Implement previously empty test stubs for pause and warmup scenarios, and add test helper functions and governance transaction for pause control. Changes: - Call _assertLiquidationsActive() in manualLiquidation() - Add pause_liquidations.cdc governance transaction - Implement testManualLiquidation_liquidationPaused() - Implement testManualLiquidation_liquidationWarmup() - Add pauseLiquidations() and getLiquidationParams() test helpers All 20 liquidation tests pass, including the 2 new tests. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Apply liquidation bonus tolerance to manual liquidation DEX price comparison. Manual liquidators can now propose offers up to bonus% worse than DEX price, incentivizing manual liquidations when automated DEX liquidations are unavailable. Changes: - Modify DEX validation to use bonus-adjusted max seize amount - Add governance transaction for setting token liquidation bonus - Add test helper for configuring bonus in tests - Add 4 new tests covering bonus validation scenarios - Update existing test to maintain strict validation behavior All liquidation tests passing (24/24). Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
The testManualLiquidation_bonusZero_requiresStrictlyBetter test is equivalent to the existing testManualLiquidation_liquidatorOfferWorseThanDex test, which was updated to set bonus=0. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|
Converting to draft until liquidation bonus is removed per https://flow-foundation.slack.com/archives/C08QF29F7TK/p1769117611306279?thread_ts=1769039360.449179&cid=C08QF29F7TK. |
…n-pause-enforcement
| pre { | ||
| !self.liquidationsPaused: | ||
| "Liquidations paused" | ||
| !self.liquidationsPaused: "Liquidations paused" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really like assertions like this. I think it is better to have this function return a Boolean and then the calling function can check that and provide a more descriptive error message if it fails. This isn't critical, but just a suggestion
|
Thread on liquidation vs global pause: https://flow-foundation.slack.com/archives/C08QF29F7TK/p1769540691604539 |
This PR will likely be replaced by global pause mechanism -- see #126