In retail banking and NBFC loan underwriting, determining how much a borrower can safely repay comes down to one core metric: the Fixed Obligation to Income Ratio (FOIR).
While spreadsheets work for single manual checks, digital lending pipelines and credit decisioning APIs require deterministic, zero-error Python logic that accounts for net take-home salary, active bureau EMIs, revolving credit card obligations, and reducing-balance loan amortization.
What is FOIR in Credit Underwriting?
FOIR (Fixed Obligation to Income Ratio) measures the percentage of a borrower's net monthly income already committed to fixed debt obligations (home loans, auto loans, personal loan EMIs, and 5% of credit card revolving balances).
Most commercial banks and NBFCs enforce a maximum FOIR cap between 50% and 65% depending on income tier and borrower profile:
$$\text{Max Allowable EMI} = (\text{Net Monthly Income} \times \text{Max FOIR \%}) - \text{Existing Active EMIs}$$
Once the maximum permissible new EMI is isolated, the maximum eligible loan principal is computed using the standard Present Value of Annuity formula:
$$\text{Max Loan Principal} = \text{EMI}_{\text{max}} \times \frac{(1 + r)^n - 1}{r(1 + r)^n}$$
Production-Ready Python FOIR & Loan Eligibility Script
Here is a clean, dependency-light Python implementation used in retail credit underwriting models:
python
def calculate_foir_loan_eligibility(
net_monthly_income: float,
existing_emis: float,
annual_interest_rate: float,
tenure_months: int,
max_foir_pct: float = 0.55
) -> dict:
max_total_obligation = net_monthly_income * max_foir_pct
available_emi_capacity = max(0.0, max_total_obligation - existing_emis)
r = (annual_interest_rate / 100.0) / 12.0
if r > 0 and available_emi_capacity > 0:
pv_factor = (((1 + r) ** tenure_months) - 1) / (r * ((1 + r) ** tenure_months))
max_loan_amount = available_emi_capacity * pv_factor
else:
max_loan_amount = available_emi_capacity * tenure_months
current_foir = (existing_emis / net_monthly_income) * 100 if net_monthly_income > 0 else 100.0
return {
"Current_FOIR_Pct": round(current_foir, 2),
"Max_New_EMI_Capacity": round(available_emi_capacity, 2),
"Max_Eligible_Loan_Amount": round(max_loan_amount, 0)
}
# Example: ₹1,20,000 net salary, ₹18,000 existing EMIs, 9.25% ROI for 15 years (180 months)
result = calculate_foir_loan_eligibility(120000, 18000, 9.25, 180, max_foir_pct=0.55)
print(result)
# Output: {'Current_FOIR_Pct': 15.0, 'Max_New_EMI_Capacity': 48000.0, 'Max_Eligible_Loan_Amount': 4657264.0}
Key Underwriting Edge Cases to Handle in Production
Credit Card Minimum Due Inclusion: Credit bureaus report revolving credit card balances without a fixed EMI. Underwriting rules typically add 5% of the current outstanding card balance into existing_emis.
Co-Applicant Income Clubbing: When clubbing spouse or co-applicant income, apply weighted FOIR slabs based on combined net inflows.
Zero-Interest / Flat-Rate Schemes: Always convert flat-rate consumer durable loans into reducing-balance equivalents before calculating true monthly obligation.
Explore More Banking, Credit Risk & Quant Scripts
You can run the full interactive guide, amortization schedules, DSCR calculators, and 126+ production-ready Python scripts (spanning Retail/MSME Credit Appraisal, Basel Expected Loss, Altman Z-Score, and Algorithmic Trading) on PyQuant Library.
Top comments (0)