Skip to main content
Pro Feature. Requires a Pro or Ultra subscription. Get started at api.mathematicalcompany.com
What is this? Prediction market contracts are binary options. Standard Black-Scholes pricing ignores volatility smiles, jumps, and fat tails. These three models (Heston, Merton, Variance Gamma) capture those features and produce more accurate theoretical prices. Use them to identify mispriced contracts, extract implied volatility surfaces, and build pricing-based trading signals.

Characteristic Function Pricing

Prediction market contracts are binary options: they pay 1 dollar if an event occurs and 0 otherwise. Standard Black-Scholes assumes log-normal returns, which ignores volatility smiles, jumps, and fat tails. Horizon implements three stochastic models that capture these features via characteristic function inversion: Heston (stochastic volatility), Merton (jump-diffusion), and Variance Gamma (pure-jump). All numerical integration and root-finding runs in Rust.

Heston Model

Stochastic volatility with mean reversion. Captures volatility smiles and term structure.

Merton Jump-Diffusion

Diffusion plus Poisson jumps. Captures sudden event-driven moves.

Variance Gamma

Pure-jump process with no diffusion component. Captures skewness and excess kurtosis.

Implied Volatility

hz.implied_vol_from_binary() backs out the implied volatility from an observed binary price.

Model Parameters

HestonParams

Parameters for the Heston stochastic volatility model.
The Feller condition 2 * kappa * theta > sigma^2 ensures variance stays positive. If violated, the variance process can hit zero, which is handled numerically but may produce less reliable prices.

MertonParams

Parameters for the Merton jump-diffusion model.

VGParams

Parameters for the Variance Gamma model.

Pricing Functions

hz.binary_price_heston

Price a binary option under the Heston stochastic volatility model.

hz.binary_price_merton

Price a binary option under the Merton jump-diffusion model.

hz.binary_price_vg

Price a binary option under the Variance Gamma model.

Common Parameters

All three pricing functions share these parameters:

BinaryPrice Type


hz.implied_vol_from_binary

Back out the implied volatility from an observed binary option price using Brent’s root-finding method.
Returns float: the annualized implied volatility. Returns NaN if root-finding fails to converge.

Comparing Models


Pipeline Integration

The hz.pricing_signal() pipeline function computes model-implied fair values each cycle and injects them into ctx.params["pricing"].

Parameters


Mathematical Background

A binary option price is P(S_T >= K) under the risk-neutral measure. This probability can be recovered from the characteristic function phi(u) of log(S_T) via the Gil-Pelaez inversion formula:P(S_T >= K) = 0.5 + (1/pi) * integral_0^inf Re[exp(-iu*ln(K)) * phi(u) / (iu)] duEach model provides a closed-form characteristic function, and the integral is evaluated numerically using adaptive Gauss-Kronrod quadrature in Rust.
The Heston (1993) model specifies:dS/S = mu*dt + sqrt(V)dW_1 dV = kappa(theta - V)dt + sigmasqrt(V)*dW_2 corr(dW_1, dW_2) = rhoThe characteristic function has a known closed form involving complex logarithms. Negative rho (the typical case) produces a left-skewed return distribution, matching the empirical observation that large downward moves are accompanied by volatility spikes.
The Merton (1976) model adds compound Poisson jumps to geometric Brownian motion:dS/S = mudt + sigmadW + (e^J - 1)*dNwhere N is a Poisson process with intensity lambda, and J ~ Normal(mu_J, sigma_J^2). The characteristic function decomposes into a diffusion part and a jump part, each with a closed form. This model is useful when prediction markets experience sudden, discrete price moves (e.g., breaking news).
The Variance Gamma (Madan, Carr, Chang 1998) model is a pure-jump process constructed by subordinating a Brownian motion with drift by a gamma process:X(t) = thetaG(t) + sigmaW(G(t))where G(t) is a gamma process with unit mean rate and variance rate nu. The VG model has three parameters controlling volatility (sigma), skewness (theta), and kurtosis (nu). It produces return distributions with heavier tails than normal and can capture the empirical observation that prediction market returns are leptokurtic.
Characteristic function pricing assumes the underlying follows the specified stochastic process. Prediction market prices are bounded in [0, 1] and may not follow any of these models exactly. Use model prices as signals (fair value estimates) rather than exact arbitrage bounds. Calibrate parameters to recent market data using hz.implied_vol_from_binary() as a starting point.