In this track: Advanced security reasoning
Liquidation edge cases
Price, collateral and rounding boundaries jointly determine eligibility.
A safety threshold must handle values immediately on either side of the line.
1 ETH = 1000000000 Gwei = 1000000000000000000 Wei.
Write the eligibility formula
Identify collateral valuation, debt valuation and the liquidation threshold with their units. A variable name alone does not establish the exact inequality.
Check boundary rounding
Integer rounding can move an account across a threshold or alter the amount seized. Test values just below, at and just above the defined boundary.
Include oracle and asset assumptions
Stale prices, decimal mismatches and unusual token behavior can invalidate an otherwise plausible formula. Keep those assumptions in the local model.
Test partial and repeated actions
Partial liquidation, fees and remaining dust can affect later eligibility and solvency. Verify the invariant after a sequence, not just one full liquidation.
Work through the boundary
toy eligibility: debt value > allowed collateral value
check debt = limit - 1, limit, limit + 1
then test partial liquidation and roundingA simplified local review scenario. The example establishes a question to test, not a guarantee of production safety.
Are exact-threshold tests useful even if typical cases pass?
Rounding and comparison choices matter at the boundary.
Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.