Liquidations
Limited to what makes a position healthy again, paused while the market is closed, and what happens when the collateral is not enough.
A position becomes liquidatable when its borrowed value exceeds its collateral value times the market's liquidation threshold.
Partial, not total
A liquidator chooses how many borrow shares to repay, and seizes a proportional fraction of every token the position holds, plus the market's bonus. How much they may repay depends on how unhealthy the position is. This limit is the close factor:
| Health factor | Most one liquidation may repay |
|---|---|
| between 0.95 and 1 | the part of the debt that brings the health factor back to 1.05 |
| 0.95 or below | the whole debt |
The health factor is collateral value × liquidation threshold ÷ debt; below 1 the position is
liquidatable. A liquidator who asks for more than the limit is capped to it — that includes
LendingPool.liquidation(borrower), which asks for everything.
This matters for borrowers. A position 1% past the threshold does not get closed entirely, and does not pay the bonus on its whole debt: it loses only what it takes to make it healthy again, with a 5% margin so the next small move does not trigger another liquidation at once. The alternative — seize everything on any breach — turns a small adverse move into a total loss.
An example on NVDA/USDG: 1 NVDA against 100 USDG of debt, and NVDA falls to $150. The health factor is 0.65 × 150 ÷ 100 = 0.975. One liquidation may repay 21.55 USDG and take $23.28 of NVDA; the borrower keeps $126.72 of NVDA against 78.45 USDG of debt, a health factor of 1.05. Without the limit, a liquidator could have repaid all 100 USDG and taken $108 of NVDA.
Two more rules keep this workable:
- No dust. A partial liquidation must leave at least $5 of debt and $5 of collateral
(half of
IsHealthy.closeFactorMinBase(), currently $10), so no one leaves behind a sliver of debt that is not worth anyone's gas to clear. If restoring 1.05 would leave less than that, the whole position may be liquidated instead. - Splitting does not help. The limit is a target, not a share of the debt, so several small liquidations never repay more than one would.
The formula, rounding and worked examples are on liquidation math.
The bonus
The liquidator receives the seized collateral at a discount, set per market:
| Market | Bonus |
|---|---|
| NVDA / USDG | 8% |
| SPY / USDG | 6% |
| WETH / USDG | 5% |
| SPCX / USDG | 10% |
| TSLA / USDG | 10% |
| MSFT / USDG | 8% |
| AAPL / USDG | 8% |
| QQQ / USDG | 7% |
| GOOGL / USDG | 8% |
| AMD / USDG | 10% |
A share of that bonus can be directed to the protocol rather than the liquidator
(liquidationProtocolShare, currently 0%).
The bonus is not arbitrary. It is the payment for the liquidator's capital, gas and price risk — and a liquidator who is not paid enough stops showing up, which is precisely when bad debt accumulates. Raising the protocol's share reduces what liquidators earn, and that trade is the one being made.
Liquidations pause while the market is closed
This is the part that differs from a market built for assets that trade continuously.
A liquidation needs a Fresh price for both the collateral and the borrow token. When the equity
market is closed, the last price stands and liquidations are blocked, along with borrowing and
withdrawing collateral from a position with debt. Repaying and Earn vault withdrawals stay open. The
block lasts past the reopen until the feed publishes a new price — see
reopening.
The reason: a price that cannot move is not a price a position should be closed on. Liquidating against Friday's close on a Sunday afternoon punishes a borrower for a move the market has not had the chance to make — and rewards a liquidator for information nobody has.
The consequence, stated plainly: a position can be deeply underwater when the market reopens, and several positions may be liquidatable at once in the first minutes of a session. That is the cost of the choice, and it is why Stock Token markets carry lower LTVs than WETH.
See market hours.
Bad debt
A liquidator is always paid the bonus. So once a position's collateral is worth less than its debt plus the bonus — a health factor below the liquidation threshold × (1 + bonus): 0.702 on NVDA/USDG, MSFT/USDG, AAPL/USDG and GOOGL/USDG, 0.749 on QQQ/USDG, 0.795 on SPY/USDG, 0.840 on WETH/USDG, 0.550 on SPCX/USDG, TSLA/USDG and AMD/USDG, all well below 0.95, so the whole debt may be repaid — a liquidation takes all of the collateral, the liquidator repays only what it is worth at the bonus, and the rest of the debt is bad debt.
That starts well before the collateral falls below the debt. Lenders lose the debt minus the collateral's value divided by (1 + bonus), not the debt minus the collateral's value: an NVDA/USDG position with 2,400.36 USDG of debt and collateral worth $2,400 — short by 0.36 — leaves 178.14 USDG of bad debt. The arithmetic is on liquidation math.
Bad debt is realised in the same transaction: the market's totalSupplyAssets falls by the amount,
and anything beyond that is charged to the market's reserves.
A market's supply is the Earn vault's claim on it, so the loss lands on the
vault. Its totalAssets() falls, and so does the value of every peUSDG share — every Earn
depositor bears it, whichever market it came from. What bounds it is the vault's exposure to that
market: at most what the vault has lent there. The curator can cap that per market; the caps are
currently unlimited, so a market can draw on all of the vault's idle USDG and the bound is the
vault itself.
Isolation still holds on the borrowing side: bad debt in NVDA/USDG does not touch anyone's position, collateral or liquidation price in SPY/USDG.
Bad debt events are emitted on-chain and indexed, so the running total per market is readable rather than something you have to infer.
Running a liquidator
Liquidation is permissionless. To run your own bot, start from run a liquidator: a starter script and the five calls it makes.