跳转到正文

kiyosi.pricing ​

Price contracts, compute sensitivities, and solve implied parameters.

Notes ​

Choose an engine for the contract and model. Check grid and integration-domain convergence separately; Monte Carlo sampling uncertainty excludes discretization bias. Solver tolerances constrain the engine's price curve, not pricing accuracy.

Engines with strike batches expose price_strikes(instrument, context, strikes=...). The instrument supplies the template terms. Each engine documents its supported templates and how it shares calculations across strikes. Use price_many on supported engines for already constructed contracts, price_surface for a finite-difference strike–expiry grid, and solve to keep a finite-difference solution for repeated spot queries.

Engines with configurable constructor fields support replace(**changes) to create a validated engine. Omitted controls default to the source engine's values.

price_with_greeks requires a Greek name, an iterable of names, or "all". An empty iterable requests price only. Unsupported measures are absent with status "unsupported", including requests with no supported measures. PricingResult documents units; result.status explains missing measures, and result.require rejects them. Use engine.greek_method(instrument, context) to inspect estimation before pricing. Its result exposes the method name and potentially active_controls. numerical_greeks selects scalar BSM differences.

Request-level shifts tune numerical fallbacks and availability checks without changing engine settings. Both Greek entry points use shared defaults when controls are omitted or Ellipsis; None selects automatic spot, volatility and time bumps. Automatic volatility bumps use the smaller of 0.0001 and half the current volatility. Every supplied control is validated. A numerical rate bump that the engine rejects as unsupported leaves the affected Greek with status "stencil_unavailable". Supported expiry Greeks follow the payoff; time Greeks are absent at expiry.

Monte Carlo engines support pseudo-random and scrambled Sobol draws. A fixed seed replays draws across thread counts within the same build. price_with_seed returns the actual seed; price_with_statistics adds sampling uncertainty. Sobol estimates omit uncertainty. Implied-parameter solvers require an explicit seed: retain the engine returned by with_resolved_seed for solving and repricing.

Coupon solvers return dictionaries for note.with_coupon(**quote), preserving the snowball maturity convention and quoting Phoenix rates per observation.

Examples ​

Price a European call and request its delta and vega:

python
>>> from datetime import datetime
>>> from kiyosi.instruments import EuropeanOption
>>> from kiyosi.market import BlackScholesMertonParameters, PricingContext
>>> from kiyosi.pricing import AnalyticEuropeanEngine
>>> option = EuropeanOption(
...     option_type="call", strike=100,
...     effective_time=datetime(2025, 1, 1),
...     expiry_time=datetime(2026, 1, 1),
... )
>>> context = PricingContext(
...     model_parameters=BlackScholesMertonParameters(
...         risk_free_rate=0.05, dividend_yield=0.02, volatility=0.2,
...     ),
...     spot_price=100, valuation_time=datetime(2025, 1, 1),
... )
>>> result = AnalyticEuropeanEngine().price_with_greeks(
...     option, context, greeks=["delta", "vega"],
... )
>>> round(result.price, 6)
9.227006
>>> result.require("delta") > 0
True
>>> method = AnalyticEuropeanEngine().greek_method(option, context)
>>> method.name, method.active_controls
('native', ())

Recover the model volatility from its price using a chosen bracket:

python
>>> sigma = implied_volatility(
...     AnalyticEuropeanEngine(), option, context, result.price,
...     lower_bound=0.1, upper_bound=0.3,
... )
>>> round(sigma, 6)
0.2

AnalyticBarrierEngine ​

python
AnalyticBarrierEngine()

Analytic single-barrier pricing with flat rates.

A sole remaining expiry fixing uses the terminal payoff. Multiple remaining fixings use the Broadie-Glasserman-Kou (BGK) continuity correction based on their remaining spacing. The expiry fixing uses the contractual barrier. Knock-outs use survival-weighted quadrature when closed-form payoff terms nearly cancel.

See Also ​

BarrierOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

AnalyticBinaryBarrierEngine ​

python
AnalyticBinaryBarrierEngine()

Flat-rate binary-barrier and single-touch analytics.

A sole remaining expiry fixing uses the terminal payoff. Multiple remaining fixings use the Broadie-Glasserman-Kou (BGK) continuity correction based on their remaining spacing. The expiry fixing uses the contractual barrier. Binary knock-outs integrate the surviving payoff directly over narrow paying intervals.

See Also ​

BinaryBarrierOption : Supported contract. TouchOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

AnalyticDigitalEngine ​

python
AnalyticDigitalEngine()

Analytic European digital pricing with deterministic rate curves.

See Also ​

CashOrNothingOption : Supported contract. AssetOrNothingOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Delta and gamma are analytic at positive volatility before expiry. At zero volatility they use scalar differences. Other Greeks use numerical differences with the supplied shifts. At expiry spot Greeks use the supplied terminal-payoff stencils. Use numerical_greeks for scalar-only differences.

AnalyticDoubleBarrierEngine ​

python
AnalyticDoubleBarrierEngine()

Flat-rate continuous double-barrier analytics.

Zero-volatility BSM paths are evaluated exactly, including scheduled monitoring.

See Also ​

DoubleBarrierOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

AnalyticDoubleTouchEngine ​

python
AnalyticDoubleTouchEngine()

Flat-rate continuous cash double-touch and double-no-touch pricing.

Either inclusive barrier triggers a touch. Supports expiry payments and double-touch at-hit payments; past at-hit payments have zero remaining value. Uses image/spectral series and adaptive first-exit integration for at-hit payments. Nonconstant rate curves are rejected. At positive volatility, unresolved scheduled monitoring is unsupported. Resolved cash flows and zero-volatility paths support scheduled monitoring after calendar and history validation. Greeks use numerical differences. At expiry they follow terminal payoffs, with time Greeks absent. Before expiry at positive volatility, barrier equality without a prior touch leaves spot Greeks absent; rate and volatility Greeks follow the resolved payoff. Stencils crossing a barrier omit affected measures.

See Also ​

DoubleTouchOption : Supported cash contract. FiniteDifferenceDoubleTouchEngine : Supports schedules and nonconstant rate curves.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

AnalyticEuropeanEngine ​

python
AnalyticEuropeanEngine()

Analytic European vanilla pricing with deterministic rate curves.

See Also ​

EuropeanOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Uses analytic Greeks at positive volatility before expiry and scalar differences at zero volatility. At expiry, supported Greeks use exact payoff derivatives; spot derivatives are undefined at the strike and time Greeks are absent. Use numerical_greeks for scalar differences.

AnalyticGeometricAveragePriceEngine ​

python
AnalyticGeometricAveragePriceEngine()

Prices continuously monitored geometric average-price Asian options.

Supports deterministic risk-free-rate and dividend-yield curves.

See Also ​

GeometricAveragePriceOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

AnalyticHestonEuropeanEngine ​

python
AnalyticHestonEuropeanEngine(*, absolute_tolerance=1e-08, relative_tolerance=1e-08, max_evaluations=1000000)

Price European calls and puts under Heston by adaptive Fourier integration.

Parameters ​

  • absolute_tolerance (float, optional) — Finite nonnegative tolerance in price units; defaults to 1e-8.
  • relative_tolerance (float, optional) — Finite nonnegative relative tolerance; defaults to 1e-8.
  • max_evaluations (int, optional) — Positive per-quote characteristic-function budget; defaults to 1,000,000.

Raises ​

  • InvalidInputError — If tolerances are invalid or both zero, or the budget is zero.

Notes ​

Supports HestonParameters and EuropeanOption only, including zero variance parameters and correlation endpoints. Deterministic rates may be curves. The target price error is absolute_tolerance + relative_tolerance * abs(price). Integration compares the sum of analytic bounds and four times the sampled quadrature error estimate with that target. The budget counts Heston and control-variate characteristic-function evaluations. Expiry and deterministic-variance branches need no evaluations. Requested Greeks have status "unsupported"; implied-parameter solvers raise UnsupportedOperationError. Pricing releases the GIL for core computation, with independent state for concurrent calls.

absolute_tolerance ​

Return the absolute tolerance in price units.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

max_evaluations ​

Return the characteristic-function budget per quote.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (EuropeanOption) — European call or put; valuation may precede effective_time.
  • context (PricingContext) — Heston market snapshot; initial variance is at valuation. Rate/dividend curves must cover valuation through expiry.

Returns ​

  • float — Price, or intrinsic payoff at the expiry instant.

Raises ​

  • UnsupportedOperationError — For unsupported instruments or models, including at expiry.
  • InvalidInputError — If valuation follows expiry or lies outside curve coverage.
  • NonConvergenceError — If the budget or numerical resolution cannot meet the estimated target.
  • ComputationFailureError — For invalid numerical intermediates or prices.

price_strikes ​

python
price_strikes(self, /, instrument, context, *, strikes)

Price European calls or puts across strikes on one market snapshot.

Parameters ​

  • instrument (EuropeanOption) — Template supplying direction and dates.
  • context (PricingContext) — Heston market snapshot.
  • strikes (iterable of float) — Up to 1,048,576 finite positive strikes in the desired output order. Duplicates count toward the limit.

Returns ​

  • tuple of float — Prices in input order, including duplicates. An empty input validates the market and returns an empty tuple.

Raises ​

  • KiyosiError — If applicability, coverage, strike count, strike or numerical checks fail.
  • TypeError, ValueError, OverflowError — If an input representation is invalid.

Notes ​

Groups of up to 16,384 distinct strikes can share a fast Fourier transform with interpolation. Other quotes share transform samples and retain adaptive convergence budgets. Excessive total Fourier work raises InvalidInputError. Pricing releases the GIL and cancellation returns no partial result.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Requested Greeks have status "unsupported". Bump controls are validated but unused; numerical_greeks rejects Heston.

relative_tolerance ​

Return the dimensionless relative tolerance.

replace ​

