Skip to content

Repository files navigation

OYL - Loan Servicing Calculator

A comprehensive loan servicing capacity calculator that predicts borrowing capacity across 47+ Australian lenders.

Features

  • Multiple Income Types: PAYG, self-employment, directors wages, non-taxable income
  • Lender-Specific Calculations:
    • Credit card assessment rates (3.00% - 3.90% depending on lender)
    • HEM (Household Expenditure Measure) per lender
    • Assessment rates by loan amount
  • Tax Deduction Support: For investment loans
  • Multi-Applicant: Single or couple applications
  • 47+ Lenders: Major banks, credit unions, and non-bank lenders
  • Web Interface: Beautiful, modern UI for easy calculations

Quick Start

Local Development

  1. Install dependencies:
pip install -r requirements.txt
  1. Run the app:
python main.py
  1. Open browser:
http://localhost:5000

Replit Deployment

  1. Import this repository to Replit
  2. Replit will auto-detect main.py and install dependencies
  3. Click "Run" - that's it!

Project Structure

oyl/
├── main.py                          # Flask web app (Replit entry point)
├── requirements.txt                 # Python dependencies
├── servicing/
│   ├── predict_from_profiles.py    # Core calculation engine
│   ├── build_lender_profiles.py    # Profile builder
│   ├── lender_profiles.json        # Lender parameters (47 lenders)
│   ├── templates/
│   │   └── index.html              # Web UI
│   └── README.md                   # Detailed servicing docs
├── data/
│   └── nov-2025/
│       ├── hems.json               # Household Expenditure Measure data
│       └── rates.json              # Assessment rates by loan amount
└── raw/                            # Quickli source data

Usage

Web Interface

Simply open the app and fill in the form:

Basic Example:

  • Loan Type: Owner Occupied
  • Loan Amount: $500,000
  • Taxable Income: $100,000
  • Click "Calculate Servicing"

With Self-Employment:

  • Taxable Income: $135,000 (directors wages)
  • Self-Employed Income: $67,500 (adjusted net profit)

With Credit Cards:

  • Total Credit Card Limits: $25,000 (sum of all cards)
  • System automatically applies lender-specific rates

Command Line

# Create a scenario file
cat > scenario.json << 'EOF'
{
  "loan_type": "investment",
  "is_tax_deductible": true,
  "dependents": 0,
  "existing_loan_monthly_payments": 0,
  "total_credit_card_limits": 10000,
  "proposed_loan_amount": 1000000,
  "proposed_loan_term_years": 30,
  "applicant1": {
    "taxable_income": 135000,
    "self_employed_income": 67500,
    "non_taxable_income": 0
  }
}
EOF

# Run prediction
python servicing/predict_from_profiles.py scenario.json

Key Features Explained

Self-Employment Income

For business owners, directors, and sole traders:

  • Directors wagestaxable_income (treated like PAYG)
  • Net profit (adjusted)self_employed_income
  • Both are combined and taxed normally (no discount/shading)

Calculate adjusted net profit externally:

  1. Net Profit Before Tax
  2. Add back: Interest, Depreciation, IAWO, Super, Lease/HP
  3. Remove non-recurring items
  4. Average over 2 years
  5. Apply ownership percentage

Credit Card Assessment

Different lenders use different rates:

  • Firstmac: 3.23% (most favorable!)
  • VMG, Wave Money, WLTH: 3.00%
  • Most lenders: 3.80% (standard)
  • AFG, Bank Australia: 3.82%
  • Thinktank: 3.90% (highest)

System automatically applies the correct rate per lender.

Tax Deductible Investment Loans

For investment loans where interest is tax-deductible:

  • Set is_tax_deductible: true
  • System calculates tax benefit and adds to net income
  • Optionally specify applicant_tax_benefit_split: [50, 50] for couples

Supported Lenders

AFG, AMP, ANZ, Assetline, Athena, Auswide, Bank Australia, Bank of Sydney, Bank of Us, Bankwest, Bendigo, Beyond, Bluestone, BOQ, Brighten, CBA, CUSA, Firstmac, Gateway, GSB, Heritage, HSBC, ING, La Trobe, Liberty, Macquarie, MA Money, ME Bank, MyState, NAB, Newcastle Permanent, OwnHome, Pepper, P&N Bank, Qudos, RedZed, Resimac, St.George, Suncorp, Teachers Mutual, Thinktank, VMG, Wave Money, Westpac, WLTH, 86 400, and more.

Requirements

  • Python 3.7+
  • Flask 3.0.0
  • No other dependencies!

Documentation

  • servicing/README.md - Detailed servicing calculation docs
  • servicing/README_APP.md - Web app specific documentation
  • TAX_DEDUCTION_FIX_SUMMARY.md - Tax deduction implementation details

Development

Running Tests

# Test basic scenario
python servicing/predict_from_profiles.py servicing/scenario.json

# Test with tax deduction
python servicing/predict_from_profiles.py servicing/test_tax_deduct.json

Building Profiles

If you have new Quickli data:

cd servicing
python build_lender_profiles.py
python compile_hems.py
python compile_rates.py

License

Private project.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages