Inputs to MusdClient.drawForMargin: the collateral, and the margin the caller chooses.

interface DrawForMarginParams {
    account?: `0x${string}`;
    collateral: bigint;
    horizonSeconds: bigint;
    price?: bigint;
    priceFallBps: bigint;
}

Hierarchy (View Summary)

Properties

account?: `0x${string}`

The account that would open the Trove. Supply it whenever you have it (MK-067, MK-106).

The borrowing fee is skipped entirely for a fee exempt account (BorrowerOperations.sol:637-643), and the exempt cohort is NOT empty on mainnet, so for such a caller the largest valid draw is LARGER than the one this returns without it. Omitted, the calculation assumes the account is not exempt, exactly as previewOpen does with the same absence. useBorrowingPower supplies the connected wallet when the caller does not.

It has no effect in Recovery Mode, where the fee is skipped for everyone and the mode is read from the chain rather than from this parameter.

collateral: bigint
horizonSeconds: bigint

How long the position must survive, in seconds. Required, with no default (MK-240): the library cannot know how long a position will be held. Covers the interest the Trove accrues over that time at the rate it would open with. 0n asks for no interest allowance, which is a choice and is reported as one. The price history for choosing it is on drawForMargin.

when absent or negative.

price?: bigint

Override the price; defaults to fetchPrice().

priceFallBps: bigint

The fall in the BTC price, in basis points of the price at the read, the position must survive. Required, with no default (MK-240), from 0n up to but excluding 10_000n.

when absent or outside 0n <= priceFallBps < 10_000n.