Why Can Debt Grow by Itself?
Advance accrual periods and watch interest increase debt, lower health, and change borrowing room.
- Separate principal, interest, and health factor
- Explain why health is a risk signal rather than a balance
- Observe repayment restore safety room
- PREVIOUSWhy Can’t 100 TOKEN Borrow Its Full Value?
- CURRENTWhy Can Debt Grow by Itself?
Advance accrual periods and watch interest increase debt, lower health, and change borrowing room.
- NEXTAt What Price Can a Liquidator Take Over?
Think about these questions first.
Choose an answer before opening the explanation. You can add anything unexpected to your review list.
Q01Can a loan be liquidated while price stays flat and the user does nothing?+
Yes. Interest grows the debt denominator and slowly lowers health. A position near the boundary can cross the liquidation line through time alone.
Borrowing is not a one-time button. Interest accumulates onto debt, while health factor compresses “how much collateral still covers risk” into a monitorable signal. An account can approach liquidation without another user action.
Health factor is not a return metric
The lab uses a simple ratio:
health factor = collateral value × liquidation threshold ÷ current debt
1.00 is the boundary. Above 1.00 means a buffer at the current oracle price; below 1.00 permits liquidation. It is not how much the account can earn and not a price forecast.
TOKEN collateral → credits
Put one loan into the state machine and watch price, interest, oracle, and keeper actions reshape the account.
Borrow, accrue interest, then use repayment to compare debt with health.
- 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.
Why repayment restores room
Repayment reduces both the user’s cash and protocol debt. Lower debt raises health factor and may allow a borrower to withdraw part of the collateral again. The protocol must check the post-withdrawal state before releasing assets.
Expand: how this step works
accrueInterest:
interest = debt * ratePerPeriod
debt += interest
repay(amount):
userCash -= amount
poolLiquidity += amount
debt -= amount
healthFactor = collateralValue * liquidationThreshold / debt
Health factor is derived from state. The invariants that matter are debt, collateral, and cash flows—not the display number by itself.