Inputs to accruedInterest: a principal, its rate in bips, and a window.

interface AccruedInterestParams {
    principal: bigint;
    rateBps: bigint;
    seconds: bigint;
}

Properties

principal: bigint

The stored PRINCIPAL the interest accrues on, not the entire debt.

This is the whole point of the function (MK-089). InterestRateMath.calculateInterestOwed takes _principal (InterestRateMath.sol:12-22) and every call site passes trove.principal: TroveManager.getEntireDebtAndColl at :788-793 and _redeemCollateralFromTrove at :1236-1241. Accrued interest is NOT part of the base, so interest does not compound.

rateBps: bigint

The rate this position carries, in basis points. Per Trove, never a global.

seconds: bigint

The window, in seconds. Zero or negative accrues nothing.