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

interface AdjustPreview {
    bindingConstraint: null | AdjustBlockReason;
    capacity: BorrowingCapacity;
    capacityAfter: CapacityAfter;
    currentIcr: bigint;
    fee: bigint;
    icrIsAbsolute: boolean;
    icrThreshold: bigint;
    isRecoveryMode: boolean;
    minimumCollateralToClearIcr: null | bigint;
    netDebtChange: bigint;
    price: bigint;
    reasons: AdjustBlockReason[];
    resultingCollateral: bigint;
    resultingEntireDebt: bigint;
    resultingIcr: bigint;
    resultingTcr: bigint;
    viable: boolean;
}

Properties

bindingConstraint: null | AdjustBlockReason

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

Capacity, live entire debt, and the remaining headroom, so EXCEEDS_BORROWING_CAPACITY arrives with the numbers behind it rather than as a bare reason (MK-060). Reported on every adjustment; only enforced when the debt increases (:850-852).

capacityAfter: CapacityAfter

The capacity this adjustment LEAVES, what it removes, and what winning it back would cost (MK-242). capacity above is the picture before the adjustment; this is the one after.

currentIcr: bigint

The Trove's ICR before this adjustment, at the current price.

fee: bigint

The borrowing fee the contract would charge, zero when skipped or not a debt increase.

icrIsAbsolute: boolean

True whenever ICR_BELOW_THRESHOLD is enforced on this call, which it is in every mode this operation can reach.

It is on the result because the gate is an ABSOLUTE test on the resulting ratio and integrators reliably read it as a do-no-harm test (MK-038). When this is true and resultingIcr < icrThreshold, the operation is refused even if it improves the position. minimumCollateralToClearIcr is what would actually clear it.

icrThreshold: bigint

What resultingIcr is measured against: MCR in normal mode, CCR in Recovery Mode.

isRecoveryMode: boolean

Whether the system is in Recovery Mode right now.

minimumCollateralToClearIcr: null | bigint

The collateral that would have to be in the Trove for resultingIcr to reach icrThreshold, given the resulting debt. null when the resulting debt is zero, when the price is zero, or when the gate is already satisfied.

This is the number a rescue needs and the reason a partial top-up is refused.

A floor at this block, not a rescue amount (MK-100 per figure). It clears the gate against the debt READ here, and _adjustTrove accrues interest before its gates (BorrowerOperations.sol:769), so a top-up of exactly this much is refused a block later with InsufficientCollateral and the Trove stays liquidatable (zz-limit-figures.fork.test.ts). A rescued Trove that did clear it would sit on MCR. Add a margin above it.

netDebtChange: bigint

The debt change the gates compare, the draw plus its fee, or the repayment.

price: bigint

BTC/USD used for every number above.

Every reason it is not viable, in contract call order. Empty when viable.

resultingCollateral: bigint

The Trove's collateral after this adjustment.

resultingEntireDebt: bigint

The Trove's entire debt after this adjustment.

resultingIcr: bigint

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

resultingTcr: bigint

The system TCR after this adjustment. Reported in both modes; enforced only in normal.

viable: boolean

True only when every constraint the contract enforces is satisfied.