Skip to main content

Kiyosi

Kiyosi is a modern C++23 derivatives-pricing library with Python bindings, offering consistent APIs for vanilla, exotic, and structured products.

PyPI License: MIT

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.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kiyosi 0.5.0
File Size Uploaded
kiyosi-0.5.0.tar.gz 285.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for kiyosi 0.5.0
File
kiyosi-0.5.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
kiyosi-0.5.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.5.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
kiyosi-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
kiyosi-0.5.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
kiyosi-0.5.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.5.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
kiyosi-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 15.8 MB

Release files / kiyosi-0.5.0.tar.gz

Download URL kiyosi-0.5.0.tar.gz
Size 285.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d9706eb025bd7a4829194cf74fa75f94d735dd62305b16dc7fd2cdc3ade59e91
BLAKE2b-256 checksum
How to use checksums
282d2af2a965a6a4ffc36cf68f0989fe0a28f5c4b9a2f309c35086faca326617
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp314-cp314-win_amd64.whl

Download URL kiyosi-0.5.0-cp314-cp314-win_amd64.whl
Size 1.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
296a8d282416e803b857701400838a8e20d39aefb53bd4457ad8ab82cd6c7da9
BLAKE2b-256 checksum
How to use checksums
dcc166cea1cd96ee9fd8d9840d2fa86ac4215adb0f00ebc8169d1af0e5e8088a
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL kiyosi-0.5.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
acd854591b9108434cbf1b1c1e08ab5cf876b27c42f7bcdcaf2a244fa4487a90
BLAKE2b-256 checksum
How to use checksums
d4ff25e3c9b5c33564b1e016552f238a60aa7d60a59d7142cb36e5c95b407e19
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp313-cp313-win_amd64.whl

Download URL kiyosi-0.5.0-cp313-cp313-win_amd64.whl
Size 1.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
ce42b986b1b532431c1c01ba4898d3873c24d38e8a8e6076f130385d0f288cea
BLAKE2b-256 checksum
How to use checksums
ae1140871b46e68733458380ee069455333a93fe5e405dbdfeeabf3f956c41c0
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL kiyosi-0.5.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
f9a4ee24f71cf94cade69b53f3b782417b905b918255e714cc4caaf5dfd2219f
BLAKE2b-256 checksum
How to use checksums
69b23181d04f2fb1aed95034797da40824920dd8a4550b85d9fb081ae006a6a4
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp312-cp312-win_amd64.whl

Download URL kiyosi-0.5.0-cp312-cp312-win_amd64.whl
Size 1.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
0d56a1bee3f0cf11875b7d14f668ac3c990fbf5319d090127a8a4312107a7e50
BLAKE2b-256 checksum
How to use checksums
6a8fb754c7dc2b36ba1e63c3314cee407bf667bffaf338445271e9a993407fd7
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL kiyosi-0.5.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
eb94ceb7f74473d3074c6f0d8fae4d433c9bfe1fb42c31b79e7a420027ad3c96
BLAKE2b-256 checksum
How to use checksums
f75fd4c1e8cfc6767547f321a7b5add0d1d60e94490aa9e96b8e0946bfa76a3e
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp311-cp311-win_amd64.whl

Download URL kiyosi-0.5.0-cp311-cp311-win_amd64.whl
Size 1.9 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
649a9ff4daaad4e79113cb6df5b503ee4f1900b426b8fdf683419d8d17253bad
BLAKE2b-256 checksum
How to use checksums
1accdc09ecdfed6875727cf83d04317ab936fe391508b456cd71a52d246d5f89
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 21, 2026.

Transparency log

Release files / kiyosi-0.5.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL kiyosi-0.5.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
21c8f802396e1838862042beeaa31158a3a54e1afd7aa571ae9e2c79db293428
BLAKE2b-256 checksum
How to use checksums
563ba28e11f2f81981d2763e9faf5b22bcbe9aa659f7336111343256ebb219d4
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 21, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

9 release files

This release

0.5.0 This release

9 release files

0.4.0

9 release files

0.3.0

17 release files

0.2.0

5 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page