Skip to main content
The health factor (HF) measures how safe a position is from liquidation. Sonar computes it the same way the lending protocol does — an Aave-style, Zest-native formula:
HF = Σ(collateralUSD × liquidationThreshold) / Σ(debtUSD)
Health factorStatus
HF ≥ 1.5Safe
1.1 ≤ HF < 1.5Caution
1.0 < HF < 1.1Approaching liquidation
HF < 1.0Liquidatable

Inputs (all read live from mainnet)

Collateral & debt

Per-reserve balances from get-user-reserve-data and the aToken balance.

Liquidation threshold

From get-reserve-state — e.g. sBTC = 0.75 (75%).

Oracle price

From the reserve’s on-chain oracle — e.g. stx-btc-oracle-v1-4.

Decimals

Per-asset fixed-point scaling from get-reserve-state.

Worked example

A position with 0.5 sBTC collateral and 21,000borrowed,atalivesBTCpriceof21,000** borrowed, at a live sBTC price of **64,472 and a liquidation threshold of 0.75:
weighted collateral = 0.5 × $64,472 × 0.75 = $24,177
health factor       = $24,177 / $21,000     = 1.15   (caution)
liquidation price   = $21,000 / (0.5 × 0.75) = $56,000
If sBTC falls to $56,000, the health factor hits 1.0 and the position becomes liquidatable. Sonar alerts well before that point.