Contributing

Contributions, bug reports, and feature requests are welcome. Open an issue or submit a PR on GitHub.

Development setup

git clone https://github.com/marwinsteiner/interest-rate-models.git
cd interest-rate-models
uv sync --dev
uv run pytest

Adding a model

Short-rate models subclass ShortRateModel in src/interest_rate_models/base.py and implement bond_price and simulate (plus bond_option where the model admits one — cap/floor pricing then comes for free via the replication in the base class). Full-curve models subclass CurveModel. Register the model in the get_model factory in factory.py, export it from the package __init__.py, add a test module mirroring the existing per-model suites (analytic formulas validated against Monte Carlo, parity identities, argument validation), and add a docs page under docs/models/ following the shared structure (overview, dynamics, pricing, parameters, usage, references).

Docstrings contain no formulas — each class links to its documentation page, where the mathematics is rendered properly.

Candidate additions: Black-Karasinski, Black-Derman-Toy, CIR++, shifted/displaced LMM, LMM with stochastic volatility, swaption calibration helpers.

License

MIT