Skip to content

loan_interest_settlement

LoanInterestSettlementRule: settles interest on amortizing loan payment dates.

On each scheduled interest payment date, the borrower remits the interest portion of the monthly payment. The accounting entry clears the Accrued Interest Receivable built up by daily InterestIncomeAccrualRule postings:

Dr  Cash                         (scheduled interest amount)
Cr  Accrued Interest Receivable  (what was actually accrued)
Cr  Interest Income              (catch-up difference)

This follows the same three-leg settlement pattern as CouponPaymentRule for bonds — the AccountingService handles the metadata identically.

Classes:

LoanInterestSettlementRule

Settle interest payments on amortizing loan payment dates.

Reads interest payment dates and amounts from payment_schedule()[0] (the interest_pmt list of the 3-element loan schedule tuple).

Methods:

  • applies_to

    Return True for LONG positions on a scheduled interest payment date.

  • generate

    Generate an interest settlement transaction for the scheduled amount.

applies_to

applies_to(
    instrument: Instrument,
    position: Position,
    context: RuleContext,
) -> bool

Return True for LONG positions on a scheduled interest payment date.

Income-side settlement: Dr Cash / Cr AIR / Cr Interest Income. Skips dates on or before acquisition (no AIR to settle yet).

generate

generate(
    instrument: Instrument,
    position: Position,
    context: RuleContext,
) -> list[Transaction]

Generate an interest settlement transaction for the scheduled amount.