Result of previewBorrow. Raw numbers included so callers render their own copy.

interface BorrowPreview {
    bindingConstraint: null | BorrowBlockReason;
    capacity: BorrowingCapacity;
    currentIcr: bigint;
    fee: bigint;
    icrThreshold: bigint;
    isRecoveryMode: boolean;
    netDebtChange: bigint;
    price: bigint;
    reasons: BorrowBlockReason[];
    resultingEntireDebt: bigint;
    resultingIcr: bigint;
    resultingTcr: bigint;
    viable: boolean;
}

Properties

bindingConstraint: null | BorrowBlockReason

The single constraint that binds first, or null when viable.

Capacity, live entire debt, and the remaining headroom.

currentIcr: bigint

The Trove's ICR BEFORE this borrow, at the current price.

Added with MK-058, because ICR_NOT_IMPROVED_IN_RECOVERY_MODE cannot be interpreted without it: the gate is newICR >= oldICR and this is oldICR.

fee: bigint

The borrowing fee the contract would charge for this draw, zero when it is skipped.

icrThreshold: bigint

The threshold resultingIcr is measured against: MCR normally, CCR in Recovery Mode.

isRecoveryMode: boolean

Whether the system is in Recovery Mode right now.

netDebtChange: bigint

draw + fee, the quantity the capacity gate compares.

price: bigint

BTC/USD used for every number above.

Every reason it is not viable, in the order _adjustTrove checks them. Empty when viable.

resultingEntireDebt: bigint

The Trove's entire debt after this borrow.

resultingIcr: bigint

The Trove's ICR after this borrow, at the current price.

resultingTcr: bigint

The system TCR after this borrow. Reported in both modes, enforced only in normal mode (MK-059): _requireNewTCRisAboveCCR has no call site on the Recovery Mode adjust path.

viable: boolean

True only when every constraint the contract enforces is satisfied.