Decode Aave v3 health-factor output without displaying the no-debt sentinel

The pool returns account totals in a market base currency but expresses health factor as a wad ratio. A position with zero debt uses a sentinel and should not appear as an enormous measured ratio.

Use the liquidation threshold for the ratio

Read account data for the same market and block. In the nonempty example, collateral times the applicable weighted liquidation threshold is 800 base units. Dividing by 400 debt units gives two, represented near 2 times 10^18 before display.

total collateral base = 1000
weighted liquidation threshold = 80%
total debt base = 400
health factor ≈ 2.0 in 18-decimal wad units

Using loan-to-value in this formula instead of liquidation threshold changes the result. Reproducing the pool exactly requires its integer rounding, asset eligibility and applicable efficiency-mode handling. Do not apply token decimals to the final wad.

Decode zero debt explicitly

The reference GenericLogic returns the maximum uint256 health factor when total debt is zero. Present a no-debt state or an explicitly unbounded display instead of converting the sentinel into a chart observation. Check total debt along with the raw return value. github.com GenericLogic.sol