Skip to main content
Pro Feature. Requires a Pro or Ultra subscription. Get started at api.mathematicalcompany.com
What is this? Standard Avellaneda-Stoikov market making operates in probability space (0 to 1), but this causes boundary compression problems - prices near 0 or 1 have distorted spread and risk. Logit-space pricing transforms prices via logit(p) = ln(p/(1-p)), moving calculations to the real line where Gaussian assumptions work properly. The result: correct Greeks, better spreads near boundaries, and a tradable “belief volatility” parameter analogous to implied vol in options.

Logit-Space Pricing

Horizon implements the logit-space pricing framework from Dalen 2025 (“Toward Black-Scholes for Prediction Markets”). All math is in Rust; Python pipeline wrappers handle feed ingestion and context injection.

Logit Transform

hz.logit() / hz.sigmoid() - the core transforms between probability and logit space.

Logit Greeks

hz.logit_greeks() - delta, gamma, theta, belief-vega in the correct mathematical space.

Logit Market Maker

hz.logit_market_maker() - full pipeline factory using logit reservation price and optimal spread.

PnL Decomposition

hz.logit_pnl_decompose() - Taylor decomposition of PnL into directional, curvature, vega, and residual.

Why Logit Space?

In probability space, market making near boundaries (p near 0 or 1) has three problems:
  1. Spread compression: An optimal spread of 0.04 makes no sense at p=0.02
  2. Greek distortion: Delta and gamma behave differently near boundaries
  3. Non-Gaussian dynamics: Price changes aren’t normally distributed in probability space
The logit transform x = ln(p/(1-p)) maps (0,1) to (-inf, +inf), where:
  • Gaussian diffusion assumptions hold
  • Spread scales naturally with p(1-p) (sigmoid derivative)
  • Greeks have clean closed-form expressions

Core Functions

hz.logit / hz.sigmoid

The fundamental transforms.

hz.sigmoid_prime / hz.sigmoid_double_prime

Derivatives of the sigmoid function. Used internally for Greeks computation.

Logit Market Making

hz.logit_reservation_price

Compute the logit-space inventory-skewed fair value.

hz.logit_optimal_spread

Compute the logit-space optimal bid-ask spread.

hz.toxicity_adjusted_spread

Widen spread based on VPIN toxicity signal. Bridges the VPIN detector to spread adjustment.

Logit Greeks

hz.logit_greeks

Compute prediction market Greeks in logit space.

LogitGreeks Type


PnL Decomposition

hz.logit_pnl_decompose

Taylor decomposition of realized PnL into component contributions.

LogitPnlAttribution Type


Pipeline Integration

hz.logit_market_maker

Full logit-space market maker for hz.run(). Drop-in replacement for hz.market_maker().

hz.logit_greeks_pipeline

Injects logit Greeks into ctx.params each cycle.

hz.logit_pnl_attribution_pipeline

Tracks per-market PnL decomposition over time.

Greeks-Based PnL Attribution

hz.greeks_attribution

Batch PnL decomposition for multiple positions using logit Greeks.