Inputs to previewRedeem.

interface PreviewRedeemParams {
    amount: bigint;
    marginSeconds?: bigint;
    maxIterations?: bigint;
    redeemer: `0x${string}`;
}

Properties

amount: bigint

MUSD to redeem.

marginSeconds?: bigint

The accrual window, in seconds, a WHOLE consumption is sized for. Default REDEMPTION_ADVICE_MARGIN_SECONDS, 900, which is what RedemptionPreview.nextViableAmount carries. redeem() checks with REDEMPTION_SEND_MARGIN_SECONDS, 60, so advice read here is not refused by the client that acts on it (MK-104).

maxIterations?: bigint

Cap on the eligible Troves the walk visits, read exactly as the contract reads its own _maxIterations. Default DEFAULT_REDEMPTION_MAX_ITERATIONS, 100.

0n means no limit (MK-114), because that is what redeemCollateral and getRedemptionHints do with zero (TroveManager.sol:353-355, HintHelpers.sol:107-109). The walk still stops as soon as the eligible Troves it has read cover amount, or at the end of the list, so no limit costs as many reads as the request needs and no more. Troves below MCR are skipped without counting, as the contract skips them (MK-107).

when negative or above the largest uint256: the contract takes a uint256, so no such value can be sent.

redeemer: `0x${string}`

The account that would redeem. Its MUSD balance is the gate at :320.