Option Valleypowered by Riptide, The World's Leading AI Research Lab
Docs

Option Valley docs

The engine is a C library with one call per job. This page covers the shape of the API. The full reference, headers and examples ship with the evaluation kit.

Quickstart

Put your quotes in arrays, one array per field, and call ov_iv_solve. Every array has length n.

#include "optionvalley.h"

double sigma[N], greeks[6 * N];
ov_iv_solve(N, price, fwd, strike, years, is_call,
            sigma, greeks, OV_WIDEST, 0);

Link with -loptionvalley. The library selects the best code path for the processor; every path returns identical results.

API names on this page are a preview. The kit's headers are the reference.

Inputs

FieldMeaning
priceOption price on the forward: the market price divided by the discount factor to expiry.
fwdForward of the underlying to expiry. You choose the rates and dividends behind it.
strikeStrike, in the same units as the forward.
yearsTime to expiry in years, from one minute up.
is_call1 for a call, 0 for a put.

Taking the price on the forward keeps discounting and dividends in your hands: the engine does not guess a curve.

Outputs

sigma receives the Black implied volatility per quote. If greeks is not NULL it receives the requested Greeks, laid out as one block of n per Greek; the evaluation pack documents the full set to third order.

Greeks

Greeks are those of the undiscounted Black price at the solved volatility; multiply by the discount factor for discounted Greeks. Every Greek to third order is available, including mixed terms, validated against a high-precision reference.

Certificates

ov_iv_certify returns, per quote, the smallest relative half-width w for which the exact implied volatility of your inputs provably lies in [sigma (1 - w), sigma (1 + w)]. A width of 0 means no bracket was found, for example when the time value is below 1e-290.

Same results everywhere

Option Valley returns identical results on every supported CPU and GPU, at every thread count. A build identifier recorded next to an output hash lets any team reproduce a run exactly.

Threads

The last argument sets the number of threads; 0 uses all of them. Books of any size are distributed evenly.

GPU

The NVIDIA GPU build returns the same results as the CPU build. Keep the book resident on the device for the best throughput, or divide a book between CPU and GPU.

Functions

FunctionDoes
ov_iv_solveImplied volatility and, optionally, six Greeks for a book.
ov_iv_certifyA proven bracket around each solved volatility.
ov_american_ivAmerican implied volatility and Greeks, with early exercise and discrete dividends.
ov_surface_fitFit a volatility surface across expiries and recalculate a book from it.
ov_build_infoBuild identifier and version, to record next to an output hash.

Edge cases

A quote with zero time value returns a volatility of 0. A price outside the no-arbitrage bounds returns NaN. Neither stops the rest of the book.

Request the evaluation kit