Skip to content

Lending Programs & Products

Lending programs and products define how loans behave. Programs set the rules; products define specific offerings under those rules.

Lending Programs

A lending program is the top-level configuration that determines how a class of loans operates:

Program Types

Program Type Description Key Behaviors
Installment Loan Fixed or variable-rate amortizing loan Standard amortization, interest-only periods, balloon payments, graduated schedules
Lease Equipment or asset lease Residual value, buyout option, asset return
Line of Credit Revolving credit facility Draw/repay cycles, credit limit, variable balance

Each program type is backed by a LendingProgramProtocol implementation (see Provider Pattern) that provides:

  • generate_schedule() --- Creates the amortization schedule on disbursement
  • apply_payment() --- Allocates a payment across fees, interest, and principal
  • calculate_payoff() --- Computes total payoff amount

Program Configuration

Field Description
program_type Installment, lease, or line of credit
day_count_convention How interest is calculated (see below)
accrual_method Simple, compound daily, compound monthly, rule of 78
payment_allocation_order JSONB array defining allocation priority (e.g., ["interest", "fees", "principal"])
is_active Whether new loans can be created under this program

Day-Count Conventions

Convention Calculation Common Use
Actual/360 Actual days in period / 360 Commercial loans
Actual/365 Actual days in period / 365 Consumer loans
30/360 30 days per month / 360 Mortgages
Actual/Actual Actual days / actual days in year Bonds, some consumer loans

The day-count convention affects how daily interest is computed and is applied consistently across amortization, interest accrual, and payoff quotes.

Accrual Methods

Method Description
Simple Interest = Principal × Rate × (Days / Day Count)
Compound Daily Interest compounds daily on the outstanding balance
Compound Monthly Interest compounds monthly
Rule of 78 Front-loaded interest allocation (declining sum of digits)

Payment Allocation Order

The payment_allocation_order JSONB field defines how incoming payments are distributed. A typical order:

["interest", "fees", "principal"]

This means: satisfy all accrued interest first, then outstanding fees, then apply the remainder to principal. The allocation order is enforced by the lending program's apply_payment() method.

Variable Rate Support

Programs can support variable-rate loans:

Field Description
index_name Reference index (e.g., SOFR, Prime)
margin Spread added to the index rate
floor Minimum rate regardless of index
ceiling Maximum rate regardless of index
adjustment_frequency How often rates are recalculated

A daily Celery task adjusts variable-rate loans by looking up the latest index rate, adding the margin, and clamping to floor/ceiling. Rate changes create LoanModification records for audit trail.

Loan Products

Products are specific offerings under a lending program (e.g., "36-Month Fixed Personal Loan"):

Field Description
name Product name
program FK to lending program
interest_rate_type Fixed, variable, or hybrid
default_interest_rate Default rate for new loans (decimal)
min_term_months / max_term_months Allowed term range
min_loan_amount / max_loan_amount Allowed amount range
grace_period_days Days before a payment is considered late
program_config JSONB for program-type-specific overrides

Products inherit program-level settings and add product-specific constraints. Fee schedules are linked to products (see Fee Management).

Index Rates

For variable-rate products, the system maintains index rate tables:

Field Description
index_name Name of the index (e.g., SOFR, Prime, LIBOR)
rate Current rate (decimal)
effective_date When this rate took effect
trailing_12_month_average Rolling 12-month average rate

Index rates are managed via the admin dashboard and used by the daily variable rate adjustment task.

Promotional Programs

Promotional rate programs provide temporary rate modifications:

Field Description
promo_type Deferred interest, reduced APR, zero interest, or skip payment
start_date / end_date Promotional period
apr Promotional APR (if applicable)
deferred_interest_rate Rate at which deferred interest accrues
min_payment_type / min_payment_amount Minimum payment during promo period

Promotional programs are linked to lending programs and can be assigned to individual loans via PromoRate records.

See Also