Who Gets Pushed into Bad Debt by a Wrong Price?
Separate market and oracle prices to see stale data delay liquidation and leave debt after collateral is exhausted.
- Separate outside market price from the oracle price used for risk
- Explain why stale data makes health look too high
- Understand how uncovered debt becomes bad debt
- PREVIOUSAt What Price Can a Liquidator Take Over?
- CURRENTWho Gets Pushed into Bad Debt by a Wrong Price?
Separate market and oracle prices to see stale data delay liquidation and leave debt after collateral is exhausted.
- NEXTFree sandbox
Think about these questions first.
Choose an answer before opening the explanation. You can add anything unexpected to your review list.
Q01The market crashed, but the oracle has not updated. Why does the account still look safe?+
The contract reads the recorded onchain price, not an exchange screen. A stale value temporarily overstates collateral until the update reveals accumulated risk.
A lending protocol does not read every market trade directly. It depends on an oracle to write a verifiable price into risk logic. A market crash does not mean the protocol has seen it, and a wrong oracle price does not make a position safe.
Put two prices side by side
The lab shows:
- Market price: what outside traders would trade at now.
- Oracle price: what the protocol currently uses for collateral value, capacity, and liquidation.
If market price falls to 72 while the oracle remains at 120, health factor can still look high. Only an oracle update recomputes the boundary.
TOKEN collateral → credits
Put one loan into the state machine and watch price, interest, oracle, and keeper actions reshape the account.
Drop the market price without updating the oracle, then compare the risk readings.
- Wallet TOKEN
- 100
- Account cash
- 5,000
- Protocol liquidity
- 100,000
- Liquidator TOKEN
- 0
Collateral is locked once deposited; a withdrawal first simulates the resulting health factor.
Move the outside market, then choose when the oracle updates. Current gap 0.00%.
Line 1.00; bonus 5.00%. The button unlocks only after health crosses the boundary.
Deposit collateral, then borrow near the capacity. Capacity, health, and pool liquidity are three different boundaries.
- 01
抵押池创建:100 TOKEN, 初始价格 120 credits.
Use the slider to return to an earlier step. Continuing from there replaces the later history with a new sequence.
Debt after collateral is exhausted is bad debt
If price moves too fast or collateral was insufficient, a liquidator can repay only what the seized assets cover. Any remaining liability has no matching asset. That is not an ordinary pending order; it is a gap the protocol must absorb.
Buffers include lower LTV, insurance, reserves, liquidation incentives, and better data sources. None guarantees zero bad debt; each changes its probability and who bears it.
Expand: how this step works
marketPrice != oraclePrice
healthFactor = value(oraclePrice) * threshold / debt
if marketPrice moves first:
risk is invisible until oracle updates
if all collateral is seized and debt > 0:
badDebt = debt
Onchain execution is deterministic relative to the input it reads; it cannot prove that the input is the correct real-world price.