The margin MarginDraw.draw was solved with, as the caller supplied it.

interface DrawMargin {
    accrualFraction: bigint;
    horizonSeconds: bigint;
    interestRateBps: bigint;
    priceFallBps: bigint;
    stressedPrice: bigint;
}

Properties

accrualFraction: bigint

Interest over horizonSeconds at that rate, as a 1e18 fraction of the debt, rounded up.

horizonSeconds: bigint

The horizon the caller asked for, in seconds.

interestRateBps: bigint

interestRateManager.interestRate(), in basis points: the rate a Trove opened now carries (BorrowerOperations.sol:668-672), which is what accrues on it.

priceFallBps: bigint

The price fall the caller asked for, in basis points.

stressedPrice: bigint

The price draw is solved against: price * (1 - priceFall) / (1 + accrual). Every open gate, the individual ratio and the resulting system ratio alike, scales with the price, so clearing them at this price clears them after that fall and that accrual.