Lesson 0213 min
INTEREST · HEALTH FACTOR

Why Can Debt Grow by Itself?

Advance accrual periods and watch interest increase debt, lower health, and change borrowing room.

ObjectivesAfter this lesson, you should be able to:
  • Separate principal, interest, and health factor
  • Explain why health is a risk signal rather than a balance
  • Observe repayment restore safety room
COURSE POSITIONStep 2 of 4
  1. PREVIOUSWhy Can’t 100 TOKEN Borrow Its Full Value?
  2. CURRENTWhy Can Debt Grow by Itself?

    Advance accrual periods and watch interest increase debt, lower health, and change borrowing room.

  3. NEXTAt What Price Can a Liquidator Take Over?
BEFORE YOU READ

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?
SHORT ANSWER

Yes. Interest grows the debt denominator and slowly lowers health. A position near the boundary can cross the liquidation line through time alone.

Compared with your prediction:

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.

LENDING SIMULATIONVirtual collateral · no advice
LENDING 001 · COLLATERAL / HEALTH / LIQUIDATION

TOKEN collateral → credits

Put one loan into the state machine and watch price, interest, oracle, and keeper actions reshape the account.

Current stateNo debtHealth
01Collateral
02Debt
03Risk moves
04Liquidation
Health
Oracle price120credits / TOKEN
Collateral value00 TOKEN
Current debt0Available 0
Healthliquidation line 1.00
Liquidation priceoracle reading
FOCUS EXPERIMENT · HEALTHInterest and health

Borrow, accrue interest, then use repayment to compare debt with health.

Account & collateral poolNo debt
Locked TOKEN
0
Debt / value
0
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.

PRICE INPUTS · ORACLE BOUNDARYMarket price is not protocol price

Move the outside market, then choose when the oracle updates. Current gap 0.00%.

LIQUIDATION KEEPERCan a liquidator take over?

Line 1.00; bonus 5.00%. The button unlocks only after health crosses the boundary.

Liquidator credits50,000
LiquidatableNO
Bad debt0
Observation prompt

Deposit collateral, then borrow near the capacity. Capacity, health, and pool liquidity are three different boundaries.

Lending events1 EVENTS
  1. 01

    抵押池创建:100 TOKEN, 初始价格 120 credits.

ACTION HISTORYExperiment timeline
1 state snapshots

Use the slider to return to an earlier step. Continuing from there replaces the later history with a new sequence.

Initial state
View experiment records →

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.

KNOWLEDGE CHECK

Why does health factor fall when price is unchanged but interest keeps accruing?

LESSON RECAPComplete the exercise and knowledge check first