The interest the first eligible Trove accrues in 900 seconds, at its OWN rate and on its OWN principal, which is what nextViableAmount adds on top of the net debt.
Sized for 900 while the answer is advertised as good for 600, because the accrual that has to be covered runs from the block this was READ at to the block the transaction SETTLES in, and a caller cannot make those the same block (MK-095). Exposed rather than folded in silently so a caller who needs a different window can scale it: this is 900 seconds of interest, so four times it is an hour of interest.
The constraint that binds first, or null when viable.
The first Trove at or above MCR, which is where the loop starts. null when there is none.
That Trove's net debt, its entire debt minus the 200 MUSD gas reserve.
firstTroveNetDebt - minNetDebt, floored at zero. The largest partial the contract accepts
without consuming the Trove, and the lower edge of the gap.
The live minNetDebt() floor the cancellation compares against.
The caller's MUSD balance, which the contract checks at :320.
The smallest amount above the gap that works, which is firstTroveNetDebt PLUS
accrualMargin and NOT the net debt itself.
At this amount the Trove is consumed whole, which takes a branch with no hint check and no
floor check (TroveManager.sol:1252). The margin is there because the contract sizes the lot
against the debt at EXECUTION, after interest accrues (:366, :1218-1221), so an offer of
exactly the net debt read here arrives as a partial and cancels.
This value has a shelf life of about ten minutes. The margin is 900 seconds of interest and the claim is 600, and it is measured at both ends: a send at this amount succeeds after a 600 second delay and is refused after an hour. Add to it if you expect to be slower; overshooting cannot cost you the call.
The partial this redemption ends on, or null when every Trove it touches is consumed whole
(MK-103). A partial is priced twice: when its hint is read and when it mines, and the
contract cancels it when the price has moved further than a very narrow band allows. Read
PartialRedemption.priceFragile before sending one.
BTC/USD used for every number above.
Every reason it would not, in contract call order. Empty when viable.
What a single call would ACTUALLY redeem, computed by walking the list the way the loop does. Zero when the call would revert.
This is NOT getRedemptionHints's truncatedAmount, which answers a different question and
over-reports in the gap (MK-048).
The system TCR, which must be at or above MCR (:318).
True only when a single redeemCollateral call would go through.
Result of previewRedeem. Raw numbers included so callers render their own copy.