Preview borrowing amount against an existing Trove, returning a verdict, the binding
constraint, and every raw number behind it (MK-002).
A thin wrapper over previewAdjustTrove with a debt increase and nothing else, so the
two previews cannot disagree about the same call (MK-058, MK-059, MK-060, MK-065). The
agreement is asserted rather than assumed, in packages/core/test/preview-agreement.test.ts.
The one cost of delegating, stated rather than hidden.previewAdjustTrove also reads the
caller's MUSD balance and minNetDebt(), which only the repayment gates use and a borrow never
reaches. Both ride in the same Promise.all, so this adds two reads and no round trip, and the
alternative is a second copy of the read set to go with the second copy of the rules.
This is the counterpart to getBorrowingPower, which is an OPEN time calculator and is
documented as such. Use this one for a Trove that already exists.
Not a single block snapshot: the price is read outside the batch that uses it. The full
statement is on MathDeps in math/deps.ts (MK-013, MK-093).
Preview borrowing
amountagainst an existing Trove, returning a verdict, the binding constraint, and every raw number behind it (MK-002).A thin wrapper over previewAdjustTrove with a debt increase and nothing else, so the two previews cannot disagree about the same call (MK-058, MK-059, MK-060, MK-065). The agreement is asserted rather than assumed, in
packages/core/test/preview-agreement.test.ts.The one cost of delegating, stated rather than hidden.
previewAdjustTrovealso reads the caller's MUSD balance andminNetDebt(), which only the repayment gates use and a borrow never reaches. Both ride in the samePromise.all, so this adds two reads and no round trip, and the alternative is a second copy of the read set to go with the second copy of the rules.This is the counterpart to
getBorrowingPower, which is an OPEN time calculator and is documented as such. Use this one for a Trove that already exists.Not a single block snapshot: the price is read outside the batch that uses it. The full statement is on
MathDepsinmath/deps.ts(MK-013, MK-093).