Skip to main content
The single number the controller uses to decide whether an account is solvent, may borrow, or can be liquidated. Read first: Risk parameters.

Definition

Health factor (HF) compares an account’s liquidation-threshold-weighted collateral against its total debt, both valued in USD-WAD (10^18):
The division floors, so rounding always reports the more conservative value, and it saturates at the top of the signed domain instead of reverting. An account with no debt returns i128::MAX — an effectively infinite health factor. An account is liquidatable when HF < 1e18 (one WAD). The two sides round in opposite directions on purpose. Collateral floors at every step, so it can never be overstated. Debt ceils, so it can never be understated. Both errors would favour the account; neither is allowed. One exception: the read-only get_total_borrow_usd view rounds half-up. It is a display number, not a solvency input. Each term is built from a scaled position, its market index, and the asset price:
The liquidation threshold applied to each collateral is the value snapshotted onto that position at supply time (AccountPositionRaw) from the account’s spoke asset config. The health factor is always evaluated post-execution on cached indexes, so a borrow or withdraw is checked against the state it would produce.
Health factor is separate from the LTV gate. Borrow and withdraw additionally require Σ position_value(supply_i) · loan_to_value_i / BPS ≥ total_debt_usd. Because LTV is always below the liquidation threshold, an account reaches its borrow limit before it becomes liquidatable.

Worked example

An account supplies 1,000ofcollateralwhoseliquidationthresholdis0.78(7800BPS)andborrows1,000 of collateral whose liquidation threshold is `0.78` (`7800` BPS) and borrows 500. All USD values are WAD-scaled, so 1,000is10001018=1000e18and1,000 is `1000 · 10^18 = 1000e18` and 500 is 500e18.
The health factor is 1.56e18, comfortably above the 1e18 boundary, so the account is solvent and not liquidatable. If the collateral price halved, weighted_collateral would fall to 390e18 and HF to 0.78e18 — below 1e18, and the account would become liquidatable. Recompute after any supply, borrow, repay, withdraw, price change, or liquidation.

Decision table

Edge cases

On-chain health-factor values are WAD-scaled (10^18). The view get_health_factor(account_id) -> i128 returns this raw WAD integer, and i128::MAX when the account is debt-free. Divide by 10^18 only for display; never approve a borrow or withdraw from cached account or price data — re-read state before building the transaction.

Next

Liquidations

What happens once an account crosses below HF = 1.

Risk parameters

The liquidation thresholds and LTVs that weight the formula.

Accounts and risk

Position snapshotting, spoke risk, and risk gates.

Oracles

The prices that feed every position value.