Kiyosi
Kiyosi is an option pricing library with a C++23 core and Python bindings. It provides validated market and instrument types together with analytic, tree-based, finite-difference, integral, and Monte Carlo pricing engines.
Features
- Vanilla, digital, Asian, barrier, accumulator, snowball, and phoenix instruments
- Analytic, binomial, finite-difference, integral, and Monte Carlo engines
- Prices and Greeks through a consistent result type
- Scenario grids, numerical analytics, and implied-value solvers
- Trading calendars and observation schedule builders, including SSE holidays
- Equivalent domain semantics across the Python and C++ APIs
Quick start with Python
Python 3.11 or newer is required:
python -m pip install kiyosi
Price a European call with the analytic Black-Scholes engine:
from datetime import date
from kiyosi.instruments import EuropeanOption, OptionType
from kiyosi.market import BsmParameters, PricingContext
from kiyosi.pricing import AnalyticVanillaEngine
parameters = BsmParameters(
risk_free_rate=0.05,
dividend_yield=0.02,
volatility=0.20,
)
context = PricingContext(
parameters=parameters,
asset_price=100.0,
valuation_time=date(2025, 1, 1),
)
option = EuropeanOption(
type=OptionType.CALL,
strike=100.0,
effective=date(2025, 1, 1),
expiry=date(2026, 1, 1),
)
result = AnalyticVanillaEngine().price(option, context)
print(result.price, result.delta, result["vega"])
The Python API is organized into three modules:
| Module | Contents |
|---|---|
kiyosi.instruments |
Validated derivative instruments and structured-product presets |
kiyosi.market |
Model parameters, valuation contexts, calendars, and schedules |
kiyosi.pricing |
Pricing engines, analytics, scenarios, and implied-value solvers |
Domain validation failures raise KiyosiError with a stable ErrorCategory.
Python conversion failures use the corresponding built-in exception, such as
TypeError or OverflowError.
C++ library
Building the C++ core from source requires CMake 3.28 or newer, Ninja, and a C++23 compiler.
Configure, build, and test with the preset for your platform:
cmake --preset linux-release
cmake --build --preset linux-release
ctest --preset linux-release
Use windows-release on Windows after opening a Visual Studio Developer
PowerShell. Other debug, CI, and sanitizer presets are listed in
CMakePresets.json.
Install the library and link its exported CMake target:
cmake --install out/build/linux-release --prefix out/install/kiyosi
find_package(kiyosi CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE kiyosi::kiyosi)
#include <kiyosi/kiyosi.hpp>
See examples/all_pricing_engines.cpp for
an end-to-end C++ example covering the available instrument and engine families.
License
Kiyosi is available under the MIT License.
Release files for kiyosi 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kiyosi-0.2.0.tar.gz | 249.8 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| kiyosi-0.2.0-cp314-cp314-win_amd64.whl | CPython 3.14 | CPython 3.14 | Windows x86-64 | Details |
| kiyosi-0.2.0-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| kiyosi-0.2.0-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| kiyosi-0.2.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
Total release size: 1.7 MB
Release files / kiyosi-0.2.0.tar.gz
| Download URL | kiyosi-0.2.0.tar.gz |
|---|---|
| Size | 249.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4ff9eb4535bb6dd79206b72185ce8c7ed999c24baee915ca4d701c69f74675e
|
|
BLAKE2b-256 checksum How to use checksums |
efc5d17fc09239dc6e8a0c242d4216386ce1c1bf73ca2ace670db31d8cd5719c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kiyosi-0.2.0-cp314-cp314-win_amd64.whl
| Download URL | kiyosi-0.2.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 368.8 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
812031f79ef7dc2e64014032953010ce76137169bbab09e4e38eb079b036ac6d
|
|
BLAKE2b-256 checksum How to use checksums |
faa84c977e5ed273ce3a8788cec273fd769a8d1e424730d2b8ec334910d40602
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kiyosi-0.2.0-cp313-cp313-win_amd64.whl
| Download URL | kiyosi-0.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 358.8 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f57f9f0e588948535f6e21e9da8d2df15159cdff69093712ebf217d65303bdb2
|
|
BLAKE2b-256 checksum How to use checksums |
4bb061b7f8adcadb56e3d81bca513a81b066c9779ba2d58c97dd03c171c4498a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kiyosi-0.2.0-cp312-cp312-win_amd64.whl
| Download URL | kiyosi-0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 358.7 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7c9a5afe1eafd1c31817b8234cdddd332c8b0735f63012697c7017e42c329f8b
|
|
BLAKE2b-256 checksum How to use checksums |
0654ccdfacee4d302793cbbe34f6f40e7498a4b1affb3ad01b271c51af678f09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kiyosi-0.2.0-cp311-cp311-win_amd64.whl
| Download URL | kiyosi-0.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 358.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4edcde2cd4f79efc51d0831f2859b91211e8a2b518034d222dda7adbe75b25c9
|
|
BLAKE2b-256 checksum How to use checksums |
62c7d7ff3ff489b55323a9ffbf4a77b9d6d105ad56127d7644e576fb66e0c2e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|