Liquidation math
When a position can be liquidated, how much one liquidation may repay, how much is seized, how the bonus is split, and exactly where bad debt starts.
The narrative — why liquidation is partial, why it pauses while the market is closed — is on
liquidations. This page is the arithmetic, in the order the contract runs it
(LendingPoolRouter).
Eligibility
After accruing interest, the position must satisfy
strictly, with both sides as on position health;
otherwise the call reverts AssetNotLiquidatable. Also required: the borrower has shares, the
liquidator asks to repay more than zero, both prices are Fresh when requireFreshForLiquidation
is set (it is, on every market), and the collateral token's issuer has not paused transfers.
The liquidator chooses how many shares to repay. The contract caps that at the borrower's
and then at the close factor below, so liquidation(borrower) — which asks for everything —
repays as much as the close factor allows, not necessarily the whole debt.
Close factor
One liquidation takes what is needed to make the position healthy again, with a margin, and no more. Write the health factor and the market's bad-debt line as
Repaying a fraction of the debt removes of debt and of collateral value, so the health factor afterwards is
It reaches the target at the restoring fraction
computed as a WAD and rounded up. The most shares one liquidation may repay is
(IsHealthy · 0x9259…F9a1, a view; the router applies the same rule to every
liquidation through the shared CloseFactor library, LendingPoolRouter):
| Position | |
|---|---|
| — the whole debt | |
| and (only when , which no market allows) | |
| , and repaying would leave dust (below) | |
| otherwise |
A request above is capped to it, the same way a request above is: the call does not revert. Rounding up to a whole share means the position ends at 1.05, not one wei below it.
Why a target. A target is a state, not a share of the debt. After a first, smaller liquidation, the allowance is exactly what is still needed to reach 1.05, so splitting a liquidation into several calls never repays more than one call would. In practice it repays less: each slice raises the health factor, and once it is back above 1 the position is not liquidatable at all.
Why 1.05. Exactly 1 would leave the borrower one tick from the next liquidation. 1.05 is a 5% margin, small enough that the borrower keeps most of the position.
Dust
A partial liquidation — one that leaves shares () and does not take the whole Position () — must leave at least of debt and of collateral:
otherwise the call reverts MustNotLeaveDust(leftoverDebt, leftoverCollateral, minLeftover).
is IsHealthy.closeFactorMinBase(), one value for every market: $10 on mainnet
(read on 27 October 2026), so the minimum left behind is $5. The owner can change it.
If even would leave less than that, the whole position may go — that is the third row of the table — so an unhealthy position can always be liquidated by someone. "Small" is judged by what reaching the target would leave, never by the position's size now, which is what keeps the rule split-proof. Repaying exactly never reverts as dust; only a smaller partial can.
A liquidation the Position cannot cover (the bad-debt case below) takes all of the collateral and is never refused as dust.
Live markets
| Market | LT | from | from | ||
|---|---|---|---|---|---|
| NVDA / USDG | 0.65 | 0.08 | 0.702 | 17.24% | 25.86% |
| SPY / USDG | 0.75 | 0.06 | 0.795 | 23.53% | 35.29% |
| WETH / USDG | 0.80 | 0.05 | 0.840 | 28.57% | 42.86% |
| SPCX / USDG | 0.50 | 0.10 | 0.550 | 12.00% | 18.00% |
| TSLA / USDG | 0.50 | 0.10 | 0.550 | 12.00% | 18.00% |
| MSFT / USDG | 0.65 | 0.08 | 0.702 | 17.24% | 25.86% |
| AAPL / USDG | 0.65 | 0.08 | 0.702 | 17.24% | 25.86% |
| QQQ / USDG | 0.70 | 0.07 | 0.749 | 19.93% | 29.90% |
| GOOGL / USDG | 0.65 | 0.08 | 0.702 | 17.24% | 25.86% |
| AMD / USDG | 0.50 | 0.10 | 0.550 | 12.00% | 18.00% |
Mainnet's parameters, read at block 94915008; MSFT/USDG and AAPL/USDG at block 99393260, QQQ/USDG, GOOGL/USDG and AMD/USDG at block 113204091. Every is below 0.95, so a position in bad debt () can always be liquidated in full.
Example
1 NVDA against 100 USDG of debt on NVDA/USDG. NVDA falls to $150:
| Liquidator repays | 21.55 USDG |
| Liquidator receives | 0.155172 NVDA, worth $23.28 (21.55 × 1.08) |
| Borrower keeps | 0.844828 NVDA, worth $126.72, against 78.45 USDG of debt |
| Health factor after |
Without the close factor, the same liquidation could have repaid all 100 USDG and taken $108 of NVDA.
The same position at a tenth of the size — 0.06 NVDA ($9) against 6 USDG, also at —
would keep only 4.71 USDG of debt after reaching 1.05, below the $5 minimum. So it may be liquidated
in full (6 USDG repaid, $6.48 of NVDA seized), and a request to repay 3 USDG reverts
MustNotLeaveDust.
Seize fraction
The contract works out what fraction of the Position to hand over, as a WAD
(LendingPoolRouter), on the shares left after the cap:
Where:
- — the Position's value rebuilt from (at most one unit below ).
- — the value to seize: the repaid share of the debt value, plus the bonus .
- — the shares actually repaid. When the Position cannot cover , the liquidator takes all of it and repays only what it is worth at the bonus.
The liquidator then pays, rounded up in the lenders' favour:
Protocol split
A share of the bonus — never of the repaid value — can go to the protocol
(LendingPoolRouter):
is liquidationProtocolShare, at most 100% (IsHealthy · 0x9259…F9a1),
and 0% on every market. The Position then transfers
to the liquidator and to
the protocol (Position).
Bad debt
If the whole Position was taken () and the borrower still has shares, the rest of
their debt is written off in the same transaction (LendingPoolRouter):
Supply absorbs it first, ; anything beyond supply is
charged to reserves, capped at what they hold; a shortfall beyond both is not recorded anywhere.
Since a market's supply is the Earn vault's claim, the loss
lands on every peUSDG holder.
Where it starts. A liquidation leaves bad debt as soon as the collateral cannot pay the debt plus the bonus:
not when collateral falls below the debt. The liquidator is still paid their bonus on whatever is there, so lenders lose
— which can be large even while . Mainnet thresholds: 0.702 for NVDA/USDG, MSFT/USDG,
AAPL/USDG and GOOGL/USDG, 0.749 for QQQ/USDG, 0.795 for SPY/USDG, 0.840 for WETH/USDG,
0.550 for SPCX/USDG, TSLA/USDG and AMD/USDG. Market creation requires
(LendingPoolFactory · 0x7a2b…b1C6), so there is always a band of health factors in
which liquidation clears a position without loss.
Partial liquidation
Repaying a fraction of the debt removes of debt and of collateral value. The health factor afterwards is
and exactly when , i.e. . Above that line, a partial liquidation improves the position, and the close factor stops it at 1.05. Below it, each partial liquidation makes the health factor worse, and the only clean outcome is a full one — which the close factor always allows there.
The chart shows a full liquidation, the only kind allowed at a health factor of 0.95 or below.
Show as a table
| HF | Collateral | Liquidator | Protocol | Borrower keeps | Bad debt |
|---|---|---|---|---|---|
| 0.400 | 0.615 | 0.615 | 0.000 | 0.000 | 0.430 |
| 0.500 | 0.769 | 0.769 | 0.000 | 0.000 | 0.288 |
| 0.600 | 0.923 | 0.923 | 0.000 | 0.000 | 0.145 |
| 0.702 | 1.080 | 1.080 | 0.000 | 0.000 | 0.000 |
| 0.800 | 1.231 | 1.080 | 0.000 | 0.151 | 0.000 |
| 0.900 | 1.385 | 1.080 | 0.000 | 0.305 | 0.000 |
| 0.950 | 1.462 | 1.080 | 0.000 | 0.382 | 0.000 |
Worked example
The illustrative Position from
position health: 20 NVDA, 2400000000 borrow shares,
debt 2402294128 (2,402.294128 USDG) after accrual, with 20019117741,
20000000000, , . The prices below are
hypothetical too.
At $180, capped by the close factor. , : , liquidatable, and above 0.95. The liquidator asks for every share; the close factor allows
| Raw | Human | |
|---|---|---|
523662755 | 21.82% of the shares (capped from 2400000000) | |
566096382624961187999 | $566.10 = 1.08 × the repaid debt | |
157248995173600329 | 15.72490% of the Position | |
524163318 | 524.163318 USDG (rounded up) | |
| To liquidator | 3144979903472006580 | 3.144980 NVDA, worth $566.10 |
| Borrower keeps | 16.855020 NVDA ($3,033.90) against 1,878.130811 USDG of debt | |
| Health factor after | ||
| Bad debt | 0 | none: |
Both sides stay far above the $5 minimum, so the cap is the restoring fraction. A second
liquidation right after reverts AssetNotLiquidatable: the position is healthy.
Same, with : 2329614743312597 (0.23296%), so 0.046592
NVDA goes to the protocol and 3.098388 NVDA to the liquidator. The liquidator still repays the
same 524.163318.
At $180, split in two. A first liquidation of 240000000 shares (10%) already lifts the health
factor above 1, so the second is refused: 240,000,000 shares in total against 523,662,755 for one
call. Asking for half the shares (1200000000) is capped to 523662755, like asking for all of
them.
At $120, full liquidation. — just 2.29 below the debt — and : at or below 0.95, so the close factor allows every share, and below 0.702. , so everything is seized:
| Raw | Human | |
|---|---|---|
1000000000000000000 | 100% | |
2220100059 | ||
2222222224 | 2,222.222224 USDG for all 20 NVDA | |
| Bad debt | 180071906 | 180.071906 USDG |
The collateral was short of the debt by 2.29 USDG, but lenders lose 180.07: the 2.29 shortfall plus the liquidator's 8% bonus on $2,222.22 of repayment (177.78).
Position health
Collateral and borrow value, LTV against liquidation threshold, health factor, max borrow, liquidation price and the withdraw limit.
Earn vault math
Total assets with pending interest, share conversions and their rounding, withdrawal limits, allocation, the high-water-mark fee, and the net rate.