An educational Python toolkit for annual LBO scenario analysis with explicit cash, debt, revolver, covenant and exit-equity reconciliation.
The repository includes:
- transaction sources and uses;
- senior, mezzanine, bullet, revolver and simplified IFRS-16 debt;
- separate cash and PIK interest;
- cash taxes with a simplified NOL roll-forward;
- minimum-cash funding and revolver draws;
- mandatory amortisation and optional cash sweeps;
- cash and debt roll-forward checks;
- net-debt leverage, cash-interest coverage and cash-flow coverage;
- exit-equity and sponsor-return reconciliation;
- operating and exit sensitivities;
- unconditional Monte Carlo scenario statistics;
- a single-tier European-style fund waterfall;
- a Streamlit dashboard and PDF summary.
python -m venv .venvActivate the environment, then install dependencies:
pip install -r requirements.txtFrom the repository root:
python -m src.modules.orchestrator_advancedGenerated files are written to output/.
streamlit run src/modules/streamlit_app.pypython -m pytest -qRun the same coverage gate used by CI:
python -m pytest -q \
--cov=src/modules \
--cov-report=term-missing \
--cov-fail-under=65Run linting:
python -m ruff check src testsClosing cash
= Opening cash
+ Operating cash generation
+ Operating revolver draw
- Cash-funded mandatory amortisation
- Optional cash sweep
Revolver-funded mandatory amortisation does not pass through ending cash: the draw increases revolver debt and immediately repays the target debt tranche.
Closing debt
= Opening debt
+ Revolver draws
+ PIK interest
- Actual mandatory amortisation
- Optional cash sweep
Exit equity
= Exit enterprise value
- Sale costs
- Closing debt
+ Closing cash
The opening equity cash flow equals the sponsor-equity cheque from the canonical sources-and-uses schedule. Transaction fees, financing fees, OID and retained cash therefore enter sponsor returns directly.
The current waterfall supports one European-style whole-fund tier with:
- pro-rata return of LP and GP contributed capital;
- compounded LP preferred return;
- 100% GP catch-up;
- residual LP/GP split;
- optional cashless carry deferral;
- end-of-life clawback check.
Management fees are treated as separate investor cash outflows and are not deducted from portfolio distributions.
Multi-tier waterfalls and hurdle resets deliberately raise NotImplementedError rather than presenting unsupported economics.
- The model is annual, not monthly or quarterly.
- Tax, interest deductibility and NOL treatment are simplified.
- The IFRS-16 module is assumption-driven and does not reproduce a full lease-accounting schedule.
- Lease principal is modelled through an assumed amortisation period.
- The included Accor inputs are illustrative reconstructed assumptions, not audited transaction data.
- Monte Carlo priors are scenario assumptions, not empirically calibrated forecasts.
- The fund waterfall is simplified and does not replace an LPA-specific legal model.
- Multi-tier waterfalls are not supported.
Developed a Python LBO scenario-analysis toolkit with multi-tranche debt, minimum-cash and revolver mechanics, covenant monitoring, operating sensitivities and Monte Carlo stress testing.
lbo-stack/
├── src/
│ └── modules/
│ ├── lbo_model.py
│ ├── fund_waterfall.py
│ ├── orchestrator_advanced.py
│ └── streamlit_app.py
├── tests/
│ ├── test_invariants.py
│ └── test_fund_waterfall.py
├── data/
├── output/
├── requirements.txt
├── pyproject.toml
└── README.md
MIT