When to Use This Pattern
Ensures liquidations only occur when positions are unhealthy, preventing unauthorized liquidations of healthy positions and protecting user funds. Critical for lending protocols (Aave, Compound, Morpho), margin trading platforms with position health monitoring, perpetual futures protocols with liquidation mechanisms, and any DeFi protocol using health factors for position solvency. Incorrect health factor validation could lead to unfair liquidations, protocol insolvency, or market manipulation through targeted liquidations.What This Pattern Checks
Implements multi-layered liquidation health factor verification:- Pre-liquidation:
forkPreTx()captures health factor before liquidation, verifies position is actually unhealthy - Post-liquidation:
forkPostTx()verifies health factor improves after liquidation - Parameter validation:
getCallInputs()monitors liquidation calls, validates seized assets and repaid shares are non-zero, enforces maximum liquidation amounts registerCallTrigger(): Triggers on liquidation function calls
Assertion Pattern
Full examples with tests available in the Phylax Assertion Examples Repository.

