Preview a redemption (core previewRedeem, MK-048): what a single redeemCollateral call will
ACTUALLY redeem, by walking the sorted list the way the contract's loop does.
Do not size a redemption from getRedemptionHints. Its truncated amount answers a different
question, and RedeemResult no longer carries it (MK-241): the helper sizes each
partial to a Trove's headroom above the debt floor and then moves on, which needs one call per
Trove. A single call hands the whole amount to the first eligible Trove and reverts if that
breaches the floor.
So the amounts that work are not an interval. Render maxWithoutConsuming and
nextViableAmount as the two edges when bindingConstraint is
PARTIAL_BREACHES_DEBT_FLOOR: the limit is another account's headroom, not the user's balance,
which is exactly the thing a user cannot be expected to guess.
Preview a redemption (core
previewRedeem, MK-048): what a singleredeemCollateralcall will ACTUALLY redeem, by walking the sorted list the way the contract's loop does.Do not size a redemption from
getRedemptionHints. Its truncated amount answers a different question, andRedeemResultno longer carries it (MK-241): the helper sizes each partial to a Trove's headroom above the debt floor and then moves on, which needs one call per Trove. A single call hands the whole amount to the first eligible Trove and reverts if that breaches the floor.So the amounts that work are not an interval. Render
maxWithoutConsumingandnextViableAmountas the two edges whenbindingConstraintisPARTIAL_BREACHES_DEBT_FLOOR: the limit is another account's headroom, not the user's balance, which is exactly the thing a user cannot be expected to guess.