What is this? Options prices on stocks, crypto, and commodities contain information about the market’s probability distribution for future prices. Breeden-Litzenberger (1978) showed you can extract this “risk-neutral density” by taking the second derivative of call prices with respect to strike. Horizon uses this to compare options-implied probabilities against prediction market prices - when they disagree, that’s an edge signal.
Horizon implements the Breeden-Litzenberger theorem to extract risk-neutral probability densities from options chains, then maps these to prediction market edge signals. All computation runs in Rust.
Density Extraction
risk_neutral_density() - extract the full probability distribution from options prices via finite differences.
Probability Queries
implied_probability_above(), below(), between() - integrate the density over arbitrary ranges.
Edge Detection
cross_asset_edge() - compare options-implied probability against prediction market price.
Risk Premium
risk_premium_adjustment() - blend options and market probabilities to account for risk premium differences.
Extract the full risk-neutral probability density from an options chain.
Copy
import horizon as hz# Example: BTC options chain (calls)strikes = [80000, 85000, 90000, 95000, 100000, 105000, 110000, 115000, 120000]call_prices = [22000, 17500, 13500, 10000, 7200, 4800, 3000, 1700, 900]rnd = hz.risk_neutral_density( strikes=[float(k) for k in strikes], call_prices=[float(c) for c in call_prices], r=0.05, # Risk-free rate t=0.25, # Time to expiry (in years))print(f"Mean: ${rnd.mean:,.0f}")print(f"Variance: {rnd.variance:,.0f}")print(f"Density points: {len(rnd.densities)}")print(f"CDF at last strike: {rnd.cdf[-1]:.4f}") # Should be ~1.0
Options prices contain a risk premium that prediction markets don’t. This function blends the two probability estimates using a historical calibration ratio.