Kiyosi
Kiyosi is a modern C++23 derivatives-pricing library with Python bindings, offering consistent APIs for vanilla, exotic, and structured products.
Features
- Vanilla, digital, Asian, barrier, accumulator, snowball, and phoenix instruments
- Analytic, tree-based, finite-difference, integral, and Monte Carlo pricing engines with CPU and CUDA backends
- Prices and Greeks through a consistent result type
- Numerical analytics, implied volatility, and implied coupon solvers
- Trading calendars and observation schedule builders, including SSE holidays
- A native C++ core exposed through a Python-first API
Quick start with Python
Kiyosi requires Python 3.11 or newer:
python -m pip install kiyosi
PyPI provides prebuilt x64 wheels for Windows and Linux, including CUDA acceleration for Monte Carlo engines. CPU remains the default; using CUDA requires a compatible NVIDIA GPU and driver. On other platforms, installation builds from source and requires CMake 3.28 or newer, Ninja, and a C++23 compiler.
Price a European call with the analytic Black-Scholes engine:
from datetime import date
from kiyosi.instruments import EuropeanOption, OptionType
from kiyosi.market import BlackScholesMertonParameters, PricingContext
from kiyosi.pricing import AnalyticVanillaEngine
valuation = date(2025, 1, 1)
option = EuropeanOption(
option_type=OptionType.CALL,
strike=100.0,
effective_date=valuation,
expiry_date=date(2026, 1, 1),
)
context = PricingContext(
model_parameters=BlackScholesMertonParameters(
risk_free_rate=0.05,
dividend_yield=0.02,
volatility=0.20,
),
spot_price=100.0,
valuation_time=valuation,
)
result = AnalyticVanillaEngine().price(option, context)
print(result.price)
The Python API is organized into three modules:
| Module | Contents |
|---|---|
kiyosi.instruments |
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 |
Select the CUDA backend on any Monte Carlo engine:
from kiyosi.pricing import MonteCarloBackend, MonteCarloVanillaEngine
engine = MonteCarloVanillaEngine(backend=MonteCarloBackend.CUDA)
result = engine.price(option, context)
Pricing coverage
| Instrument family | Available engines |
|---|---|
| European vanilla | Analytic, CRR binomial, finite difference, integral, Monte Carlo |
| American vanilla | Bjerksund-Stensland, CRR binomial, finite difference, Monte Carlo |
| Cash-or-nothing and asset-or-nothing digital | Analytic, finite difference, integral |
| Barrier | Analytic, finite difference |
| Binary barrier and touch | Analytic |
| Geometric-average Asian | Closed form |
| Arithmetic-average Asian | Turnbull-Wakeman approximation |
| Accumulator | Finite difference, Monte Carlo |
| Phoenix and snowball variants | Finite difference, Monte Carlo |
Model scope
The current pricing models use a Black-Scholes-Merton market context with spot and flat risk-free rate, dividend yield, and volatility parameters. Volatility surfaces and rate curves are not part of the current API.
Validation
Kiyosi's pricing tests compare results with reference values generated independently of Kiyosi using QuantLib. QuantLib is used by the reference-generation tooling and SSE calendar maintenance script; it is not a build or runtime dependency of the C++ core.
C++ library
Building the C++ core requires CMake 3.28 or newer, Ninja, and a C++23 compiler. On Linux, configure, build, test, and install with:
cmake --preset linux-release
cmake --build --preset linux-release
ctest --preset linux-release
cmake --install out/build/linux-release
On Windows, run the commands from a Visual Studio Developer PowerShell and replace linux-release with windows-release.
After installation, consume the exported CMake target:
find_package(kiyosi CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE kiyosi::kiyosi)
Include the umbrella header with #include <kiyosi/kiyosi.hpp>. See examples/all_pricing_engines.cpp for a broader example covering the available instrument and engine families.
License
Kiyosi is available under the MIT License.
Release files for kiyosi 0.4.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.4.0.tar.gz | 285.0 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| kiyosi-0.4.0-cp314-cp314-win_amd64.whl | CPython 3.14 | CPython 3.14 | Windows x86-64 | Details |
| kiyosi-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| kiyosi-0.4.0-cp313-cp313-win_amd64.whl | CPython 3.13 | CPython 3.13 | Windows x86-64 | Details |
| kiyosi-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| kiyosi-0.4.0-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| kiyosi-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
| kiyosi-0.4.0-cp311-cp311-win_amd64.whl | CPython 3.11 | CPython 3.11 | Windows x86-64 | Details |
| kiyosi-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details |
Total release size: 15.8 MB
Release files / kiyosi-0.4.0.tar.gz
| Download URL | kiyosi-0.4.0.tar.gz |
|---|---|
| Size | 285.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d76c6e5c2c8930259b3665726ff9da8eaab60b1c0c905b6577338bf1211ed6a
|
|
BLAKE2b-256 checksum How to use checksums |
e3ddac58e38bfdc17a01bdfcc4558439aa3687d9a8e4bd48ccb6f0bba5113294
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp314-cp314-win_amd64.whl
| Download URL | kiyosi-0.4.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
87eba1a2ec859d0465d2020718204d1f90257af022d6655a2e0636d2c52d4da4
|
|
BLAKE2b-256 checksum How to use checksums |
8a86eca6de89e6ec75642fb6f3b15fe1e311e29f2f956694f08a3f6d7d31faab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | kiyosi-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c3a8dd34037964ddbf14048ddd922388daf2db1a5c6266bc1daf0315c182e5aa
|
|
BLAKE2b-256 checksum How to use checksums |
3a4f93432e5638f3969ecfaf273e39d0701cd987ebc48453e253ca241bc876ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp313-cp313-win_amd64.whl
| Download URL | kiyosi-0.4.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
40ed12172ea07a48fd1a85489940e2a8b07fb64f2c333ad5b726363c0a73db00
|
|
BLAKE2b-256 checksum How to use checksums |
b3bca77c349997b5b24822dffb8a15128be5e344dac18668f73a591f898ab8e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | kiyosi-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4cea03b6232621883253890efdaae163c947533ab9b8dd50db5e5b49dad4142d
|
|
BLAKE2b-256 checksum How to use checksums |
fb89eb594a8b666e1316eae66c2e085cedfde093f82d414093027585b40f94a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp312-cp312-win_amd64.whl
| Download URL | kiyosi-0.4.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2627f4fccc9312eb97ddd873b9bb0d5971d732eba3124fcd55a6075fa7367ed1
|
|
BLAKE2b-256 checksum How to use checksums |
c3dcfe1ad99d9c9caab8a8cae0152dcea2b5c333cd207a491f2bfdcf9f8fd79d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | kiyosi-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
5f80342bb5a1a11de4b30a4494c239a5db9b7b906ffca706b7808c0231c040fb
|
|
BLAKE2b-256 checksum How to use checksums |
e309595976d12127a1660b7ad3aaa3a1267ff95a3f4194431905d3e98a5d79b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp311-cp311-win_amd64.whl
| Download URL | kiyosi-0.4.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d31ab257c2892e8d4bf84c17860e48f7280820de7801f85cf9749a57776e18c7
|
|
BLAKE2b-256 checksum How to use checksums |
e918ecd14b981239aed4ad2e0958b4cc992159014a608bf0a9a923f7aff79e2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency logRelease files / kiyosi-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | kiyosi-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 2.0 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8ce53ba842090996c106d3432d812041dda8d0dfc8f0a3fec7ffd85508b77bab
|
|
BLAKE2b-256 checksum How to use checksums |
becb26e8bea58d6e58c8cf6e08f25d42ec4ec5695726cf129c949fe0c83c97e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.
Transparency log