Skip to content

Jane511/RAROC-pricing-and-return-hurdle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commercial RAROC Pricing & Return Hurdle Project

This repository is the pricing and return-hurdle layer in the commercial credit-risk stack. It uses synthetic facility-level risk inputs shaped like upstream PD, LGD, expected loss, and stress outputs to produce minimum margin tables, pricing recommendations, and risk-return summaries. The project shows how risk signals can be translated into explainable commercial lending pricing views for both bank-style risk-adjusted pricing and practical lending decisioning.

What this repo is

This project demonstrates a simplified pricing workflow for commercial lending. It is designed as a public portfolio project, so the pricing logic stays transparent and practical rather than trying to imitate a production treasury, credit policy, or governance stack in full detail.

Where it sits in the stack

Upstream inputs:

  • PD-and-scorecard-commercial
  • LGD-commercial
  • expected-loss-engine-commercial
  • stress-testing-commercial

Downstream consumers:

  • pricing discussion and deal screening
  • portfolio steering and profitability review
  • management reporting and presentation material

How this is used in practice

This project can be applied in:

Bank / Institutional context

  • Risk-adjusted pricing and return-hurdle review for lending opportunities
  • Portfolio profitability analysis by segment, product, and risk grade
  • Structured pricing discussion linked back to expected loss and stress outputs

Non-bank / Fintech context

  • Approval strategy optimisation using margin, hurdle, and risk-return trade-offs
  • Pricing guidance for originations teams and credit decisioning workflows
  • Portfolio performance review by cohort, product, or borrower segment

Example input datasets

  • data/raw/facility_risk_inputs.csv: synthetic facility-level pricing input set with PD, LGD, EAD, expected loss, stressed expected loss, tenor, and current margin fields.
  • data/external/product_cost_assumptions.csv: product-level operating cost, margin floor, and capital addon assumptions.
  • data/external/reference_rate_curve.csv: benchmark rate curve used to attach base pricing assumptions by tenor.

Key outputs

  • outputs/tables/price_recommendations.csv
  • outputs/tables/minimum_margin_table.csv
  • outputs/tables/risk_return_summary.csv
  • outputs/reports/validation_summary.csv
  • outputs/samples/facility_pricing_sample.csv
  • data/interim/pricing_inputs_enriched.csv
  • data/processed/pricing_engine_results.csv

Example outputs

  • outputs/tables/price_recommendations.csv: facility-level pricing action list showing hurdle status and recommended margin changes.
  • outputs/tables/minimum_margin_table.csv: product and risk-grade view of minimum viable pricing by segment.
  • outputs/tables/risk_return_summary.csv: aggregated risk-return view by segment, product, and grade.
  • outputs/samples/facility_pricing_sample.csv: concise sample of priced facilities for quick review.
  • outputs/reports/validation_summary.csv: validation checks covering missing inputs, pricing bounds, negative spreads, and reconciliation.
  • data/interim/pricing_inputs_enriched.csv: pre-engine table after attaching product costs and reference curve inputs.
  • data/processed/pricing_engine_results.csv: full priced facility dataset with recommended margin, all-in rate, and hurdle classification.

End-to-end workflow

  1. Load the synthetic facility risk input table plus product assumptions and the reference rate curve.
  2. Attach pricing features such as funding spread, operating cost, and economic capital.
  3. Translate expected loss and stressed expected loss into cost-of-risk and buffer components.
  4. Calculate minimum margin, recommended pricing, and all-in rates at facility level.
  5. Aggregate outputs into minimum-margin tables, price recommendations, and segment-level risk-return summaries.
  6. Write validation, sample outputs, and processed datasets for reviewer inspection.

Example business use case

A credit team wants to know which facilities currently clear the return hurdle and which deals need repricing or renewed credit review. This repo surfaces that directly: the reviewer can open price_recommendations.csv to see margin actions, then use risk_return_summary.csv to understand whether the issue is concentrated in a product, segment, or risk-grade pocket.

How these outputs can be used downstream

  • portfolio-monitor-commercial: outputs/tables/price_recommendations.csv can be treated as a repricing/watchlist input for monitoring packs.
  • RWA-capital-commercial: outputs/tables/risk_return_summary.csv can be paired with capital summaries to show “return vs capital” at segment level.
  • Presentation handoff: outputs/samples/facility_pricing_sample.csv is a quick reviewer-friendly excerpt for slides or a deal screen example.

Repo structure

  • data/: raw, interim, processed, and external pricing inputs
  • src/: reusable pricing, return-hurdle, and validation modules
  • scripts/: wrapper scripts for pipeline execution
  • docs/: methodology, assumptions, data dictionary, and validation notes
  • notebooks/: walkthrough notebooks for reviewer context
  • outputs/: exported tables, reports, and sample artifacts
  • tests/: validation and regression checks

How to run

Quick start:

pip install -r requirements.txt
python -m src.run_pipeline --refresh-inputs

Or use the wrapper script:

python scripts/run_pipeline.py --refresh-inputs

After the run, start with:

  • outputs/tables/price_recommendations.csv
  • outputs/tables/risk_return_summary.csv
  • outputs/reports/validation_summary.csv

Run tests:

python -m pytest

Testing and validation

  • tests/test_pipeline.py runs the pipeline end to end and confirms the core output files are written.
  • tests/test_raroc.py checks that the pricing engine creates minimum-margin, recommended-margin, and hurdle-status fields.
  • tests/test_validation.py verifies that negative spreads and reconciliation breaks are caught by the validation layer.
  • tests/test_ftp.py checks that pricing features attach product cost assumptions, reference-curve inputs, and economic capital fields correctly.
  • The generated outputs/reports/validation_summary.csv gives a concise reviewer-facing summary of the same practical control checks.

Limitations / Demo-Only Note

  • All pricing inputs are synthetic and included for demonstration only.
  • Funding, capital, operating-cost, and return-hurdle mechanics are intentionally simplified so the workflow remains easy to review.
  • The repo is not a production bank pricing engine, treasury transfer pricing framework, or governance-approved pricing process.

About

Commercial pricing and return-hurdle repo for minimum margin views, pricing recommendations, and risk-return summaries across bank-style and non-bank lending contexts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors