Skip to main content
LiquidationModule sizes and settles liquidations for Stockline. It runs a Dutch auction on the discount, starting at exactly 0 when an account first crosses the line and rising linearly to the book’s 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
Addresses per network. Every address is also on Addresses. The source code is src/core/LiquidationModule.sol on GitHub. The ABI is /abis/LiquidationModule.json.

Write methods

liquidate

Sizes the liquidation with 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.
Core only. Reverts with NotCore for any other caller. Call Stockline.liquidate instead.
The registry’s liquidatorAllowlist flag is not enforced here. Anyone can liquidate through Stockline.
Input parameters

Read methods

quote

Returns what a liquidation would do right now without executing it. The repay is the smallest of 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.
Input parameters Return values

discountOf

Returns the current Dutch auction discount for an account in a book. The discount is 0 until the block after liquidatableSince, then rises linearly to maxLiqDiscount at auctionWindow seconds. Reverts with InvalidAuctionWindow if the registry window is 0. Input parameters Return values

Events

Liquidated

Fires after a settled liquidation with the repay, both seize amounts, and the discount applied.

Errors

ZeroAddress

A constructor address was zero.

NotCore

Only Stockline can call liquidate.

ZeroAmount

The requested repay amount was zero.

InvalidAuctionWindow

The registry auction window is 0.

NothingToSeize

The quote produced no repay or no seize, or the discounted price rounded to 0.