This repository is the EAD and Credit Conversion Factor layer in the public commercial credit-risk stack. It uses synthetic facility data, utilisation assumptions, and product-level CCF logic to estimate funded and unfunded exposure under lending workflows that are relevant to both bank-style risk frameworks and practical lending decisioning. The main outputs feed downstream expected loss, stress testing, pricing, and capital analysis.
This project demonstrates how a commercial lending portfolio can be translated into Exposure at Default measures using transparent, recruiter-friendly logic. It is built as a portfolio project rather than a production bank engine, so the assumptions are explainable and the data is synthetic where internal usage and drawdown history would normally be required.
Upstream inputs:
- facility and limit inputs staged under
data/ - product utilisation and CCF assumptions maintained in-repo
Downstream consumers:
expected-loss-engine-commercialstress-testing-commercialRAROC-pricing-and-return-hurdleRWA-capital-commercial
This project can be applied in:
- EAD estimation for expected loss, stress testing, and capital-style frameworks
- Portfolio exposure measurement across funded and unfunded facilities
- Utilisation and limit analysis for structured risk review
- Exposure measurement for pricing and approval strategy on revolving or contingent products
- Limit-usage assumptions for portfolio performance and risk-adjusted decisioning
- Early portfolio monitoring of drawn versus undrawn exposure risk
data/raw/exposure_master.csv: demo facility-level limits and drawn balances (funded + unfunded)data/raw/demo_portfolio.csv: lightweight portfolio extract used by the demo pipelinedata/manual/ccf_rules.csv: product-level CCF rules and utilisation assumptions
outputs/tables/ead_by_facility.csv: facility-level EAD view used downstreamoutputs/tables/ccf_by_product.csv: product-level CCF summary (sanity-check friendly)outputs/tables/utilisation_uplift_tables.csv: utilisation and uplift curves used by the EAD buildoutputs/tables/pipeline_validation_report.csv: pass/fail checks for required fields and totalsoutputs/reports/pipeline_summary.md: short run summary and file indexoutputs/samples/demo_input.csv: small sample input for quick reviewer inspection
A credit portfolio team needs a consistent “exposure at default” view before building expected loss, stress tests, pricing packs, or capital summaries. This repo turns limits + drawn balances into a facility-level EAD dataset with a clear, reviewable CCF contract.
expected-loss-engine-commercial: usesoutputs/tables/ead_by_facility.csvas the exposure leg of EL.stress-testing-commercial: usesoutputs/tables/ead_by_facility.csvas the base EAD input before applying scenario uplifts.RAROC-pricing-and-return-hurdle: uses EAD-derived exposure to translate EL and stress into cost-of-risk and hurdle pricing.RWA-capital-commercial: usesoutputs/tables/ead_by_facility.csvas the exposure input for RWA and capital summaries.
- facility and borrower portfolio data
- product limit, drawn-balance, and limit-utilisation information
- CCF and utilisation assumptions where detailed behavioural history is unavailable
outputs/tables/ead_by_facility.csvoutputs/tables/ccf_by_product.csvoutputs/tables/utilisation_uplift_tables.csvoutputs/tables/ead_validation_report.csvoutputs/tables/pipeline_validation_report.csv
data/: raw, interim, processed, and external demo inputssrc/: reusable EAD and CCF pipeline logicscripts/: wrapper scripts for running the pipelinedocs/: methodology, assumptions, data dictionary, and validation notesnotebooks/: reviewer-facing walkthrough notebooksoutputs/: exported tables, reports, and sample artifactstests/: validation and regression checks
Quick start:
pip install -r requirements.txt
python -m src.run_pipelineAfter the run, start with:
outputs/reports/pipeline_summary.mdoutputs/tables/ead_by_facility.csvoutputs/tables/pipeline_validation_report.csv
Run validation tests:
python -m pytestAlternative (wrapper script):
python scripts/run_demo_pipeline.pytests/test_demo_pipeline.pyruns a minimal demo pipeline and asserts the expected output files are written.outputs/tables/pipeline_validation_report.csvcaptures the same checks in a reviewer-friendly table.
- All portfolio inputs are synthetic and are included for demonstration only.
- CCF and utilisation behaviour is modelled with simplified, transparent assumptions rather than internal behavioural datasets.
- The repo is intended for portfolio presentation and workflow demonstration, not for production limit management or regulatory reporting.