> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mystockline.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Liquidations

> The auction, partial closes, and the allowlist.

If health is below 1, keepers repay USDG and receive stock at a rising discount.

Call `Stockline.liquidate`. The core gates regime and pause, then `LiquidationModule` sizes the seize.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/concepts/liquidation-auction-light.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=a56db20cb82e9457664e91b1578f73e2" alt="Discount starts at zero and rises to the book cap over the auction window, then stays at the cap." width="1200" height="420" data-path="assets/diagrams/concepts/liquidation-auction-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/concepts/liquidation-auction-dark.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=b3621e05fff6754dcc0229a61ad86583" alt="Discount starts at zero and rises to the book cap over the auction window, then stays at the cap." width="1200" height="420" data-path="assets/diagrams/concepts/liquidation-auction-dark.svg" />
</Frame>

<Info>
  Many crypto lending markets use a fixed bonus and a permissionless race. Stock tokens have thin onchain exit. Stockline ramps a Dutch auction, seizes the minimum, and stores an allowlist flag. The module does not enforce that flag today.
</Info>

`Stockline.liquidate` accrues the account, requires LIVE or DARK, requires not paused, and reverts `NotLiquidatable` if healthy. The first unhealthy block stores `liquidatableSince`.

`discountOf` is a linear ramp from 0 to `maxLiqDiscount(book)` over `auctionWindow` ([2 hours](/resources/parameters)). ARCHITECTURE.md says from near zero. The code starts at exactly zero until one second has elapsed.

Tier caps: A [5%](/resources/parameters), B [6%](/resources/parameters), C [8%](/resources/parameters).

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/concepts/partial-close-light.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=bcc046892f3bffc5318a0c044cd8225d" alt="A partial close sells only enough stock to put health back on the target line, unless dust remains." width="1200" height="440" data-path="assets/diagrams/concepts/partial-close-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/concepts/partial-close-dark.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=f65f6550267162fba0042b7ef336c538" alt="A partial close sells only enough stock to put health back on the target line, unless dust remains." width="1200" height="440" data-path="assets/diagrams/concepts/partial-close-dark.svg" />
</Frame>

Default path seizes the minimum USDG repay that restores `targetHealth` (1e18). If leftover debt is under `dustDebt` ([10 USDG](/resources/parameters)), the module closes the book in full.

`protocolLiqFeeShare` ([10%](/resources/parameters)) of the discount bonus is seized to `FeeCollector`.

`RiskRegistry.liquidatorAllowlist` is true at launch. `LiquidationModule.liquidate` does not read that flag. NatSpec: liquidations are permissionless.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/concepts/bad-debt-waterfall-light.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=c5fcf299bd39d9242bfd1ef6eea290b3" alt="Shortfall hits remaining collateral proceeds, then the reserve, then a future backstop, then suppliers pro rata." width="1200" height="380" data-path="assets/diagrams/concepts/bad-debt-waterfall-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/mystockline/T8zoJG9K_VZWCC6Y/assets/diagrams/concepts/bad-debt-waterfall-dark.svg?fit=max&auto=format&n=T8zoJG9K_VZWCC6Y&q=85&s=e19f71ba53606d1107b18628da012540" alt="Shortfall hits remaining collateral proceeds, then the reserve, then a future backstop, then suppliers pro rata." width="1200" height="380" data-path="assets/diagrams/concepts/bad-debt-waterfall-dark.svg" />
</Frame>

Order in ARCHITECTURE.md: liquidation proceeds, Reserve, Backstop, suppliers. Backstop is not deployed. Today the reserve covers what it can, then the pool socializes the rest.

Related: [If your stock falls](/using/if-your-stock-falls), [Run a liquidator](/developers/liquidators), [Parameters](/resources/parameters).
