Result of previewClose.

interface ClosePreview {
    bindingConstraint: null | CloseBlockReason;
    canMint: boolean;
    collateral: bigint;
    entireDebt: bigint;
    isRecoveryMode: boolean;
    musdBalance: bigint;
    musdRequired: bigint;
    musdShortfall: bigint;
    price: bigint;
    reasons: CloseBlockReason[];
    resultingTcr: bigint;
    sortedTrovesSize: undefined | bigint;
    troveOwnersCount: undefined | bigint;
    viable: boolean;
}

Properties

bindingConstraint: null | CloseBlockReason
canMint: boolean

musd.mintList(borrowerOperations), read live. When false, RECOVERY_MODE, TCR_BELOW_CCR and LAST_TROVE_IN_SYSTEM are not enforced at all (:953, :964, and TroveManager.sol:1397).

collateral: bigint

The Trove's live collateral, returned in full when the close succeeds.

entireDebt: bigint

The Trove's live entire debt.

isRecoveryMode: boolean
musdBalance: bigint

What the caller actually holds.

musdRequired: bigint

MUSD the caller must hold: entireDebt - MUSD_GAS_COMPENSATION (:963).

A snapshot the chain outgrows (MK-050). _closeTrove accrues interest on the Trove at :945 and only then reads the debt at :958, so by the block a close executes in the required figure is LARGER than this one. Holding exactly this amount is refused. Acquire a margin above it, or recompute at the point of use. See FINDINGS.md, MK-050.

musdShortfall: bigint

musdRequired - musdBalance, floored at zero. What still has to be acquired.

Acquiring EXACTLY this is not enough, for the reason on musdRequired (MK-050).

price: bigint
reasons: CloseBlockReason[]
resultingTcr: bigint

The system TCR after this Trove is removed.

sortedTrovesSize: undefined | bigint
troveOwnersCount: undefined | bigint

The two counts behind LAST_TROVE_IN_SYSTEM, or undefined when they were not read (MK-091). Surfaced so the typed error the write path throws carries real numbers rather than the placeholder zeros MK-017 exists to refuse.

viable: boolean