Functional Weave
Code in TypeScript

lending.affordability@1.0.0

README.md

2,440 bytes · view raw

# lending.affordability

Two numbers an underwriter looks at for a new loan, repaid monthly:

- **Debt-to-income (DTI)**: existing monthly debt payments plus the new
  loan's repayment, as a share of monthly income, in basis points
  (3138 = 31.38%).
- **Stressed DTI**: the same with the new loan's repayment recalculated at a
  higher stress rate, and whether that stays within the lender's ceiling.

It returns both repayments, both ratios, `affordable` (the stressed ratio is
within `maxDebtToIncomeBasisPoints`) and `headroom`: how much monthly
repayment room is left under the ceiling after the stressed repayment, which
is negative when the loan does not fit.

## Rounding, all against the borrower

An affordability test that passes on a rounding is not a test, so:

- both repayments come from lending.loan-payment rounded `up`;
- both ratios are rounded up to the next basis point, which makes
  `affordable` exactly the comparison (commitments + repayment) / income
  <= ceiling, with no rounding in it;
- the allowance (income × ceiling) behind `headroom` is rounded down, with
  money.apply-rate.

## The stress rate is yours

The stress rate is an argument, not a rule in code, because there is no
single published one. In the UK, MCOB 11.6.18R requires a mortgage lender to
take account of likely future interest rate rises over at least the first
five years (not where the rate is fixed for five years or more), having
regard to market expectations. The Bank of England Financial Policy
Committee's specific test (the reversion rate plus 3 percentage points) was
withdrawn with effect from 1 August 2022. Sources: FCA, "Interest rate 'stress
test' rule – application of MCOB 11.6.18R",
https://www.fca.org.uk/firms/interest-rate-stress-test-rule ; Bank of
England, "Financial Policy Committee confirms withdrawal of mortgage market
affordability test" (June 2022),
https://www.bankofengland.co.uk/news/2022/june/financial-policy-committee-confirms-withdrawal-of-mortgage-market-affordability-test .
The ceiling is the lender's policy too.

## What it does not do

- Loan-to-income (the FPC's 4.5× income flow limit is about the loan size,
  not the repayment): divide the loan by annual income.
- Expenditure, household size or the income the lender is willing to count:
  pass the income after whatever haircut the policy applies.
- Interest-only or part-and-part loans: the repayment is always capital and
  interest.