> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vanna.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Health Factor

> Unweighted collateral-to-debt ratio, liquidatable at 1.10, with conservative rounding.

```text theme={null}
HF = Σ collateral_usd / Σ debt_usd
healthy ⇔ no debt, or HF > 1.10
liquidatable ⇔ HF ≤ 1.10
```

The ratio is **unweighted**: every allowed token counts at its full USD value (up to its per-margin cap). The same 1.10 threshold gates new borrows, withdrawals with debt, and every `margin_execute` call.

## What counts

* Every allowed token in the margin's vaults, including borrowed tokens and receipts (Kamino cTokens, Perena shares, basis-vault shares).
* The Phoenix trader account, as one line: collateral plus position equity, floored at zero.
* Every debt, at its accrued value.

Borrowed tokens land in the margin vault, so a borrow raises both sides of the ratio.

## Rounding

| Side | Rounding |
| - | - |
| Collateral | Down |
| Debt | Up |

The protocol would rather reject a tight borrow than mark an account safer than it is.

## Prices that fail a check

For the owner's own actions, a collateral token whose price is stale or off its TWAP counts as **zero**, so a stale-priced token can't be used to borrow more. A debt must have a good price, or the action is blocked. For liquidation, collateral counts at its reported value and only the debts need fresh prices.

## In the app

The app uses the same formula (`lib/account-model.ts`) and the same price sources as the oracle. Its own limits target HF ≥ 1.15, so price drift between quote and execution doesn't trip the on-chain check.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.