quantkit-rs 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/CHANGELOG.md +16 -3
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/Cargo.toml +1 -1
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/PKG-INFO +2 -2
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/README.md +3 -3
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/RELEASE_NOTES_0.2.0.md +9 -6
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/compatibility.md +29 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/Cargo.lock +2 -2
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/Cargo.toml +2 -2
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/README.md +1 -1
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/src/lib.rs +919 -15
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/tests/test_quantkit.py +126 -0
- quantkit_rs-0.2.1/quantkit/__init__.pyi +284 -0
- quantkit_rs-0.2.1/quantkit/export.py +93 -0
- quantkit_rs-0.2.1/quantkit/polars_ext.py +148 -0
- quantkit_rs-0.2.1/src/bachelier.rs +291 -0
- quantkit_rs-0.2.1/src/basket.rs +349 -0
- quantkit_rs-0.2.1/src/black76.rs +149 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/dataset.rs +35 -7
- quantkit_rs-0.2.1/src/exotics.rs +379 -0
- quantkit_rs-0.2.1/src/gex.rs +177 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/greeks.rs +117 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/implied_vol.rs +17 -2
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/lib.rs +20 -3
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/mc.rs +54 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/risk.rs +182 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/surface.rs +805 -4
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/.gitattributes +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/.gitignore +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/LICENSE-APACHE +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/LICENSE-APACHE.txt +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/LICENSE-MIT +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/LICENSE-MIT.txt +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/THIRD_PARTY_NOTICES.txt +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/benches/pricing.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/benches/throughput.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/BENCHMARKS.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/NUMERICS.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/RELEASING.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/VERSIONING.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/audit-fixes.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/dependency-review.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/market-gap-report.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/release-readiness.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/docs/release-validation-2026-10-24.md +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/examples/ml_dataset.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/examples/monte_carlo_and_surface.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/examples/price_with_greeks.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/examples/var_from_returns.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/pyproject.toml +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/LICENSE-APACHE.txt +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/LICENSE-MIT.txt +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/python/THIRD_PARTY_NOTICES.txt +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/quantkit/__init__.py +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/quantkit/py.typed +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/batch.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/binomial.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/black.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/bsm.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/detailed.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/dist.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/error.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/limits.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/linalg.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/src/option.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/audit_regressions.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/black_accuracy.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/domain.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/no_panic.proptest-regressions +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/no_panic.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/properties.proptest-regressions +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/properties.rs +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/references.proptest-regressions +0 -0
- {quantkit_rs-0.2.0 → quantkit_rs-0.2.1}/tests/references.rs +0 -0
|
@@ -6,6 +6,19 @@ follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.1] - 2026-12-04
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `bachelier`, `basket`, `black76`, `exotics`, `gex` modules: normal-model (Bachelier) pricing/Greeks/implied vol including negative strikes and forwards; multi-asset basket pricing via Levy moment matching and Cholesky Monte Carlo; Black-76 pricing/Greeks/implied vol for forwards and futures; analytical Reiner-Rubinstein barrier and geometric/arithmetic Asian option pricing; chain-level dealer gamma/vanna/charm exposure with walls and gamma flip.
|
|
13
|
+
- `greeks::analytic_second_order` / `SecondOrderGreeks`: closed-form vanna, volga, charm, speed, color.
|
|
14
|
+
- `risk::backtest_var` / `VarBacktestReport`: out-of-sample VaR/ES backtesting with Kupiec POF and Christoffersen independence / conditional coverage tests (exact chi-squared survival functions).
|
|
15
|
+
- `mc`: `Rng::jump` / `long_jump` / `jumped` for independent RNG sub-streams.
|
|
16
|
+
- `dataset::generate_with_svi`: SVI-smile-consistent synthetic dataset generation.
|
|
17
|
+
- Python bindings and `.pyi` stub for all of the above; `python/quantkit/export.py`, `polars_ext.py` helpers.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- `implied_vol`: the log-domain solver now takes Halley's-method steps (falling back to Newton, then geometric bisection, when a step leaves the bracket), converging in fewer iterations than the previous Newton-only solver. Public signatures are unchanged.
|
|
21
|
+
|
|
9
22
|
### Fixed
|
|
10
23
|
- Numerical Greeks now propagate pricer errors instead of treating them as parameter boundaries and silently switching stencils.
|
|
11
24
|
- Extreme CRR trees use log-domain rollback instead of silently losing terminal stock nodes to underflow. Non-finite results are errors.
|
|
@@ -21,9 +34,9 @@ Validation of these changes is recorded in `docs/audit-fixes.md`. Earlier compat
|
|
|
21
34
|
|
|
22
35
|
## [0.2.0]
|
|
23
36
|
|
|
24
|
-
Initial experimental release
|
|
37
|
+
Initial experimental release, published to PyPI as `quantkit-rs` 0.2.0 on 2026-10-24 (not yet on crates.io). The `0.x` API may change between minor versions (see `docs/VERSIONING.md`).
|
|
25
38
|
|
|
26
|
-
|
|
39
|
+
This is the first published version, so the "Changed" items are
|
|
27
40
|
differences from the earlier 0.2.0 development snapshot (commit `02a6393`), listed
|
|
28
41
|
so that code written against it can be migrated.
|
|
29
42
|
|
|
@@ -36,7 +49,7 @@ so that code written against it can be migrated.
|
|
|
36
49
|
- CI now triggers on pushes to `main` or `master`, on pull requests and manually (`workflow_dispatch`); jobs for Rust on three operating systems, the Rust 1.74 check (library, tests, benches, examples, doctests), a Python 3.9/3.11/3.13 x NumPy matrix that tests the installed wheel, an sdist build-and-test job, and a version-consistency check. First green run on GitHub: commit `9a28f6e` (all 13 jobs on Linux, macOS and Windows).
|
|
37
50
|
- Compatibility evidence recorded in `docs/release-readiness.md`: the wheel on CPython 3.9-3.13 with NumPy 1.21.6-2.5.4 (Windows), Rust 1.74.1 for all targets, and an sdist install.
|
|
38
51
|
- The source distribution no longer contains build outputs, and both the wheel and the sdist carry the licence files (`python/LICENSE-*.txt` are copies of the root licences).
|
|
39
|
-
- `docs/RELEASE_NOTES_0.2.0.md`
|
|
52
|
+
- `docs/RELEASE_NOTES_0.2.0.md` and `docs/release-readiness.md`.
|
|
40
53
|
|
|
41
54
|
### Added
|
|
42
55
|
- `black` module: the normalised Black function evaluated stably far out of the money (`normalised_otm`, `ln_normalised_otm`, `ln_normalised_vega`).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: quantkit-rs
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Topic :: Office/Business :: Financial
|
|
6
6
|
Requires-Dist: numpy>=1.22.0
|
|
@@ -18,7 +18,7 @@ Project-URL: Repository, https://github.com/harikrishnaps306-cloud/quantkit
|
|
|
18
18
|
|
|
19
19
|
# quantkit (Python)
|
|
20
20
|
|
|
21
|
-
Python bindings for the Rust [`quantkit`](../README.md) library
|
|
21
|
+
Python bindings for the Rust [`quantkit`](../README.md) library. Install with `pip install quantkit-rs`; the import name is `quantkit`.
|
|
22
22
|
|
|
23
23
|
```python
|
|
24
24
|
import numpy as np
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/harikrishnaps306-cloud/quantkit/actions/workflows/ci.yml)
|
|
4
4
|
|
|
5
|
-
`quantkit` is
|
|
5
|
+
`quantkit` is a Rust crate (with Python/NumPy bindings, published on PyPI as `quantkit-rs`) for options pricing and investment risk. It prices European options with Black-Scholes-Merton (continuous dividend yield), American options on a Cox-Ross-Rubinstein tree and with Longstaff-Schwartz Monte Carlo, solves implied volatility, computes Greeks, builds and checks volatility surfaces, and reports VaR, CVaR, Sharpe, Sortino and drawdown. Two things are meant to set it apart: **batch results that say why each row failed** (status code plus solver or Monte Carlo diagnostics, instead of a bare `NaN`) and **reproducible, self-auditing synthetic datasets** for pricing models. Inputs are validated against a documented supported domain, every fallible call returns a `Result`, and the core is `#![forbid(unsafe_code)]` with two required dependencies (`thiserror`, `libm`).
|
|
6
6
|
|
|
7
|
-
Status: **initial experimental release candidate, version 0.2.0**.
|
|
7
|
+
Status: **initial experimental release candidate, version 0.2.0**. Version 0.2.0 is on PyPI as `quantkit-rs` (`pip install quantkit-rs`) and is not yet on crates.io. The GitHub Actions workflow has run green once on Linux, macOS and Windows (details and limits in [docs/compatibility.md](docs/compatibility.md)). The public API is `0.x`: breaking changes may occur in any minor release and only there; see [docs/VERSIONING.md](docs/VERSIONING.md) for the policy, [docs/RELEASING.md](docs/RELEASING.md) for how releases are made and [docs/RELEASE_NOTES_0.2.0.md](docs/RELEASE_NOTES_0.2.0.md) for what is most likely to move. See [docs/NUMERICS.md](docs/NUMERICS.md) for exact conventions and guarantees, [docs/BENCHMARKS.md](docs/BENCHMARKS.md) for measured performance, [docs/market-gap-report.md](docs/market-gap-report.md) for how the feature choices were made, and [docs/release-readiness.md](docs/release-readiness.md) for what has and has not been validated.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -86,7 +86,7 @@ Runnable examples are in [`examples/`](examples): `price_with_greeks`, `var_from
|
|
|
86
86
|
cd python && pip install maturin numpy && maturin develop --release
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
The PyPI distribution is named `quantkit-rs` (the name `quantkit` belongs to an unrelated project); the import name is `quantkit
|
|
89
|
+
The PyPI distribution is named `quantkit-rs` (the name `quantkit` belongs to an unrelated project); the import name is `quantkit`: `pip install quantkit-rs`, then `import quantkit`.
|
|
90
90
|
|
|
91
91
|
```python
|
|
92
92
|
import numpy as np, quantkit as qk
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# quantkit 0.2.0: initial experimental release (
|
|
1
|
+
# quantkit 0.2.0: initial experimental release (PyPI `quantkit-rs`; not yet on crates.io)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
First public release, experimental. Published to PyPI as `quantkit-rs` 0.2.0 on
|
|
4
|
+
2026-10-24; not published to crates.io. Tag `v0.2.0` is commit `df7d034`.
|
|
5
5
|
|
|
6
6
|
## What this is
|
|
7
7
|
|
|
@@ -59,7 +59,7 @@ Details and exact versions: `docs/release-readiness.md`.
|
|
|
59
59
|
|
|
60
60
|
## Known limitations
|
|
61
61
|
|
|
62
|
-
* CI has run once to green (`9a28f6e`); only the combinations in `docs/compatibility.md` are covered, and
|
|
62
|
+
* CI has run once to green (`9a28f6e`); only the combinations in `docs/compatibility.md` are covered, and the published wheels were installed from PyPI on GitHub-hosted Linux, macOS and Windows runners only (six rows in `docs/compatibility.md`), not on other machines.
|
|
63
63
|
* Bitwise reproducibility of Monte Carlo and dataset outputs was observed on one
|
|
64
64
|
target only; the design (pure `libm`, fixed evaluation order) is not a proof.
|
|
65
65
|
* The solver is not Jaeckel's "Let's Be Rational" and needs several evaluations.
|
|
@@ -67,14 +67,17 @@ Details and exact versions: `docs/release-readiness.md`.
|
|
|
67
67
|
against the book and are not used as references.
|
|
68
68
|
* No SSVI, no exotics, no stochastic-volatility models, no live data.
|
|
69
69
|
|
|
70
|
-
## How to try it
|
|
70
|
+
## How to try it
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
73
|
# Rust: from a checkout
|
|
74
74
|
cargo add --path path/to/quantkit # or a path dependency in Cargo.toml
|
|
75
75
|
cargo run --example price_with_greeks
|
|
76
76
|
|
|
77
|
-
# Python:
|
|
77
|
+
# Python: from PyPI (Linux x86-64, macOS arm64, Windows x86-64 wheels; others build the sdist)
|
|
78
|
+
pip install quantkit-rs
|
|
79
|
+
|
|
80
|
+
# Python: or build and install a wheel from a checkout
|
|
78
81
|
cd python && pip install maturin numpy && maturin develop --release
|
|
79
82
|
```
|
|
80
83
|
|
|
@@ -113,6 +113,35 @@ Platform tags of the artifacts, as printed by the inspection step:
|
|
|
113
113
|
So the Linux wheel needs glibc 2.17 or newer, and the macOS wheel runs on Apple
|
|
114
114
|
silicon with macOS 11 or newer; Intel Macs, Linux ARM and musl get no wheel.
|
|
115
115
|
|
|
116
|
+
## Installed from PyPI (published `quantkit-rs` 0.2.0, GitHub-hosted runners)
|
|
117
|
+
|
|
118
|
+
Workflow `verify-pypi.yml`, run 40132786601 on `d1c459a`
|
|
119
|
+
(https://github.com/harikrishnaps306-cloud/quantkit/actions/runs/40132786601), all
|
|
120
|
+
six rows passed. Each row installed `quantkit-rs==0.2.0` from PyPI with
|
|
121
|
+
`--only-binary=:all:` into a clean virtualenv (so each platform's published wheel
|
|
122
|
+
was the one used, never a source build), checked that the import came from
|
|
123
|
+
`site-packages` and that the licence notices were installed, ran the pricing and
|
|
124
|
+
implied-volatility smoke test from an empty directory, and ran the `v0.2.0` tag's
|
|
125
|
+
test-suite (23 tests) against the installed package.
|
|
126
|
+
|
|
127
|
+
| platform | CPython | NumPy requested | result |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| Linux x86-64 (ubuntu-24.04) | 3.9 | 1.22.0 | pass |
|
|
130
|
+
| Linux x86-64 (ubuntu-24.04) | 3.13 | newest | pass |
|
|
131
|
+
| macOS arm64 (macos-latest) | 3.11 | 1.26.4 | pass |
|
|
132
|
+
| macOS arm64 (macos-latest) | 3.13 | newest | pass |
|
|
133
|
+
| Windows x86-64 (windows-latest) | 3.9 | 1.22.0 | pass |
|
|
134
|
+
| Windows x86-64 (windows-latest) | 3.13 | newest | pass |
|
|
135
|
+
|
|
136
|
+
"Newest" resolved to NumPy 2.5.4 in the logs that were read (the Ubuntu 3.13 row
|
|
137
|
+
of the first, partly failed run); the final run's resolved versions were not
|
|
138
|
+
inspected row by row. Python patch versions were whatever `setup-python` supplied.
|
|
139
|
+
A first run (40132557434, `5d3ac4b`) failed on the Ubuntu rows and macOS 3.11
|
|
140
|
+
because of a broken pipe in the workflow's own `pip show | head` line; the package
|
|
141
|
+
had installed correctly and the later steps had not run, so that run is not
|
|
142
|
+
counted. Not covered: other interpreters, other NumPy releases, Intel macOS, Linux
|
|
143
|
+
ARM, musl, and any machine that is not a fresh GitHub-hosted runner.
|
|
144
|
+
|
|
116
145
|
## Not tested
|
|
117
146
|
|
|
118
147
|
* Linux and macOS (any interpreter), ARM, musl; the wheels built there.
|
|
@@ -214,7 +214,7 @@ dependencies = [
|
|
|
214
214
|
|
|
215
215
|
[[package]]
|
|
216
216
|
name = "quantkit"
|
|
217
|
-
version = "0.2.
|
|
217
|
+
version = "0.2.1"
|
|
218
218
|
dependencies = [
|
|
219
219
|
"libm",
|
|
220
220
|
"rayon",
|
|
@@ -223,7 +223,7 @@ dependencies = [
|
|
|
223
223
|
|
|
224
224
|
[[package]]
|
|
225
225
|
name = "quantkit-py"
|
|
226
|
-
version = "0.2.
|
|
226
|
+
version = "0.2.1"
|
|
227
227
|
dependencies = [
|
|
228
228
|
"numpy",
|
|
229
229
|
"pyo3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "quantkit-py"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.1"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["Harikrishna Paykatt Valliaparambil"]
|
|
6
6
|
description = "Python bindings for the quantkit options pricing and risk library."
|
|
@@ -17,5 +17,5 @@ crate-type = ["cdylib"]
|
|
|
17
17
|
[dependencies]
|
|
18
18
|
numpy = "0.30.0"
|
|
19
19
|
pyo3 = { version = "0.30.1", features = ["abi3-py39"] }
|
|
20
|
-
quantkit = { version = "0.2.
|
|
20
|
+
quantkit = { version = "0.2.1", path = "..", features = ["parallel"] }
|
|
21
21
|
rayon = "1.12.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# quantkit (Python)
|
|
2
2
|
|
|
3
|
-
Python bindings for the Rust [`quantkit`](../README.md) library
|
|
3
|
+
Python bindings for the Rust [`quantkit`](../README.md) library. Install with `pip install quantkit-rs`; the import name is `quantkit`.
|
|
4
4
|
|
|
5
5
|
```python
|
|
6
6
|
import numpy as np
|