Skip to content

Conversation

@jordanschalm
Copy link
Member

@jordanschalm jordanschalm commented Jan 21, 2026

This PR will likely be replaced by global pause mechanism -- see #126

Extends #112 (review that PR first)

Description

This PR enforces liquidation pausing/warmup rules.

jordanschalm and others added 4 commits January 21, 2026 13:58
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]>
@jordanschalm jordanschalm marked this pull request as ready for review January 21, 2026 22:16
@jordanschalm jordanschalm requested a review from a team as a code owner January 21, 2026 22:16
jordanschalm and others added 3 commits January 21, 2026 16:39
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]>
@jordanschalm jordanschalm marked this pull request as draft January 22, 2026 22:10
@jordanschalm
Copy link
Member Author

@jordanschalm jordanschalm marked this pull request as ready for review January 23, 2026 21:48
pre {
!self.liquidationsPaused:
"Liquidations paused"
!self.liquidationsPaused: "Liquidations paused"
Copy link
Member

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

@jordanschalm
Copy link
Member Author

Thread on liquidation vs global pause: https://flow-foundation.slack.com/archives/C08QF29F7TK/p1769540691604539

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.

5 participants