maxLiqDiscount over auctionWindow. Liquidations are partial by default: the module repays only what restores targetHealth, and closes the book when the remaining debt would fall below dustDebt. Stockline checks regime, pause, and health before calling in.
LiquidationModule lets you:
- Preview the repay, seize, and discount of a liquidation before sending it
- Read the current auction discount for an account and book
- Settle a liquidation on behalf of Stockline (core only)
- Trigger a bad-debt write-off when a liquidation leaves an account with no collateral
The source code is
src/core/LiquidationModule.sol on GitHub. The ABI is /abis/LiquidationModule.json.
Write methods
liquidate
quote, then calls Stockline.applyLiquidation to cut debt and move collateral. If the account ends with debt but no collateral in any book, it calls Stockline.realizeBadDebt. Only Stockline can call it. Reverts with NothingToSeize when the quote has zero repay or zero seize.
The registry’s
liquidatorAllowlist flag is not enforced here. Anyone can liquidate through Stockline.Read methods
quote
repayAmount, the book’s debt, and the amount that restores target health, plus one wei on partials. If the remaining debt would be below dustDebt, the whole book debt is repaid. Seize is repay divided by the discounted price, capped at the account’s collateral. Reverts with ZeroAmount for a zero repayAmount and NothingToSeize when the discounted price rounds to 0.
Reads the oracle price, so it reverts with PriceUnavailable when the book is HALTED, in CA_WINDOW, or SEQ_DOWN. The protocol share is taken only from the bonus above fair value.
Return values
discountOf
liquidatableSince, then rises linearly to maxLiqDiscount at auctionWindow seconds. Reverts with InvalidAuctionWindow if the registry window is 0.
Input parameters
Return values