Preview a combined adjustment (core previewAdjustTrove, MK-042): every ratio and mode
gate the contract enforces on _adjustTrove, with the raw numbers behind the verdict.
Read icrIsAbsolute before rendering a message. The individual ratio requirement is an
absolute test on the RESULTING ratio, not a do-no-harm test, so an adjustment that improves
a position can still be refused (MK-038). minimumCollateralToClearIcr is the figure that
would actually clear it.
An omitted leg stays omitted (MK-085). This hook used to default all four legs to 0n
and forward them, which made increaseDebt present on every call. previewAdjustTrove then
read _isDebtIncrease from PRESENCE, mirroring _adjustTrove's own separate
_isDebtIncrease parameter (BorrowerOperations.sol:757-758), so through this hook every
adjustment was evaluated as a debt increase: a pure top-up came back
ZERO_DEBT_INCREASE (:785-787, :1351-1356) and a pure repayment came back refused with
resultingEntireDebt and resultingIcr computed as though nothing had been repaid.
Since 0.5.0 the flag is derived from the VALUE (MK-244; this comment is MK-252). A leg of
0n is no leg, in this hook, in previewAdjustTrove and in adjustTrove, so
{ addCollateral: 0n, withdrawCollateral: x } is a withdrawal rather than a refusal. Absence
still matters here for a different reason: an absent leg is kept out of the query key, so two
different questions cannot share one cache entry.
Preview a combined adjustment (core
previewAdjustTrove, MK-042): every ratio and mode gate the contract enforces on_adjustTrove, with the raw numbers behind the verdict.Read
icrIsAbsolutebefore rendering a message. The individual ratio requirement is an absolute test on the RESULTING ratio, not a do-no-harm test, so an adjustment that improves a position can still be refused (MK-038).minimumCollateralToClearIcris the figure that would actually clear it.An omitted leg stays omitted (MK-085). This hook used to default all four legs to
0nand forward them, which madeincreaseDebtpresent on every call.previewAdjustTrovethen read_isDebtIncreasefrom PRESENCE, mirroring_adjustTrove's own separate_isDebtIncreaseparameter (BorrowerOperations.sol:757-758), so through this hook every adjustment was evaluated as a debt increase: a pure top-up came backZERO_DEBT_INCREASE(:785-787,:1351-1356) and a pure repayment came back refused withresultingEntireDebtandresultingIcrcomputed as though nothing had been repaid.Since 0.5.0 the flag is derived from the VALUE (MK-244; this comment is MK-252). A leg of
0nis no leg, in this hook, inpreviewAdjustTroveand inadjustTrove, so{ addCollateral: 0n, withdrawCollateral: x }is a withdrawal rather than a refusal. Absence still matters here for a different reason: an absent leg is kept out of the query key, so two different questions cannot share one cache entry.