python
replace(self, *, absolute_tolerance=Ellipsis, relative_tolerance=Ellipsis, max_evaluations=Ellipsis) -> AnalyticHestonEuropeanEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • absolute_tolerance (object, optional) — Replacement field.
  • relative_tolerance (object, optional) — Replacement field.
  • max_evaluations (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

AnalyticRangeAccrualEngine ​

python
AnalyticRangeAccrualEngine()

Exact BSM range-coupon marginals with deterministic rate curves.

See Also ​

RangeAccrualOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

BjerksundStenslandVanillaEngine ​

python
BjerksundStenslandVanillaEngine()

Bjerksund-Stensland 2002 American approximation with flat rates.

See Also ​

AmericanOption : Supported contract.

Notes ​

Requires BSM with constant rates. At positive volatility before expiry, negative transformed interest rates (risk-free rate for calls, dividend yield for puts) and invalid exercise boundaries raise UnsupportedOperationError. The boundaries decrease over time and exceed the strike. Zero volatility uses exact deterministic exercise. At expiry the engine returns intrinsic value.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

CouponQuoteConvention ​

python
CouponQuoteConvention = typing.Literal['shift_maturity_coupon', 'preserve_maturity_coupon']

CoxRossRubinsteinBarrierEngine ​

python
CoxRossRubinsteinBarrierEngine(*, step_count=256)

Flat-rate Cox-Ross-Rubinstein tree pricing.

Parameters ​

  • step_count (int, optional) — Number of tree time steps, from 1 through 1,000,000.

Raises ​

  • InvalidInputError — If step_count is outside 1 through 1,000,000. Pricing paths that roll back every tree level also reject counts above 16,000.

See Also ​

BarrierOption : Supported contract.

Notes ​

Defaults to 256 steps. Reflected trees and sparse schedules can exceed 16,000 steps when their rollback fits the work budget. For requests from 256 through 16,000 steps, the engine can refine the time grid to align a node with a continuous barrier. It uses analytic pricing when alignment exceeds the refinement budget. Delta and gamma use tree nodes or scalar differences on the analytic path. Other Greeks are absent.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

At positive volatility before expiry delta and gamma use tree nodes. Zero volatility uses scalar differences. Other Greeks are unsupported. At expiry spot Greeks use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences throughout.

replace ​

python
replace(self, *, step_count=Ellipsis) -> CoxRossRubinsteinBarrierEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • step_count (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

step_count ​

Return the configured number of binomial time steps.

CoxRossRubinsteinDigitalEngine ​

python
CoxRossRubinsteinDigitalEngine(*, step_count=257)

Flat-rate Cox-Ross-Rubinstein tree pricing.

Parameters ​

  • step_count (int, optional) — Number of tree time steps, from 1 through 1,000,000.

Raises ​

  • InvalidInputError — If step_count is outside 1 through 1,000,000. Pricing paths that roll back every tree level also reject counts above 16,000.

See Also ​

CashOrNothingOption : Supported contract. AssetOrNothingOption : Supported contract.

Notes ​

Defaults to 257 steps so there is no terminal node at the initial spot. A digital price is sensitive to how the strike aligns with the terminal nodes. Provides node delta/gamma for its product family; other Greeks are absent.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

At positive volatility before expiry delta and gamma use tree nodes. Zero volatility uses scalar differences. Other Greeks are unsupported. At expiry spot Greeks use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences throughout.

replace ​

python
replace(self, *, step_count=Ellipsis) -> CoxRossRubinsteinDigitalEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • step_count (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

step_count ​

Return the configured number of binomial time steps.

CoxRossRubinsteinVanillaEngine ​

python
CoxRossRubinsteinVanillaEngine(*, step_count=256, rollback_tolerance=None)

Flat-rate Cox-Ross-Rubinstein tree pricing.

Parameters ​

  • step_count (int, optional) — Number of tree time steps, from 1 through 1,000,000.
  • rollback_tolerance (float or None, optional) — Positive absolute price tolerance for discarded lattice tails in American pricing, Greeks, and implied volatility. The default, None, uses the full rollback.

Raises ​

  • InvalidInputError — If step_count is outside 1 through 1,000,000. Pricing paths that roll back every tree level also reject counts above 16,000.

Notes ​

Accepts EuropeanOption and AmericanOption. Defaults to 256 steps. Grid discretization and rounding errors are separate. Greek stencils can tighten the truncation bound.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_many ​

python
price_many(self, /, instruments, context)

Price vanilla options in input order on one market snapshot.

Parameters ​

  • instruments (iterable of EuropeanOption or AmericanOption) — Contracts to price. An empty iterable is valid.
  • context (PricingContext) — Shared model inputs, spot and valuation time.

Returns ​

  • tuple of float — Prices in input order, preserving duplicates.

Raises ​

  • KiyosiError — If contract applicability, pricing validation or computation fails.
  • OSError — If interrupted or the pricing worker cannot start.

Notes ​

Pricing runs in one cancellable request with the GIL released. Compatible contracts can share lattice geometry and run in parallel. The engine's rollback tolerance applies to American contracts. The request accepts up to 1,048,576 contracts, including duplicates. The one-billion-update limit counts combined terminal-node, rollback and deterministic exercise work across distinct contracts. A failed request returns no partial results.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

At positive volatility before expiry delta and gamma use tree nodes; one-step gamma and other Greeks use numerical differences with the request's shifts. Zero volatility also uses scalar differences. At expiry spot Greeks use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences throughout.

replace ​

python
replace(self, *, step_count=Ellipsis, rollback_tolerance=Ellipsis) -> CoxRossRubinsteinVanillaEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • step_count (object, optional) — Replacement field.
  • rollback_tolerance (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

rollback_tolerance ​

Return the American option lattice truncation tolerance in price units.

step_count ​

Return the configured number of binomial time steps.

FiniteDifferenceAccumulatorEngine ​

python
FiniteDifferenceAccumulatorEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

The rollback work limit counts both layers when future purchases are possible. Default settings integrate each fixing directly for calendar-time flat-rate BSM contracts with no future knock-out. Custom grid controls and solve() use a numerical grid.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceAccumulatorEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

FiniteDifferenceAutocallableEngine ​

python
FiniteDifferenceAutocallableEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

When daily knock-in is active, implicit schemes subdivide the gaps between mandatory dates to place the base time intervals. With calendar-time BSM, the common cash-flow layer can use a separate grid.

With flat BSM rates and one valuation layer, default first-order market Greeks can reuse the pricing rollback. Nondefault shifts use repricing.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceAutocallableEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

FiniteDifferenceBarrierEngine ​

python
FiniteDifferenceBarrierEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceBarrierEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

FiniteDifferenceBinaryBarrierEngine ​

python
FiniteDifferenceBinaryBarrierEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

Non-explicit schemes concentrate spatial nodes when needed to resolve the barrier or strike. With automatic asset bounds, these schemes use exact terminal probabilities for a sole remaining BSM fixing at expiry or a scheduled binary payoff that implies a touch at expiry.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceBinaryBarrierEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

FiniteDifferenceDigitalEngine ​

python
FiniteDifferenceDigitalEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

The grid uses log spot and an automatically selected positive lower boundary. Automatic domains with non-explicit schemes concentrate nodes around the strike. Automatic Rannacher grids with constant volatility shift the terminal strike by the deterministic carry and apply the corresponding discount after rollback.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceDigitalEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

FiniteDifferenceDoubleBarrierEngine ​

python
FiniteDifferenceDoubleBarrierEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceDoubleBarrierEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

FiniteDifferenceDoubleTouchEngine ​

python
FiniteDifferenceDoubleTouchEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceDoubleTouchEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

FiniteDifferenceHestonVanillaEngine ​

python
FiniteDifferenceHestonVanillaEngine(*, asset_step_count=400, variance_step_count=100, time_step_count=400, asset_upper_boundary=None, variance_upper_boundary=None)

Finite-difference prices for European and American options under Heston.

Parameters ​

  • asset_step_count (int, optional) — Asset intervals, at least 3; read the property for the Rust-defined default.
  • variance_step_count (int, optional) — Variance intervals, at least 3; read the property for the default.
  • time_step_count (int, optional) — Base time intervals, at least 1; rate/dividend knots are added.
  • asset_upper_boundary (float or None, optional) — Finite positive bound, or automatic selection. Must exceed spot and strike when a numerical grid is needed.
  • variance_upper_boundary (float or None, optional) — Finite positive bound, or automatic selection. Must exceed initial variance when a variance grid is needed.

Raises ​

  • InvalidInputError — For invalid counts or bounds. Context-dependent coverage is checked at pricing.

Notes ​

The asset grid uses log spot and an automatically selected positive lower boundary. Uses the modified Craig-Sneyd (MCS) alternating direction implicit (ADI) scheme on nonuniform grids, with Ikonen-Toivanen splitting for American exercise. Supports HestonParameters and EuropeanOption/AmericanOption, including violations of the Feller condition, zero parameters, correlation endpoints and deterministic rate curves. European prices and batches skip the grid when a terminal spot bound fixes the payoff at perfect correlation. With automatic spatial bounds, European quotes close to the lower terminal spot bound use Fourier integration for perfectly positively correlated models that violate the Feller condition when the square root of integrated variance is at least 0.04. Saved spot batches budget for Fourier work in this region. Pricing rejects grids whose estimated workspace exceeds 1 GiB or whose spatial grid point count times the number of time intervals, including curve knots, exceeds one billion. American pricing also limits estimated exercise-boundary work to 25 million curve-knot visits. With automatic spatial bounds and absolute correlation of at least 0.9, European grids use at least 400 variance intervals if the model violates the Feller condition or the square root of expected integrated variance at the first priced maturity is at most 0.06. Models that violate the Feller condition with correlation of at least 0.95 or at most -0.98 use at least 800 asset intervals. For European scalar prices and saved spot solutions, automatic grids can retry a discounted payoff-bound failure with at least 200 variance intervals and, for narrow distributions or grids with at least 400 variance intervals, at least 800 asset intervals. If spatial refinement does not recover a payoff-bound failure, the engine tries twice the base time intervals within the rollback work budget. Narrow grids with absolute correlation below 0.9 can also retry other numerical failures with 200 variance intervals. Automatic European rollback grids remove deterministic carry and concentrate spot nodes near the payoff for low-variance models with large volatility of volatility. Check spatial and time refinement and domain enlargement separately. Non-finite or materially negative results raise ComputationFailureError. European grid prices outside discounted payoff bounds beyond roundoff raise NonConvergenceError. Requested Greeks have status "unsupported". Implied-parameter solvers raise UnsupportedOperationError. Inputs and settings are immutable; core pricing releases the GIL and permits concurrent calls with independent state.

asset_step_count ​

Return the configured number of asset intervals.

asset_upper_boundary ​

Return the explicit asset upper bound, or None.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (EuropeanOption or AmericanOption) — European or American call or put. European valuation may precede effective_time; American valuation must be within contract life.
  • context (PricingContext) — Heston market snapshot, with initial variance at valuation. Rate/dividend curves must cover valuation through expiry.

Returns ​

  • float — Price, or intrinsic value at the expiry instant.

Raises ​

  • UnsupportedOperationError — For other models or instruments, including at expiry.
  • InvalidInputError — Outside permitted valuation bounds or curve coverage, or for insufficient explicit bounds.
  • ComputationFailureError — For unrepresentable grids or invalid numerical results.
  • NonConvergenceError — If a European grid price falls outside its discounted payoff bounds.

price_strikes ​

python
price_strikes(self, /, instrument, context, *, strikes)

Price European or American vanilla options across strikes.

Parameters ​

  • instrument (EuropeanOption or AmericanOption) — Template supplying the option type, exercise style and dates.
  • context (PricingContext) — Fixed Heston market and valuation time.
  • strikes (iterable of float) — Finite positive strikes. Empty input is valid.

Returns ​

  • tuple of float — Prices in strike order, preserving duplicates.

Raises ​

  • KiyosiError — If applicability, contract, strike, coverage or numerical checks fail.
  • TypeError, ValueError, OverflowError — If an input representation is invalid.

Notes ​

The automatic asset domain shares one rollback over the full spot-to-strike range. Compatible strikes with an explicit asset bound share an absolute grid. European batches can reuse one set of payoff weights. Check mesh convergence over the full range. Pricing releases the GIL and cancellation returns no partial result. The request caps combined rollback work at one billion grid updates and bounds strike inputs by the batch workspace limit.

price_surface ​

python
price_surface(self, /, instrument, context, *, expiries, strikes)

Price a vanilla strike and expiry surface.

Parameters ​

  • instrument (EuropeanOption or AmericanOption) — Template supplying the payoff direction and effective time.
  • context (PricingContext) — Fixed Heston market and valuation time.
  • expiries (iterable of datetime) — Expiries at or after valuation and the effective time. American valuation must be at or after the effective time.
  • strikes (iterable of float) — Finite positive strikes.

Returns ​

  • tuple of tuple of float — Rows in expiry order, with prices in strike order and duplicates preserved.

Raises ​

  • KiyosiError — If applicability, input, workspace or numerical checks fail.
  • TypeError, ValueError, OverflowError — If a Python input representation is invalid.

Notes ​

European surfaces can share a forward grid spanning the longest maturity. Pricing handles expiries separately when a terminal spot bound fixes a shared payoff or the shared grid fails numerically. Compatible American surfaces share rollback across tenors or factored operators in expiry tiles. Check mesh and domain convergence across the surface. The combined rollback work limit applies across the request. Cancellation returns no partial result.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Requested Greeks have status "unsupported". Bump controls are validated but unused; numerical_greeks rejects Heston.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, variance_step_count=Ellipsis, time_step_count=Ellipsis, asset_upper_boundary=Ellipsis, variance_upper_boundary=Ellipsis) -> FiniteDifferenceHestonVanillaEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • variance_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.
  • variance_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains cover the interval; active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the base time intervals before inserting curve knots.

variance_step_count ​

Return the configured number of variance intervals.

variance_upper_boundary ​

Return the explicit variance upper bound, or None.

FiniteDifferenceScheme ​

python
FiniteDifferenceScheme = typing.Literal['explicit_euler', 'implicit_euler', 'crank_nicolson', 'rannacher']

FiniteDifferenceSolution ​

Fixed-time solution for repeated spot queries without rollback.

Notes ​

Created by a finite-difference engine's solve method. The contract, model, valuation time and supplied history are fixed. Current observations use each query's spot. Queries may cross current knock-in, knock-out, coupon and settlement conditions. Source objects can be released or replaced. Shared instances permit concurrent reads; long queries release the GIL and support cancellation without partial results. The object is immutable and cannot be constructed directly. Mesh and truncation accuracy require convergence checks; there is no automatic error estimate or refinement.

price ​

python
price(self, /, spot_price)

Evaluate the saved solution at one spot.

Parameters ​

  • spot_price (float) — Finite positive spot inside the closed query interval.

Returns ​

  • float — Price with current observations applied to this spot.

Raises ​

  • InvalidInputError — If the spot is invalid or outside the interval.
  • ComputationFailureError — If numerical values or financial price checks fail.
  • TypeError — If the numeric representation is invalid, including a bool.

price_many ​

python
price_many(self, /, spot_prices)

Evaluate saved prices in input order, preserving duplicates.

Parameters ​

  • spot_prices (iterable of float) — Spots inside the closed interval. Empty input is valid.

Returns ​

  • tuple of float — Owned prices, or an empty tuple for empty input.

Raises ​

  • InvalidInputError — If the batch exceeds 262,144 spots or 100 million estimated observation visits, calendar visits, or integration evaluations.
  • KiyosiError — If any spot or price is invalid; no partial batch is returned.
  • TypeError — If the iterable or an element has an invalid representation.

Notes ​

Iterator exceptions propagate; consuming an iterator is not rolled back. Long core work releases the GIL and polls Python signals.

price_many_with_greeks ​

python
price_many_with_greeks(self, /, spot_prices, greeks, *, spot_shift=Ellipsis)

Evaluate saved prices and requested Greeks in input order.

Parameters ​

  • spot_prices (iterable of float) — Spots inside the closed interval; duplicates and empty input are valid.
  • greeks (str or iterable of str) — Shared request, using price_with_greeks conventions.
  • spot_shift (float, None or Ellipsis, optional) — Positive spot shift or the Rust-defined automatic default.

Returns ​

  • tuple of PricingResult — Per-spot prices, sensitivities and statuses.

Raises ​

  • InvalidInputError — If the batch exceeds 262,144 spots or 100 million estimated observation visits, calendar visits, or integration evaluations.
  • KiyosiError — If any input or query fails, without a partial batch.
  • TypeError, ValueError — If representations or Greek names are invalid.

Notes ​

Controls are validated even for an empty batch. Iterator exceptions propagate. Long core work releases the GIL and polls Python signals.

price_with_greeks ​

python
price_with_greeks(self, /, spot_price, greeks, *, spot_shift=Ellipsis)

Evaluate saved price and requested spot Greeks.

Parameters ​

  • spot_price (float) — Finite positive spot inside the closed interval.
  • greeks (str or iterable of str) — A Greek name, "all", or names; empty input requests price only.
  • spot_shift (float, None or Ellipsis, optional) — Positive absolute spot shift, or the Rust-defined automatic default. Omission, None and Ellipsis select automatic shifts.

Returns ​

  • PricingResult — Price and requested sensitivities with their availability statuses.

Raises ​

  • KiyosiError — If spot, shift, or financial/numerical validation fails.
  • TypeError, ValueError — If representations or Greek names are invalid.

Notes ​

BSM supports delta/gamma/speed, local volatility delta/gamma, and Heston no Greeks. Other requests are unsupported. Financial discontinuities are undefined; required samples outside the interval have status "stencil_unavailable". No query extends the domain or repeats rollback.

spot_range ​

Return the owned closed spot query interval.

supported ​

Return potential Greek capabilities; query statuses describe availability.

valuation_time ​

Return the fixed valuation time.

FiniteDifferenceVanillaEngine ​

python
FiniteDifferenceVanillaEngine(*, asset_step_count=800, time_step_count=400, scheme='rannacher', asset_upper_boundary=None)

Finite-difference pricing.

Parameters ​

  • asset_step_count (int, optional) — Number of spatial steps, at least 3; defaults to 800. Continuous barrier grids use all steps between their actual domain edges.
  • time_step_count (int, optional) — Positive base number of time intervals. The grid includes event dates and curve knots. Read time_step_count on a default instance for this engine.
  • scheme (FiniteDifferenceScheme, optional) — Time-marching scheme; defaults to "rannacher" (damped Crank-Nicolson). "crank_nicolson" uses standard Crank-Nicolson without time-step damping.
  • asset_upper_boundary (float or None, optional) — Finite positive upper spot boundary, or None (default) for the automatic domain. Must exceed spot, strike and barriers at pricing. Continuous up and double barriers fix their own upper grid edge; this bound is inactive for that grid. Local-volatility knock-in vanilla components and scheduled monitoring use the full domain.

Raises ​

  • InvalidInputError — If asset_step_count is below 3, time_step_count is below 1, the estimated grid workspace exceeds 1 GiB, the asset and time step counts multiply to more than one billion, or an explicit upper boundary is invalid. Pricing checks the work limit after adding event and curve steps and damping half-steps. It also checks boundary coverage and explicit-Euler stability.

Notes ​

The engine name selects its product family. The vanilla engine accepts EuropeanOption and AmericanOption. The digital engine accepts CashOrNothingOption and AssetOrNothingOption. The binary-barrier engine also accepts TouchOption. The autocallable engine accepts all snowball variants and PhoenixOption. Other engines accept their named product. All FD product families accept deterministic rate curves and support local-volatility price, delta and gamma, including American exercise. Other requested Greeks are None. Autocallable coupon solvers support local volatility; implied volatility raises UnsupportedOperationError. The local-volatility surface stays fixed in absolute coordinates; expiry Greeks follow terminal payoffs and are absent where their stencils cross product events. Vanilla expiry Greeks use exact supported payoff derivatives, undefined at the strike. Surface coverage follows remaining stochastic evolution; rate coverage follows required future discounting. Automatic local-volatility domains require convergence checks.

The grid uses log spot and an automatically selected positive lower boundary. Automatic domains with non-explicit schemes concentrate nodes around the strike. Automatic Rannacher grids for European contracts with constant volatility shift the terminal strike by the deterministic carry and apply the corresponding discount after rollback.

asset_step_count ​

Return the configured number of spatial intervals.

asset_upper_boundary ​

Return the explicit upper spot boundary, or None for automatic selection.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_strikes ​

python
price_strikes(self, /, instrument, context, *, strikes)

Price vanilla options across strikes on a fixed market snapshot.

Parameters ​

  • instrument (EuropeanOption or AmericanOption) — Template supplying direction and dates.
  • context (PricingContext) — Fixed model inputs and valuation time.
  • strikes (iterable of float) — Finite positive strikes. Empty input is valid.

Returns ​

  • tuple of float — Prices in strike order, preserving duplicates.

Notes ​

Compatible BSM strikes share a rescaled solution with automatic boundaries. European calendar-time BSM strikes with fixed boundaries and compatible local-volatility strikes share an absolute-spot grid. Outliers can use individual solves. Check grid convergence across the strike range. The request caps combined work at one billion grid updates or deterministic American exercise interval visits. Strike inputs are bounded by the batch workspace limit. Cancellation returns no partial result.

price_surface ​

python
price_surface(self, /, instrument, context, *, expiries, strikes)

Price a vanilla strike and expiry surface.

Parameters ​

  • instrument (EuropeanOption or AmericanOption) — Template supplying direction and effective time.
  • context (PricingContext) — Fixed model inputs and valuation time.
  • expiries (iterable of datetime) — Expiries at or after valuation and the effective time. American valuation must be at or after the effective time.
  • strikes (iterable of float) — Finite positive strikes.

Returns ​

  • tuple of tuple of float — Prices in expiry and strike order, preserving duplicates.

Raises ​

  • KiyosiError — If applicability, input, workspace or numerical checks fail.
  • TypeError, ValueError, OverflowError — If a Python input representation is invalid.

Notes ​

European surfaces can share one log-spot grid and propagation across expiries. Compatible American surfaces share rollback on a normalized grid for flat-rate BSM or step factors on an absolute grid for local volatility. Other strips use price_strikes. Check mesh and domain convergence across the surface. The combined work limit, including deterministic American exercise interval visits, applies across the request. Cancellation returns no partial result.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry delta and gamma come from the spatial solution, except zero BSM volatility uses scalar differences. The vanilla engine can reuse the same grid for default rate and volatility Greeks on flat-rate BSM European options. Other BSM Greeks use numerical differences with request-level shifts. Local volatility provides only delta and gamma. At expiry vanilla Greeks use exact supported payoff derivatives; other products use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences under BSM.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, scheme=Ellipsis, asset_upper_boundary=Ellipsis) -> FiniteDifferenceVanillaEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • scheme (object, optional) — Replacement field.
  • asset_upper_boundary (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

scheme ​

Return the configured time-marching choice string.

solve ​

python
solve(self, /, instrument, context, *, spot_range)

Prepare an owned fixed-time solution for repeated spot queries.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Fixed model inputs, valuation time and supplied history.
  • spot_range (tuple of float) — Two finite positive, strictly increasing bounds. Both endpoints are queryable; the context spot need not be inside the interval.

Returns ​

  • FiniteDifferenceSolution — Owned reusable solution; queries perform no new rollback.

Raises ​

  • KiyosiError — If applicability, interval, history, coverage or numerical checks fail.
  • TypeError, ValueError — If the interval or input representations are invalid.

Notes ​

Current observations are evaluated per queried spot. Numerical domains use log spot and cover the states that need rollback. Active explicit engine bounds must provide coverage. Some products prepare several state layers or continuation components. Accuracy requires grid and truncation convergence checks. Long work releases the GIL; cancellation returns no partial solution.

time_step_count ​

Return the configured base number of time intervals.

Greek ​

python
Greek = typing.Literal['delta', 'gamma', 'speed', 'theta', 'charm', 'color', 'vega', 'volga', 'vanna', 'zomma', 'rho', 'dividend_rho']

GreekControl ​

python
GreekControl = typing.Literal['spot_shift', 'volatility_shift', 'rate_shift', 'time_shift']

GreekMethod ​

Describe how an engine estimates Greeks.

Obtain this value from an engine's greek_method. The method and controls describe the estimation path for a contract and market snapshot.

active_controls ​

Return the shift controls that an estimation method may use.

name ​

Return the name of the estimation method.

MonteCarloAccumulatorEngine ​

python
MonteCarloAccumulatorEngine(*, path_count=131072, seed=None, max_active_workers=0, sampling='pseudo_random', antithetic=False)

Flat-rate CPU Monte Carlo pricing for accumulators.

Parameters ​

  • path_count (int, optional) — Exact path count, 1 through 10,000,000; defaults to 131,072. Sobol sampling requires a power of two.
  • seed (int or None, optional) — Unsigned 64-bit seed, or None (default) to use system entropy.
  • max_active_workers (int, optional) — Nonnegative active worker cap per call: zero (default) is automatic, one is serial. Does not bound thread creation; parallel calls share a worker pool, bounded by configure_monte_carlo_pool().
  • sampling (MonteCarloSampling, optional) — Sampling method; defaults to pseudo_random.
  • antithetic (bool, optional) — Pair opposite normal draws; defaults to False. An odd path count leaves one unpaired path.

Raises ​

  • InvalidInputError — If paths are outside 1 through 10,000,000, max_active_workers is negative, or Sobol paths are not a power of two. Pricing with the shared sampler rejects more than one billion path steps, measured as the path count times the number of draws per path.

See Also ​

Accumulator : Supported contract.

Notes ​

Fixed seeds reproduce results across thread counts in the same build. Calls own their samples and share a library-owned Rayon pool. A worker cap does not reserve workers. Greeks pin a seed per request. Solves require an explicit seed; call with_resolved_seed() first. Solver tolerances do not measure sampling error. Parallel pricing raises UnsupportedOperationError in a child forked after the parent's first parallel request. Use spawn or max_active_workers=1. Simulation uses future observation dates and expiry. When an explicit knock-out schedule groups multiple fixed purchase dates, only knock-out dates and expiry require simulation. A current knock-out settles before any purchase. Scheduled transition and sampling workspace is capped at 1 GiB per request.

antithetic ​

Return whether opposite normal draws are paired.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

max_active_workers ​

Return the per-call active worker cap; zero selects automatic sizing.

Parallel calls share a CPU-sized pool; this cap does not bound thread creation.

path_count ​

Return the exact number of sampled paths.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.
  • OSError — If system entropy or worker creation fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.
  • OSError — If system entropy or worker creation fails.

Notes ​

Barrier engines use spot_shift for event-availability checks and continuous at-hit rebate derivatives. Autocallable and accumulator engines use numerical differences with the request's shifts. At expiry spot Greeks use terminal-payoff stencils with those shifts. Use numerical_greeks for scalar bump calculations on supported BSM pairs.

price_with_seed ​

python
price_with_seed(self, /, instrument, context)

Return the scalar price and the seed used by this request.

Parameters ​

  • instrument (object) — Any contract supported by price(), including American vanilla options.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • tuple[float, int or None] — Price and actual sampling seed; None when no sampling is needed. Reprice with replace(seed=seed) and the same inputs and controls to replay the result within the same build.

Raises ​

  • KiyosiError — If domain validation, engine applicability or scalar pricing fails.
  • OSError — If system entropy or worker creation fails.

Notes ​

Does not compute sampling uncertainty. Signal exceptions cancel the request and propagate without a partial result, as for price().

price_with_statistics ​

python
price_with_statistics(self, /, instrument, context)

Return a price with sampling uncertainty.

Parameters ​

  • instrument (object) — A supported contract. Vanilla statistics require EuropeanOption; other engines accept the same contracts as price().
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • MonteCarloEstimate — Mean, optional standard error and asymptotic 95% confidence interval. Sobol, insufficient independent samples, odd antithetic counts and zero observed sampling variance omit uncertainty. Known pseudorandom analytic values have zero error. Sampling uncertainty does not measure numerical integration bias.

Raises ​

  • KiyosiError — If pricing or uncertainty validation fails, or the contract is unsupported.
  • OSError — If system entropy or worker creation fails.

replace ​

python
replace(self, *, path_count=Ellipsis, seed=Ellipsis, max_active_workers=Ellipsis, sampling=Ellipsis, antithetic=Ellipsis) -> MonteCarloAccumulatorEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • path_count (object, optional) — Replacement field.
  • seed (object, optional) — Replacement field.
  • max_active_workers (object, optional) — Replacement field.
  • sampling (object, optional) — Replacement field.
  • antithetic (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

sampling ​

Return the sampling choice string: pseudo_random or sobol.

seed ​

Return the unsigned 64-bit seed, or None for system entropy.

with_resolved_seed ​

python
with_resolved_seed(self, /)

Return an engine with a concrete seed, preserving all other controls.

The returned engine uses the source seed if present. Reuse it to replay the draws within the same build.

Returns ​

  • object — Engine of the same class with a concrete seed.

Raises ​

  • OSError — If system entropy is unavailable.

MonteCarloAsianEngine ​

python
MonteCarloAsianEngine(*, path_count=131072, step_count=50, seed=None, max_active_workers=0, sampling='pseudo_random', antithetic=False)

BSM Monte Carlo pricing for continuous average-price options.

Parameters ​

  • path_count (int, optional) — Exact path count, 1 through 10,000,000; defaults to 131,072. Sobol sampling requires a power of two.
  • step_count (int, optional) — Grid size, 2 through 10,000; defaults to 50. Validated even when unused; see Notes for product-specific use.
  • seed (int or None, optional) — Unsigned 64-bit seed, or None (default) to use system entropy.
  • max_active_workers (int, optional) — Nonnegative active worker cap per call: zero (default) is automatic, one is serial. Does not bound thread creation; parallel calls share a worker pool, bounded by configure_monte_carlo_pool().
  • sampling (MonteCarloSampling, optional) — Sampling method; defaults to pseudo_random.
  • antithetic (bool, optional) — Pair opposite normal draws; defaults to False. An odd path count leaves one unpaired path.

Raises ​

  • InvalidInputError — If paths are outside 1 through 10,000,000, max_active_workers is negative, or Sobol paths are not a power of two. Pricing with the shared sampler rejects more than one billion path steps, measured as the path count times the number of draws per path. Also raised if step_count is outside 2 through 10,000.

See Also ​

GeometricAveragePriceOption : Supported contract. ArithmeticAveragePriceOption : Supported contract.

Notes ​

Fixed seeds reproduce results across thread counts in the same build. Calls own their samples and share a library-owned Rayon pool. A worker cap does not reserve workers. Greeks pin a seed per request. Solves require an explicit seed; call with_resolved_seed() first. Solver tolerances do not measure sampling error. Parallel pricing raises UnsupportedOperationError in a child forked after the parent's first parallel request. Use spawn or max_active_workers=1. Geometric averages and single fixings sample exact distributions. Arithmetic averages use step_count trapezoidal intervals with the first interval integrated conditionally. On suitable grids and market scales, a geometric call payoff on the same grid reduces sampling variance for arithmetic call prices and spot Greeks. Geometric pricing requires constant rates before expiry; arithmetic pricing accepts deterministic rate curves.

antithetic ​

Return whether opposite normal draws are paired.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

max_active_workers ​

Return the per-call active worker cap; zero selects automatic sizing.

Parallel calls share a CPU-sized pool; this cap does not bound thread creation.

path_count ​

Return the exact number of sampled paths.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.
  • OSError — If system entropy or worker creation fails.

price_strikes ​

python
price_strikes(self, /, instrument, context, *, strikes)

Price arithmetic-average options across strikes on common simulated paths.

Parameters ​

  • instrument (ArithmeticAveragePriceOption) — Template for option direction, dates, and realized history.
  • context (PricingContext) — Black–Scholes–Merton market snapshot.
  • strikes (iterable of float) — Finite positive strikes in output order, including duplicates.

Returns ​

  • tuple of float — Prices in input order. Empty input validates the contract and market.

Raises ​

  • KiyosiError — If contract, market, strike, workspace, or sampling validation fails.
  • TypeError, ValueError, OverflowError — If a strike representation is invalid.
  • OSError — If interrupted or entropy retrieval or worker creation fails.

Notes ​

A stochastic request uses one seed. Call with_resolved_seed() to replay results from an engine configured without a seed.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.
  • OSError — If system entropy or worker creation fails.

Notes ​

At positive volatility before expiry delta and gamma use native estimators. Zero volatility uses scalar differences. At expiry delta and gamma use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences throughout.

price_with_seed ​

python
price_with_seed(self, /, instrument, context)

Return the scalar price and the seed used by this request.

Parameters ​

  • instrument (object) — Any contract supported by price(), including American vanilla options.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • tuple[float, int or None] — Price and actual sampling seed; None when no sampling is needed. Reprice with replace(seed=seed) and the same inputs and controls to replay the result within the same build.

Raises ​

  • KiyosiError — If domain validation, engine applicability or scalar pricing fails.
  • OSError — If system entropy or worker creation fails.

Notes ​

Does not compute sampling uncertainty. Signal exceptions cancel the request and propagate without a partial result, as for price().

price_with_statistics ​

python
price_with_statistics(self, /, instrument, context)

Return a price with sampling uncertainty.

Parameters ​

  • instrument (object) — A supported contract. Vanilla statistics require EuropeanOption; other engines accept the same contracts as price().
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • MonteCarloEstimate — Mean, optional standard error and asymptotic 95% confidence interval. Sobol, insufficient independent samples, odd antithetic counts and zero observed sampling variance omit uncertainty. Known pseudorandom analytic values have zero error. Sampling uncertainty does not measure numerical integration bias.

Raises ​

  • KiyosiError — If pricing or uncertainty validation fails, or the contract is unsupported.
  • OSError — If system entropy or worker creation fails.

replace ​

python
replace(self, *, path_count=Ellipsis, step_count=Ellipsis, seed=Ellipsis, max_active_workers=Ellipsis, sampling=Ellipsis, antithetic=Ellipsis) -> MonteCarloAsianEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • path_count (object, optional) — Replacement field.
  • step_count (object, optional) — Replacement field.
  • seed (object, optional) — Replacement field.
  • max_active_workers (object, optional) — Replacement field.
  • sampling (object, optional) — Replacement field.
  • antithetic (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

sampling ​

Return the sampling choice string: pseudo_random or sobol.

seed ​

Return the unsigned 64-bit seed, or None for system entropy.

step_count ​

Return the configured grid size.

with_resolved_seed ​

python
with_resolved_seed(self, /)

Return an engine with a concrete seed, preserving all other controls.

The returned engine uses the source seed if present. Reuse it to replay the draws within the same build.

Returns ​

  • object — Engine of the same class with a concrete seed.

Raises ​

  • OSError — If system entropy is unavailable.

MonteCarloAutocallableEngine ​

python
MonteCarloAutocallableEngine(*, path_count=131072, seed=None, max_active_workers=0, sampling='pseudo_random', antithetic=False)

Flat-rate CPU Monte Carlo pricing for snowball and Phoenix notes.

Parameters ​

  • path_count (int, optional) — Exact path count, 1 through 10,000,000; defaults to 131,072. Sobol sampling requires a power of two.
  • seed (int or None, optional) — Unsigned 64-bit seed, or None (default) to use system entropy.
  • max_active_workers (int, optional) — Nonnegative active worker cap per call: zero (default) is automatic, one is serial. Does not bound thread creation; parallel calls share a worker pool, bounded by configure_monte_carlo_pool().
  • sampling (MonteCarloSampling, optional) — Sampling method; defaults to pseudo_random.
  • antithetic (bool, optional) — Pair opposite normal draws; defaults to False. An odd path count leaves one unpaired path.

Raises ​

  • InvalidInputError — If paths are outside 1 through 10,000,000, max_active_workers is negative, or Sobol paths are not a power of two. Pricing with the shared sampler rejects more than one billion path steps, measured as the path count times the number of draws per path.

See Also ​

SnowballOption : Supported contract. BinarySnowballOption : Supported contract. TernarySnowballOption : Supported contract. PhoenixOption : Supported contract.

Notes ​

Fixed seeds reproduce results across thread counts in the same build. Calls own their samples and share a library-owned Rayon pool. A worker cap does not reserve workers. Greeks pin a seed per request. Solves require an explicit seed; call with_resolved_seed() first. Solver tolerances do not measure sampling error. Parallel pricing raises UnsupportedOperationError in a child forked after the parent's first parallel request. Use spawn or max_active_workers=1. Simulation uses trading days when knock-in matters, or observation dates and expiry otherwise. Scheduled transition and sampling workspace is capped at 1 GiB per request.

antithetic ​

Return whether opposite normal draws are paired.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

max_active_workers ​

Return the per-call active worker cap; zero selects automatic sizing.

Parallel calls share a CPU-sized pool; this cap does not bound thread creation.

path_count ​

Return the exact number of sampled paths.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.
  • OSError — If system entropy or worker creation fails.

price_many ​

python
price_many(self, /, instruments, context, *, shared_grid=False)

Price a batch of notes of one product type using one market snapshot.

Parameters ​

  • instruments (iterable of autocallable contracts) — Up to 1,048,576 notes of the same concrete type. Accepts SnowballOption, BinarySnowballOption, TernarySnowballOption, and PhoenixOption. Compatible grids share paths within the workspace.
  • context (PricingContext) — Shared market snapshot and valuation instant.
  • shared_grid (bool, optional) — Share paths between compatible daily knock-in grids across cash-flow dates and maturities that fall on the grid. Defaults to False. Repeated references share one quote when False, or when the note has no daily knock-in monitoring. With True, seeded batch prices can differ from individually seeded scalar prices. Notes that differ only by maturity, periodic coupon or knock-in level can share cash-flow exposures.

Returns ​

  • tuple of float — Prices in input order. All simulation in the batch uses one seed. Configure a seed or call with_resolved_seed() to replay the prices.

Raises ​

  • UnsupportedOperationError — If the instruments have different types or the market is unsupported.
  • InvalidInputError — If the batch exceeds one billion estimated path and note visits, including deterministic schedule work.
  • KiyosiError — If scalar pricing validation or computation fails.
  • OSError — If interrupted or worker creation or entropy retrieval fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.
  • OSError — If system entropy or worker creation fails.

Notes ​

Barrier engines use spot_shift for event-availability checks and continuous at-hit rebate derivatives. Autocallable and accumulator engines use numerical differences with the request's shifts. At expiry spot Greeks use terminal-payoff stencils with those shifts. Use numerical_greeks for scalar bump calculations on supported BSM pairs.

price_with_seed ​

python
price_with_seed(self, /, instrument, context)

Return the scalar price and the seed used by this request.

Parameters ​

  • instrument (object) — Any contract supported by price(), including American vanilla options.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • tuple[float, int or None] — Price and actual sampling seed; None when no sampling is needed. Reprice with replace(seed=seed) and the same inputs and controls to replay the result within the same build.

Raises ​

  • KiyosiError — If domain validation, engine applicability or scalar pricing fails.
  • OSError — If system entropy or worker creation fails.

Notes ​

Does not compute sampling uncertainty. Signal exceptions cancel the request and propagate without a partial result, as for price().

price_with_statistics ​

python
price_with_statistics(self, /, instrument, context)

Return a price with sampling uncertainty.

Parameters ​

  • instrument (object) — A supported contract. Vanilla statistics require EuropeanOption; other engines accept the same contracts as price().
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • MonteCarloEstimate — Mean, optional standard error and asymptotic 95% confidence interval. Sobol, insufficient independent samples, odd antithetic counts and zero observed sampling variance omit uncertainty. Known pseudorandom analytic values have zero error. Sampling uncertainty does not measure numerical integration bias.

Raises ​

  • KiyosiError — If pricing or uncertainty validation fails, or the contract is unsupported.
  • OSError — If system entropy or worker creation fails.

replace ​

python
replace(self, *, path_count=Ellipsis, seed=Ellipsis, max_active_workers=Ellipsis, sampling=Ellipsis, antithetic=Ellipsis) -> MonteCarloAutocallableEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • path_count (object, optional) — Replacement field.
  • seed (object, optional) — Replacement field.
  • max_active_workers (object, optional) — Replacement field.
  • sampling (object, optional) — Replacement field.
  • antithetic (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

sampling ​

Return the sampling choice string: pseudo_random or sobol.

seed ​

Return the unsigned 64-bit seed, or None for system entropy.

with_resolved_seed ​

python
with_resolved_seed(self, /)

Return an engine with a concrete seed, preserving all other controls.

The returned engine uses the source seed if present. Reuse it to replay the draws within the same build.

Returns ​

  • object — Engine of the same class with a concrete seed.

Raises ​

  • OSError — If system entropy is unavailable.

MonteCarloBarrierEngine ​

python
MonteCarloBarrierEngine(*, path_count=131072, seed=None, max_active_workers=0, sampling='pseudo_random', antithetic=False)

Flat-rate Monte Carlo pricing for single- and double-barrier options.

Parameters ​

  • path_count (int, optional) — Exact path count, 1 through 10,000,000; defaults to 131,072. Sobol sampling requires a power of two.
  • seed (int or None, optional) — Unsigned 64-bit seed, or None (default) to use system entropy.
  • max_active_workers (int, optional) — Nonnegative active worker cap per call: zero (default) is automatic, one is serial. Does not bound thread creation; parallel calls share a worker pool, bounded by configure_monte_carlo_pool().
  • sampling (MonteCarloSampling, optional) — Sampling method; defaults to pseudo_random.
  • antithetic (bool, optional) — Pair opposite normal draws; defaults to False. An odd path count leaves one unpaired path.

Raises ​

  • InvalidInputError — If paths are outside 1 through 10,000,000, max_active_workers is negative, or Sobol paths are not a power of two. Pricing with the shared sampler rejects more than one billion path steps, measured as the path count times the number of draws per path.

See Also ​

BarrierOption : Supported single-barrier contract. DoubleBarrierOption : Supported double-barrier contract.

Notes ​

Fixed seeds reproduce results across thread counts in the same build. Calls own their samples and share a library-owned Rayon pool. A worker cap does not reserve workers. Greeks pin a seed per request. Solves require an explicit seed; call with_resolved_seed() first. Solver tolerances do not measure sampling error. Parallel pricing raises UnsupportedOperationError in a child forked after the parent's first parallel request. Use spawn or max_active_workers=1. Monitoring uses continuous survival or the original fixing dates. Dense scheduled knock-ins can integrate the terminal payoff conditional on the first hit. Near-strike payoffs retain movements even when terminal spot rounds to strike. Only delta and gamma are returned. Scheduled transition and sampling workspace is capped at 1 GiB per request.

antithetic ​

Return whether opposite normal draws are paired.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

max_active_workers ​

Return the per-call active worker cap; zero selects automatic sizing.

Parallel calls share a CPU-sized pool; this cap does not bound thread creation.

path_count ​

Return the exact number of sampled paths.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.
  • OSError — If system entropy or worker creation fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.
  • OSError — If system entropy or worker creation fails.

Notes ​

Barrier engines use spot_shift for event-availability checks and continuous at-hit rebate derivatives. Autocallable and accumulator engines use numerical differences with the request's shifts. At expiry spot Greeks use terminal-payoff stencils with those shifts. Use numerical_greeks for scalar bump calculations on supported BSM pairs.

price_with_seed ​

python
price_with_seed(self, /, instrument, context)

Return the scalar price and the seed used by this request.

Parameters ​

  • instrument (object) — Any contract supported by price(), including American vanilla options.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • tuple[float, int or None] — Price and actual sampling seed; None when no sampling is needed. Reprice with replace(seed=seed) and the same inputs and controls to replay the result within the same build.

Raises ​

  • KiyosiError — If domain validation, engine applicability or scalar pricing fails.
  • OSError — If system entropy or worker creation fails.

Notes ​

Does not compute sampling uncertainty. Signal exceptions cancel the request and propagate without a partial result, as for price().

price_with_statistics ​

python
price_with_statistics(self, /, instrument, context)

Return a price with sampling uncertainty.

Parameters ​

  • instrument (object) — A supported contract. Vanilla statistics require EuropeanOption; other engines accept the same contracts as price().
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • MonteCarloEstimate — Mean, optional standard error and asymptotic 95% confidence interval. Sobol, insufficient independent samples, odd antithetic counts and zero observed sampling variance omit uncertainty. Known pseudorandom analytic values have zero error. Sampling uncertainty does not measure numerical integration bias.

Raises ​

  • KiyosiError — If pricing or uncertainty validation fails, or the contract is unsupported.
  • OSError — If system entropy or worker creation fails.

replace ​

python
replace(self, *, path_count=Ellipsis, seed=Ellipsis, max_active_workers=Ellipsis, sampling=Ellipsis, antithetic=Ellipsis) -> MonteCarloBarrierEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • path_count (object, optional) — Replacement field.
  • seed (object, optional) — Replacement field.
  • max_active_workers (object, optional) — Replacement field.
  • sampling (object, optional) — Replacement field.
  • antithetic (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

sampling ​

Return the sampling choice string: pseudo_random or sobol.

seed ​

Return the unsigned 64-bit seed, or None for system entropy.

with_resolved_seed ​

python
with_resolved_seed(self, /)

Return an engine with a concrete seed, preserving all other controls.

The returned engine uses the source seed if present. Reuse it to replay the draws within the same build.

Returns ​

  • object — Engine of the same class with a concrete seed.

Raises ​

  • OSError — If system entropy is unavailable.

MonteCarloDigitalEngine ​

python
MonteCarloDigitalEngine(*, path_count=131072, seed=None, max_active_workers=0, sampling='pseudo_random', antithetic=False)

Flat-rate CPU Monte Carlo pricing for European digitals.

Parameters ​

  • path_count (int, optional) — Exact path count, 1 through 10,000,000; defaults to 131,072. Sobol sampling requires a power of two.
  • seed (int or None, optional) — Unsigned 64-bit seed, or None (default) to use system entropy.
  • max_active_workers (int, optional) — Nonnegative active worker cap per call: zero (default) is automatic, one is serial. Does not bound thread creation; parallel calls share a worker pool, bounded by configure_monte_carlo_pool().
  • sampling (MonteCarloSampling, optional) — Sampling method; defaults to pseudo_random.
  • antithetic (bool, optional) — Pair opposite normal draws; defaults to False. An odd path count leaves one unpaired path.

Raises ​

  • InvalidInputError — If paths are outside 1 through 10,000,000, max_active_workers is negative, or Sobol paths are not a power of two. Pricing with the shared sampler rejects more than one billion path steps, measured as the path count times the number of draws per path.

See Also ​

CashOrNothingOption : Supported contract. AssetOrNothingOption : Supported contract.

Notes ​

Fixed seeds reproduce results across thread counts in the same build. Calls own their samples and share a library-owned Rayon pool. A worker cap does not reserve workers. Greeks pin a seed per request. Solves require an explicit seed; call with_resolved_seed() first. Solver tolerances do not measure sampling error. Parallel pricing raises UnsupportedOperationError in a child forked after the parent's first parallel request. Use spawn or max_active_workers=1. Only likelihood-ratio delta and gamma are returned; other requested Greeks are absent.

antithetic ​

Return whether opposite normal draws are paired.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

max_active_workers ​

Return the per-call active worker cap; zero selects automatic sizing.

Parallel calls share a CPU-sized pool; this cap does not bound thread creation.

path_count ​

Return the exact number of sampled paths.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.
  • OSError — If system entropy or worker creation fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.
  • OSError — If system entropy or worker creation fails.

Notes ​

At positive volatility before expiry delta and gamma use native likelihood-ratio estimators. Zero volatility uses scalar differences. At expiry they use terminal-payoff stencils with the request's shifts. Use numerical_greeks for scalar differences throughout.

price_with_seed ​

python
price_with_seed(self, /, instrument, context)

Return the scalar price and the seed used by this request.

Parameters ​

  • instrument (object) — Any contract supported by price(), including American vanilla options.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • tuple[float, int or None] — Price and actual sampling seed; None when no sampling is needed. Reprice with replace(seed=seed) and the same inputs and controls to replay the result within the same build.

Raises ​

  • KiyosiError — If domain validation, engine applicability or scalar pricing fails.
  • OSError — If system entropy or worker creation fails.

Notes ​

Does not compute sampling uncertainty. Signal exceptions cancel the request and propagate without a partial result, as for price().

price_with_statistics ​

python
price_with_statistics(self, /, instrument, context)

Return a price with sampling uncertainty.

Parameters ​

  • instrument (object) — A supported contract. Vanilla statistics require EuropeanOption; other engines accept the same contracts as price().
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • MonteCarloEstimate — Mean, optional standard error and asymptotic 95% confidence interval. Sobol, insufficient independent samples, odd antithetic counts and zero observed sampling variance omit uncertainty. Known pseudorandom analytic values have zero error. Sampling uncertainty does not measure numerical integration bias.

Raises ​

  • KiyosiError — If pricing or uncertainty validation fails, or the contract is unsupported.
  • OSError — If system entropy or worker creation fails.

replace ​

python
replace(self, *, path_count=Ellipsis, seed=Ellipsis, max_active_workers=Ellipsis, sampling=Ellipsis, antithetic=Ellipsis) -> MonteCarloDigitalEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • path_count (object, optional) — Replacement field.
  • seed (object, optional) — Replacement field.
  • max_active_workers (object, optional) — Replacement field.
  • sampling (object, optional) — Replacement field.
  • antithetic (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

sampling ​

Return the sampling choice string: pseudo_random or sobol.

seed ​

Return the unsigned 64-bit seed, or None for system entropy.

with_resolved_seed ​

python
with_resolved_seed(self, /)

Return an engine with a concrete seed, preserving all other controls.

The returned engine uses the source seed if present. Reuse it to replay the draws within the same build.

Returns ​

  • object — Engine of the same class with a concrete seed.

Raises ​

  • OSError — If system entropy is unavailable.

MonteCarloEstimate ​

Monte Carlo price with optional sampling uncertainty.

Notes ​

Standard error uses independent pseudorandom observations or even antithetic pair means. The interval is an asymptotic 95% normal confidence interval. Uncertainty is absent for Sobol, insufficient independent samples, odd antithetic counts and zero observed sampling variance. Known pseudorandom settlements have zero uncertainty. The seed property identifies the actual draws, including for unseeded engines. None means no sampling occurred. Replay requires the same inputs, engine controls and build.

confidence_interval ​

Return the asymptotic 95% confidence interval, or None when unavailable.

price ​

Return the finite price in contract payment units.

seed ​

Return the sampling seed, or None when no sampling occurred.

standard_error ​

Return sampling standard error, or None when unavailable.

uncertainty_status ​

Return availability or the reason sampling uncertainty is absent.

MonteCarloSampling ​

python
MonteCarloSampling = typing.Literal['pseudo_random', 'sobol']

MonteCarloUncertaintyStatus ​

python
MonteCarloUncertaintyStatus = typing.Literal['available', 'unsupported_sampling', 'insufficient_observations', 'incomplete_antithetic_pair', 'zero_observed_variance']

MonteCarloVanillaEngine ​

python
MonteCarloVanillaEngine(*, path_count=131072, step_count=50, seed=None, max_active_workers=0, sampling='pseudo_random', antithetic=False)

Flat-rate Monte Carlo pricing for European and American vanilla options.

Parameters ​

  • path_count (int, optional) — Exact path count, 1 through 10,000,000; defaults to 131,072. Sobol sampling requires a power of two.
  • step_count (int, optional) — Exercise intervals, 1 through 10,000; defaults to 50. Validated even when unused; see Notes for product-specific use.
  • seed (int or None, optional) — Unsigned 64-bit seed, or None (default) to use system entropy.
  • max_active_workers (int, optional) — Nonnegative active worker cap per call: zero (default) is automatic, one is serial. Does not bound thread creation; parallel calls share a worker pool, bounded by configure_monte_carlo_pool().
  • sampling (MonteCarloSampling, optional) — Sampling method; defaults to pseudo_random.
  • antithetic (bool, optional) — Pair opposite normal draws; defaults to False. An odd path count leaves one unpaired path.

Raises ​

  • InvalidInputError — If paths are outside 1 through 10,000,000, max_active_workers is negative, or Sobol paths are not a power of two. Pricing with the shared sampler rejects more than one billion path steps, measured as the path count times the number of draws per path. Also raised if step_count is outside 1 through 10,000.

See Also ​

EuropeanOption : Supported contract. AmericanOption : Supported contract.

Notes ​

Fixed seeds reproduce results across thread counts in the same build. Calls own their samples and share a library-owned Rayon pool. A worker cap does not reserve workers. Greeks pin a seed per request. Solves require an explicit seed; call with_resolved_seed() first. Solver tolerances do not measure sampling error. Parallel pricing raises UnsupportedOperationError in a child forked after the parent's first parallel request. Use spawn or max_active_workers=1. European pricing samples the exact terminal distribution and ignores step_count. Near-strike payoffs preserve small movements even when the terminal spot rounds to the strike. American pricing uses least-squares Monte Carlo (Longstaff-Schwartz) with step_count exercise intervals and requires at least two before expiry. Greek scenarios with a common grid share Brownian coordinates. Large normalized exercise grids sample Brownian coordinates backward and retain one date at a time. Extreme spot ranges use checkpointed windows. Exercise workspace is capped at 1 GiB per request. Each rollback allows one billion simulated path steps and exercise updates combined, counting replayed steps and the exercise updates of each sensitivity scenario. Concurrent requests own separate workspaces. A failed workspace reservation raises ComputationFailureError if the allocator reports it.

antithetic ​

Return whether opposite normal draws are paired.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

max_active_workers ​

Return the per-call active worker cap; zero selects automatic sizing.

Parallel calls share a CPU-sized pool; this cap does not bound thread creation.

path_count ​

Return the exact number of sampled paths.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.
  • OSError — If system entropy or worker creation fails.

price_american_out_of_sample ​

python
price_american_out_of_sample(self, /, instrument, context, *, training_path_count)

Fit an American exercise rule and price it on separate paths.

Parameters ​

  • instrument (AmericanOption) — American call or put.
  • context (PricingContext) — Flat-rate calendar-time Black–Scholes–Merton snapshot.
  • training_path_count (int) — Number of paths used to fit the exercise rule. Sobol requires a power of two. The engine's path_count controls valuation paths.

Returns ​

  • float — The estimated value of the fitted exercise strategy.

Notes ​

The engine seed determines the separate training and valuation streams. Training decides whether to exercise immediately. If the policy continues, the estimate can fall below intrinsic value due to fitting and sampling error. Accuracy depends on both path counts and the number of exercise dates. Cancellation propagates without a partial price.

price_strikes ​

python
price_strikes(self, /, instrument, context, *, strikes)

Price American strikes on the same simulated spot paths.

Parameters ​

  • instrument (AmericanOption) — Template for option direction and dates.
  • context (PricingContext) — Flat-rate calendar-time Black–Scholes–Merton snapshot.
  • strikes (iterable of float) — Finite positive strikes.

Returns ​

  • tuple of float — Prices in strike order, preserving duplicates.

Raises ​

  • KiyosiError — If contract, market, strike or sampling validation fails.
  • OSError — If interrupted or entropy retrieval or worker creation fails.

Notes ​

The request uses one seed and fits a separate exercise rule for each distinct strike. Call with_resolved_seed() to set a replay seed. Simulation and exercise work share a limit of one billion updates. The strike batch has a separate 1 GiB workspace limit.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

price_with_seed ​

python
price_with_seed(self, /, instrument, context)

Return the scalar price and the seed used by this request.

Parameters ​

  • instrument (object) — Any contract supported by price(), including American vanilla options.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • tuple[float, int or None] — Price and actual sampling seed; None when no sampling is needed. Reprice with replace(seed=seed) and the same inputs and controls to replay the result within the same build.

Raises ​

  • KiyosiError — If domain validation, engine applicability or scalar pricing fails.
  • OSError — If system entropy or worker creation fails.

Notes ​

Does not compute sampling uncertainty. Signal exceptions cancel the request and propagate without a partial result, as for price().

price_with_statistics ​

python
price_with_statistics(self, /, instrument, context)

Return a price with sampling uncertainty.

Parameters ​

  • instrument (object) — A supported contract. Vanilla statistics require EuropeanOption; other engines accept the same contracts as price().
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • MonteCarloEstimate — Mean, optional standard error and asymptotic 95% confidence interval. Sobol, insufficient independent samples, odd antithetic counts and zero observed sampling variance omit uncertainty. Known pseudorandom analytic values have zero error. Sampling uncertainty does not measure numerical integration bias.

Raises ​

  • KiyosiError — If pricing or uncertainty validation fails, or the contract is unsupported.
  • OSError — If system entropy or worker creation fails.

replace ​

python
replace(self, *, path_count=Ellipsis, step_count=Ellipsis, seed=Ellipsis, max_active_workers=Ellipsis, sampling=Ellipsis, antithetic=Ellipsis) -> MonteCarloVanillaEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • path_count (object, optional) — Replacement field.
  • step_count (object, optional) — Replacement field.
  • seed (object, optional) — Replacement field.
  • max_active_workers (object, optional) — Replacement field.
  • sampling (object, optional) — Replacement field.
  • antithetic (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

sampling ​

Return the sampling choice string: pseudo_random or sobol.

seed ​

Return the unsigned 64-bit seed, or None for system entropy.

step_count ​

Return the configured grid size.

with_resolved_seed ​

python
with_resolved_seed(self, /)

Return an engine with a concrete seed, preserving all other controls.

The returned engine uses the source seed if present. Reuse it to replay the draws within the same build.

Returns ​

  • object — Engine of the same class with a concrete seed.

Raises ​

  • OSError — If system entropy is unavailable.

PhoenixCouponQuote ​

Absolute coupon rate per qualifying observation.

Attributes ​

  • coupon_per_period (float) — Signed decimal rate per qualifying observation, without time accrual.

PricingResult ​

Finite price and optional finite price sensitivities.

Notes ​

Unavailable or unrequested Greeks are None. All derivatives are unscaled: spot uses spot units, volatility and rates use decimal values, and forward valuation time uses years (Actual/365 Fixed). Other inputs, including expiry, are held fixed. With price V, spot S, volatility σ and valuation time t: delta = ∂V/∂S, gamma = ∂²V/∂S², speed = ∂³V/∂S³, theta = ∂V/∂t, charm = ∂²V/(∂S∂t), color = ∂³V/(∂S²∂t), vega = ∂V/∂σ, volga = ∂²V/∂σ², vanna = ∂²V/(∂S∂σ), and zomma = ∂³V/(∂S²∂σ). Rho shifts the risk-free curve in parallel; dividend rho shifts the dividend-yield curve in parallel: rho = ∂V/∂r and dividend_rho = ∂V/∂q, with decimal continuously compounded shifts r and q. Time derivatives hold market curves fixed. Positive time increments advance valuation.

charm ​

Return charm, or None if unrequested or unavailable.

color ​

Return color, or None if unrequested or unavailable.

delta ​

Return delta, or None if unrequested or unavailable.

dividend_rho ​

Return dividend rho, or None if unrequested or unavailable.

gamma ​

Return gamma, or None if unrequested or unavailable.

price ​

Return the finite price in contract payment units.

requested ​

Return requested Greek names in the library's stable measure order.

require ​

python
require(self, /, measure)

Return a requested Greek or raise when it is unavailable.

Parameters ​

  • measure (str) — Greek name, such as delta or vega.

Returns ​

  • float — Finite sensitivity in PricingResult reporting units.

Raises ​

  • GreekUnavailableError — If the measure has no value. Its greek and status attributes identify the measure and reason. Also inherits UnsupportedOperationError.
  • ValueError — If the Greek name is unknown.
  • TypeError — If the measure is not a string.

rho ​

Return rho, or None if unrequested or unavailable.

seed ​

Return the simulation seed used by this request, or None without sampling.

speed ​

Return speed, or None if unrequested or unavailable.

status ​

python
status(self, /, measure)

Return the availability status of a Greek.

Parameters ​

  • measure (str) — Greek name.

Returns ​

  • str — "available", "not_requested", "unsupported" (engine/model coverage), "undefined" (no derivative at this valuation), or "stencil_unavailable" (try different numerical controls).

Raises ​

  • ValueError — If the Greek name is unknown.
  • TypeError — If the measure is not a string.

supported ​

Return engine/model-supported names, regardless of availability.

theta ​

Return theta, or None if unrequested or unavailable.

vanna ​

Return vanna, or None if unrequested or unavailable.

vega ​

Return vega, or None if unrequested or unavailable.

volga ​

Return volga, or None if unrequested or unavailable.

zomma ​

Return zomma, or None if unrequested or unavailable.

QuadratureAccumulatorEngine ​

python
QuadratureAccumulatorEngine(*, asset_step_count=512, integration_standard_deviations=8.0)

Flat-rate quadrature pricing.

Parameters ​

  • asset_step_count (int, optional) — Base number of spatial intervals, at least 4; defaults to 512. Event boundaries may add intervals; Simpson panels round up to even.
  • integration_standard_deviations (float, optional) — Positive finite integration extent in standard deviations; defaults to 8.

Raises ​

  • InvalidInputError — If asset_step_count is below 4 or integration_standard_deviations is nonpositive or non-finite. Gaussian grid pricing also raises this if the estimated grid or transition workspace exceeds 256 MiB, or rollback exceeds one billion node and cell visits. Simpson integration, when used, rejects more than 250 million panels across all sections.

See Also ​

Accumulator : Supported contract.

asset_step_count ​

Return the configured number of spatial intervals.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

integration_standard_deviations ​

Return the integration extent in standard deviations.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, integration_standard_deviations=Ellipsis) -> QuadratureAccumulatorEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • integration_standard_deviations (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

QuadratureAutocallableEngine ​

python
QuadratureAutocallableEngine(*, asset_step_count=512, integration_standard_deviations=8.0)

Flat-rate quadrature pricing.

Parameters ​

  • asset_step_count (int, optional) — Base number of spatial intervals, at least 4; defaults to 512. Event boundaries may add intervals; Simpson panels round up to even.
  • integration_standard_deviations (float, optional) — Positive finite integration extent in standard deviations; defaults to 8.

Raises ​

  • InvalidInputError — If asset_step_count is below 4 or integration_standard_deviations is nonpositive or non-finite. Gaussian grid pricing also raises this if the estimated grid or transition workspace exceeds 256 MiB, or rollback exceeds one billion node and cell visits. Simpson integration, when used, rejects more than 250 million panels across all sections.

See Also ​

SnowballOption : Supported contract. BinarySnowballOption : Supported contract. TernarySnowballOption : Supported contract. PhoenixOption : Supported contract.

Notes ​

Preserves cash and asset payments below the spatial grid, including zero-lower-strike losses after large spot declines.

asset_step_count ​

Return the configured number of spatial intervals.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

integration_standard_deviations ​

Return the integration extent in standard deviations.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, integration_standard_deviations=Ellipsis) -> QuadratureAutocallableEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • integration_standard_deviations (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

QuadratureBarrierEngine ​

python
QuadratureBarrierEngine(*, asset_step_count=512, integration_standard_deviations=8.0)

Flat-rate quadrature pricing.

Parameters ​

  • asset_step_count (int, optional) — Base number of spatial intervals, at least 4; defaults to 512. Event boundaries may add intervals; Simpson panels round up to even.
  • integration_standard_deviations (float, optional) — Positive finite integration extent in standard deviations; defaults to 8.

Raises ​

  • InvalidInputError — If asset_step_count is below 4 or integration_standard_deviations is nonpositive or non-finite. Gaussian grid pricing also raises this if the estimated grid or transition workspace exceeds 256 MiB, or rollback exceeds one billion node and cell visits. Simpson integration, when used, rejects more than 250 million panels across all sections.

See Also ​

BarrierOption : Supported contract.

asset_step_count ​

Return the configured number of spatial intervals.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

integration_standard_deviations ​

Return the integration extent in standard deviations.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, integration_standard_deviations=Ellipsis) -> QuadratureBarrierEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • integration_standard_deviations (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

QuadratureDigitalEngine ​

python
QuadratureDigitalEngine(*, asset_step_count=512, integration_standard_deviations=8.0)

Flat-rate quadrature pricing.

Parameters ​

  • asset_step_count (int, optional) — Base number of spatial intervals, at least 4; defaults to 512. Event boundaries may add intervals; Simpson panels round up to even.
  • integration_standard_deviations (float, optional) — Positive finite integration extent in standard deviations; defaults to 8.

Raises ​

  • InvalidInputError — If asset_step_count is below 4 or integration_standard_deviations is nonpositive or non-finite. Gaussian grid pricing also raises this if the estimated grid or transition workspace exceeds 256 MiB, or rollback exceeds one billion node and cell visits. Simpson integration, when used, rejects more than 250 million panels across all sections.

See Also ​

CashOrNothingOption : Supported European cash payment. AssetOrNothingOption : Supported European asset payment.

Notes ​

Uses Simpson integration on the paying side of the strike under flat-rate BSM. The extent is centered on the payment-weighted normal density; omitted tails are zero. Equality at expiry pays zero. Check step-count and extent convergence separately; completion provides no error estimate. Numerical Greeks also require bump convergence checks.

asset_step_count ​

Return the configured number of spatial intervals.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

integration_standard_deviations ​

Return the integration extent in standard deviations.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, integration_standard_deviations=Ellipsis) -> QuadratureDigitalEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • integration_standard_deviations (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

QuadratureVanillaEngine ​

python
QuadratureVanillaEngine(*, asset_step_count=512, time_step_count=200, integration_standard_deviations=8.0)

Flat-rate quadrature pricing.

Parameters ​

  • asset_step_count (int, optional) — Base number of spatial intervals, at least 4; defaults to 512. Event boundaries may add intervals; Simpson panels round up to even.
  • time_step_count (int, optional) — American exercise intervals, at least 1, with a default of 200. European pricing ignores this setting.
  • integration_standard_deviations (float, optional) — Positive finite integration extent in standard deviations; defaults to 8.

Raises ​

  • InvalidInputError — If asset_step_count is below 4 or integration_standard_deviations is nonpositive or non-finite. Gaussian grid pricing also raises this if the estimated grid or transition workspace exceeds 256 MiB, or rollback exceeds one billion node and cell visits. Simpson integration, when used, rejects more than 250 million panels across all sections. Also raised if time_step_count is below 1.

See Also ​

EuropeanOption : Supported contract. AmericanOption : Supported contract.

Notes ​

Uses Simpson integration for European options and Gaussian backward induction with piecewise cubic continuation interpolation for American options. American calls with nonnegative rates and nonpositive dividend yields use the analytic European price. With one exercise interval, American pricing takes the greater of immediate exercise and the analytic European price without using a spatial grid. With more intervals both values are lower bounds on the rollback price. Requires flat-rate BSM parameters. Check spatial, time and integration-extent convergence separately; fixed-grid completion does not estimate error. Higher Greeks near exercise boundaries also require bump convergence checks.

asset_step_count ​

Return the configured number of spatial intervals.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

integration_standard_deviations ​

Return the integration extent in standard deviations.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_strikes ​

python
price_strikes(self, /, instrument, context, *, strikes)

Price American options at multiple strikes on one continuation curve.

Parameters ​

  • instrument (AmericanOption) — Template for option direction and dates.
  • context (PricingContext) — Flat-rate Black–Scholes–Merton snapshot.
  • strikes (iterable of float) — Up to 1,048,576 finite positive strikes, including duplicates.

Returns ​

  • tuple of float — Prices in strike order, preserving duplicates.

Raises ​

  • InvalidInputError — If the batch exceeds the strike limit or one billion estimated rollback and query visits.
  • KiyosiError — If contract, market, strike or pricing validation fails.
  • OSError — If interrupted.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

replace ​

python
replace(self, *, asset_step_count=Ellipsis, time_step_count=Ellipsis, integration_standard_deviations=Ellipsis) -> QuadratureVanillaEngine

Return a validated copy with replacement fields.

Omitted fields and fields set to Ellipsis use the instance's values. None clears nullable fields. The class documentation describes the accepted type and meaning of each field.

Parameters ​

  • asset_step_count (object, optional) — Replacement field.
  • time_step_count (object, optional) — Replacement field.
  • integration_standard_deviations (object, optional) — Replacement field.

Returns ​

  • object — Validated instance of the same class.

Raises ​

  • InvalidInputError — If fields fail constructor validation.
  • TypeError — If a field name or representation is invalid.

time_step_count ​

Return the configured American exercise interval count.

SnowballCouponQuote ​

Annual first-observation coupon and its maturity linkage.

Attributes ​

  • first_observation_coupon (float) — Annual decimal coupon at the first observation.
  • quote_convention (CouponQuoteConvention) — Whether the maturity coupon shifts with observation coupons.

TurnbullWakemanArithmeticAveragePriceEngine ​

python
TurnbullWakemanArithmeticAveragePriceEngine()

Continuous arithmetic average-price Asian approximation.

Requires flat rates before expiry. Uses the Turnbull-Wakeman (Levy-compatible) lognormal moment-matching approximation.

See Also ​

ArithmeticAveragePriceOption : Supported contract.

greek_method ​

python
greek_method(self, /, instrument, context)

Return the Greek estimation method and its potential shift controls.

Checks model applicability; pricing validates life and history.

Parameters ​

  • instrument (object) — Contract supported by this engine.
  • context (PricingContext) — Market snapshot.

Returns ​

  • GreekMethod — Method name and the shift controls this estimation path may use.

Raises ​

  • KiyosiError — If the model is unsupported by this engine.

price ​

python
price(self, /, instrument, context)

Return the price.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.

Returns ​

  • float — Present value of remaining contractual payments.

Raises ​

  • KiyosiError — If domain validation, engine applicability or numerical pricing fails.

price_with_greeks ​

python
price_with_greeks(self, /, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Return the price and selected sensitivities using engine estimators.

Omitted controls or Ellipsis use shared defaults. Shifts affect numerical fallbacks, event checks and terminal stencils; native estimators and engine/model Greek coverage are preserved. Every supplied control is validated.

Parameters ​

  • instrument (object) — Supported contract; see the engine class for accepted types.
  • context (PricingContext) — Market snapshot and valuation instant.
  • greeks (str or iterable of str) — Greek names or "all" to request every measure; duplicates are ignored. An empty iterable requests price only.
  • spot_shift (float or None, optional) — Positive absolute spot bump; None selects the product's automatic bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump; None selects an automatic time step.

Returns ​

  • PricingResult — Price and requested Greeks. Unsupported or undefined Greeks are None, with time Greeks absent at expiry; other terminal Greeks follow the payoff.

Raises ​

  • KiyosiError — If controls are invalid, pricing fails or a feasible bumped valuation fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If representations, Greek names or keyword arguments are invalid.

Notes ​

Before expiry, requested Greeks use scalar numerical differences with the request's shift controls. Omitted controls use engine defaults.

configure_monte_carlo_pool ​

python
configure_monte_carlo_pool(*, max_workers)

Cap the process-wide Monte Carlo pool before its first parallel request.

Parameters ​

  • max_workers (int) — Positive maximum worker count, limited further by available CPUs.

Raises ​

  • InvalidInputError — If max_workers is nonpositive.
  • UnsupportedOperationError — If a different cap is supplied after pool initialization or the calling process forked after the parent's first parallel request.
  • TypeError — If max_workers is a bool or does not support integer indexing.
  • OverflowError — If max_workers is outside the signed 32-bit integer range.

Notes ​

Creates no threads. The default pool size is available CPU parallelism. Configure each process before submitting parallel pricing work. Successful calls set the cap before initialization. An initialized pool accepts only the configured cap. Engine max_active_workers caps active work per request within this pool. Use multiprocessing's spawn start method if the parent has already run parallel Monte Carlo. Serial engines support pricing in a forked child.

implied_coupon ​

python
implied_coupon(engine, instrument, context, observed_price, *, quote_convention=Ellipsis, lower_bound=0.0, upper_bound=2.0, price_tolerance=1e-08, parameter_tolerance=1e-08, max_iterations=100)

Solve for the coupon that reproduces an autocallable note's price.

Parameters ​

  • engine (object) — QuadratureAutocallableEngine, FiniteDifferenceAutocallableEngine or MonteCarloAutocallableEngine.
  • instrument (object) — SnowballOption, BinarySnowballOption, TernarySnowballOption or PhoenixOption.
  • context (PricingContext) — Market snapshot.
  • observed_price (float) — Finite target price in the engine's payment units.
  • quote_convention (CouponQuoteConvention, optional) — Required for snowballs. Use shift_maturity_coupon to shift the maturity coupon with observation coupons or preserve_maturity_coupon to keep it fixed. Omit for Phoenix.
  • lower_bound (float, optional) — Finite lower coupon in the contract's units; defaults to 0. Signed bounds are accepted when the resulting contract terms are valid. For shifted ternary maturity coupons, the bracket is intersected with the valid domain that keeps maturity at or above the fixed minimum.
  • upper_bound (float, optional) — Finite upper coupon in the same units, above lower_bound; defaults to 2.
  • price_tolerance (float, optional) — Positive finite absolute price residual tolerance; defaults to 1e-8.
  • parameter_tolerance (float, optional) — Positive finite bracket-width tolerance in the contract's coupon units; defaults to 1e-8. Bracket convergence without a price match raises NonConvergenceError.
  • max_iterations (int, optional) — Positive iteration budget; defaults to 100. Endpoint and affine-interpolation evaluations do not use this budget.

Returns ​

  • SnowballCouponQuote or PhoenixCouponQuote — Apply with instrument.with_coupon(**quote). A snowball quote contains first_observation_coupon, an annual decimal rate, and quote_convention. A Phoenix quote contains coupon_per_period, a decimal rate per qualifying observation.

Raises ​

  • TypeError — If an argument has the wrong representation or the quote convention is missing for a snowball or supplied for Phoenix.
  • ValueError — If the quote convention is unknown.
  • InvalidInputError — If the quote, settings or repriced terms are invalid.
  • UnsupportedOperationError — If the combination is unsupported or the parameter is not identifiable.
  • RootNotBracketedError — If the supplied endpoints do not bracket the target. Also raised when the bracket has no nondegenerate interval in the valid domain.
  • NonConvergenceError — If the iteration budget is exhausted or the bracket converges without a price match.
  • ComputationFailureError — If a price, residual or numerical evaluation is non-finite.

Notes ​

Pricing failures propagate. Monte Carlo solves require an explicit seed; call with_resolved_seed() first; tolerances constrain the sampled price curve, not its sampling error. Snowballs shift all observation coupons relative to the first one, including past observations. The maturity convention controls the final coupon. The ternary minimum is a fixed lower bound. Rates, brackets and parameter tolerances use annual decimal units for snowballs and periodic decimal units for Phoenix. Trials use affine interpolation, then bisection. Model support follows the engine, including local volatility with finite differences.

implied_volatility ​

python
implied_volatility(engine, instrument, context, observed_price, *, lower_bound, upper_bound, price_tolerance=1e-08, parameter_tolerance=1e-08, max_iterations=100)

Solve the annualized volatility that reproduces an observed price.

Parameters ​

  • engine (object) — Supported pricing engine for the instrument.
  • instrument (object) — Contract to reprice.
  • context (PricingContext) — Market snapshot.
  • observed_price (float) — Finite target price in the engine's payment units.
  • lower_bound (float) — Required nonnegative finite lower annualized volatility in decimal units.
  • upper_bound (float) — Required finite upper annualized volatility, above lower_bound.
  • price_tolerance (float, optional) — Positive finite absolute price residual tolerance; defaults to 1e-8.
  • parameter_tolerance (float, optional) — Positive finite bracket-width tolerance in decimal units; defaults to 1e-8. Bracket convergence without a price match raises NonConvergenceError.
  • max_iterations (int, optional) — Positive iteration budget; defaults to 100.

Returns ​

  • float — Annualized BSM volatility in decimal units.

Raises ​

  • InvalidInputError — If the quote, settings or repriced terms are invalid.
  • UnsupportedOperationError — If the combination is unsupported or the parameter is not identifiable.
  • RootNotBracketedError — If the supplied endpoints do not bracket the target.
  • NonConvergenceError — If the iteration budget is exhausted or the bracket converges without a price match.
  • ComputationFailureError — If a price, residual or numerical evaluation is non-finite.

Notes ​

Pricing failures propagate. Monte Carlo solves require an explicit seed; call with_resolved_seed() first; tolerances constrain the sampled price curve, not its sampling error. Digital and barrier prices can have several volatility roots. The required bracket selects a root; CRR engines restrict it to their admissible tree domain. For American options, a matching immediate-exercise value at both bracket endpoints leaves volatility unidentified.

numerical_greeks ​

python
numerical_greeks(engine, instrument, context, greeks, *, spot_shift=Ellipsis, volatility_shift=Ellipsis, rate_shift=Ellipsis, time_shift=Ellipsis)

Compute numerical BSM Greeks through any supported built-in scalar engine.

Parameters ​

  • engine, instrument (object) — Built-in engine and one of its supported contracts.
  • context (PricingContext) — BSM market snapshot; local-volatility and Heston models are rejected.
  • greeks (str or iterable of str) — Required measure names or "all". Unsupported instrument/engine pairs are checked before Greek names.
  • spot_shift (float or None, optional) — Positive absolute spot bump. Omission, Ellipsis or None selects the automatic engine/product bump.
  • volatility_shift (float or None, optional) — Positive decimal volatility bump. None selects the smaller of 0.0001 and half the current volatility. Omission or Ellipsis uses shared defaults.
  • rate_shift (float, optional) — Positive decimal rate bump; defaults to 0.0001. Ellipsis uses the default.
  • time_shift (datetime.timedelta or None, optional) — Positive whole-microsecond bump. Omission, Ellipsis or None selects an automatic bump up to one day, shortened to avoid observations. Use smaller durations to check convergence for intraday valuations and between observations.

Returns ​

  • PricingResult — Numerical sensitivities with request and availability metadata. An unavailable numerical stencil has status "stencil_unavailable"; undefined derivatives retain "undefined". Units match native price_with_greeks.

Raises ​

  • KiyosiError — If settings are invalid, or model, contract or bumped pricing fails.
  • ValueError — If a Greek name is unknown.
  • TypeError — If greeks is not a string or iterable of strings.
  • OSError — If system entropy or worker creation fails.

Notes ​

Monte Carlo draws use a fixed seed throughout the request, matching the Rust numerical_greeks operation. American Monte Carlo uses the exercise grid for both rate bumps when the bumps fall on opposite sides of the terminal-sampling boundary.