• The contract's ceiling for a position opened now (MK-100, MK-240). This is an open time calculator and nothing else: it sizes a limit for a position that does not exist yet.

    It answers what the contract accepts, not what to borrow. The ceiling opens a normal mode Trove at exactly MCR, where it is liquidatable within a second (MK-100). A draw sized to survive holding the position is drawForMargin, which takes the horizon and the price fall as required inputs.

    It is NOT the right function for a Trove that already exists. Every Trove carries a maxBorrowingCapacity, coll * price / (110 * 1e16) (BorrowerOperations.sol:1323-1328), set at open, lowered on a collateral decrease (:879-897) and RESET from the current price on every refinance (:1077-1084, MK-101). A debt increase is gated on it (:1358-1365), which this function does not model. For an existing Trove use previewBorrow, which returns a verdict plus the binding constraint (MK-002).

    It does not decide anything about the open rules (MK-067, MK-069). Its feasibility predicate IS evaluateOpen, called per candidate, so the individual ratio, the mode correct threshold, the resulting system TCR and the debt floor all have exactly one implementation in this package and it is not here. borrowing-power-agreement.test.ts asserts that the ceiling is viable to the evaluator and that one wei more is not.

    Cost (MK-010), COUNTED rather than asserted (MK-092). The price, the fee rate, the interest rate and the system totals ride in one multicall; the figure is solved in closed form from the linear fee, and the chain is asked for the real getBorrowingFee once, to CONFIRM the solution. Measured with a counting client, the sequential round trips are:

    normal mode, no account 4 normal mode, with account 5 Recovery Mode, no account 3

    What this function does NOT promise: a single block snapshot (MK-093). price and checkRecoveryMode(price) are separate round trips after the batch, so the system totals the resulting TCR gate uses can come from an earlier block than the price they are measured against.

    Parameters

    Returns Promise<BorrowingPower>

    for a non-positive collateral.