Per-market HF check using the borrower's collateral on adapter and the borrower's debt scoped to (msg.sender, adapter).
_ensureLiquidity(amount).
Origination fee (originationFeeBps, default 0) skimmed from amount and forwarded to the FeeCollector under FEE_ORIGINATION.
DebtToken.mint(msg.sender, adapter, amount, usageIndex) — debt scoped to (user, adapter). The aggregate DebtToken.totalSupply() drives pool-wide utilisation; the per-market DebtToken.totalSupply(adapter) is the per-market position size.
Transfer amount − originationFee of USDr to msg.sender.
V1 liquidations are single-step and atomic. There is no on-chain grace period and no initiate/finalize staging — the whole seizure happens in one transaction. The function is gated by LIQUIDATION_PROXY_ROLE, which is held by the LiquidationProxy (manager-gated in V1) and by the Stability Pool itself.
Access: onlyRole(LIQUIDATION_PROXY_ROLE). In practice called via LiquidationProxy.liquidate(...) → StabilityPool.liquidateBorrower(...) → here.
Precondition: supportedAdapter[adapter]; stabilityPool != address(0); HF on the (user, adapter) market < 1. The adapter's stale-oracle check inside getAssetValue will revert with OracleStale() if the price feed has gone past ORACLE_STALENESS_MAX (7 days).
State:
reserve.updateState().
_materializeRedistribution(adapter, user).
V3 isolation: only the user's debt scoped to (user, adapter) is wiped — positions on other markets are untouched.
IAssetAdapter(adapter).transferAsset(user, data, stabilityPool) — seized RWA flows to the SP.
DebtToken.burn(user, scopedDebt, usageIndex, ...) — the per-market debt counter is zeroed.
Clear the per-market position; reserve.updateInterestRates(absorbed, 0).
Returns: (absorbedAssets, badDebt) — badDebt > 0 when collateral value < debt at seizure (routed through Reserve Fund / redistribution, see Stability Pool → Liquidations).
Errors: UnsupportedAdapter(), StabilityPoolNotSet(), HealthFactorTooHigh(), OracleStale() (from the adapter).
The previous V1 design had a 3-stage flow (initiateLiquidation / closeLiquidation / finalizeLiquidation) with a 72-hour grace period. The current V1 ships without that staging — the seizure is instant. The grace was dropped in favour of a single atomic call to keep the audit surface minimal and avoid the partial-state edge cases of a multi-tx liquidation. Borrowers cure by repaying or topping up collateral before the manager submits.