• LiquityBase._getNetDebt: the entire debt less the gas compensation reserve (MK-094).

    _getNetDebt(uint256 _debt) => _debt - MUSD_GAS_COMPENSATION (LiquityBase.sol:107-109). The contract subtracts unchecked and would revert on a Trove holding less than the reserve, which cannot happen for an active Trove; this floors at zero instead, so a preview of an impossible position returns a number rather than throwing.

    One copy, because it had ten, in two shapes. Seven sites floored at zero the way this one does; three in trove/index.ts subtracted unguarded. On an active Trove the two agree, since the gas reserve is always part of the debt, so nothing was wrong. They were still two implementations of one line of Solidity, and the only thing keeping them agreeing was that nobody had edited one of them.

    Parameters

    • entireDebt: bigint

    Returns bigint