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.
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.
spread = hz.logit_optimal_spread( belief_vol=0.2, # Belief volatility inventory=0.0, # Current inventory gamma=0.5, # Risk aversion kappa=1.5, # Order arrival intensity t=1.0, # Time horizon)# Logit spread = gamma*sigma_b^2*T + (2/gamma)*ln(1 + gamma/kappa)# Then scaled to probability space via p(1-p)
Widen spread based on VPIN toxicity signal. Bridges the VPIN detector to spread adjustment.
Copy
adjusted = hz.toxicity_adjusted_spread( base_spread=0.04, # Base spread from model vpin=0.7, # VPIN value (0-1) sensitivity=1.0, # How aggressively to widen (0-10))# Formula: base_spread * (1 + sensitivity * vpin)
g = hz.logit_greeks( price=0.60, # Current price size=10.0, # Position size is_yes=True, # YES or NO side t_hours=24.0, # Hours to resolution belief_vol=0.2, # Belief volatility)print(f"Delta: {g.delta:.4f}") # Rate of change w.r.t. priceprint(f"Gamma: {g.gamma:.4f}") # Curvature (convexity)print(f"Theta: {g.theta:.4f}") # Time decayprint(f"Belief Vega: {g.belief_vega:.4f}") # Sensitivity to belief vol
Field
Formula
Interpretation
delta
sign * size * p(1-p)
Exposure to price moves, naturally scaled by sigmoid derivative
Taylor decomposition of realized PnL into component contributions.
Copy
attr = hz.logit_pnl_decompose( p_before=0.40, # Price at start p_after=0.60, # Price at end size=10.0, # Position size is_yes=True, # YES or NO side vol_before=0.20, # Belief vol at start vol_after=0.25, # Belief vol at end corr_before=0.0, # Correlation at start (optional) corr_after=0.0, # Correlation at end (optional))print(f"Directional: {attr.directional:.4f}")print(f"Curvature: {attr.curvature:.4f}")print(f"Vega PnL: {attr.belief_vega_pnl:.4f}")print(f"Corr PnL: {attr.correlation_vega_pnl:.4f}")print(f"Residual: {attr.residual:.4f}")# Components sum to actual PnL