OIPD computes the market's expectations about the probable future prices of an asset, based on information contained in options data.
While markets don't predict the future with certainty, under the efficient market hypothesis, these collective expectations represent the best available estimate of what might happen.
Traditionally, extracting these “risk-neutral densities” required institutional knowledge and resources, limited to specialist quant-desks. OIPD makes this capability accessible to everyone — delivering an institutional-grade tool in a simple, production-ready Python package.
pip install oipd
from oipd import RND, MarketInputs
from datetime import date
# 1 ─ point to a ticker and provide market info
market = MarketInputs(
valuation_date=date.today(), # the "as-of" date for the analysis
expiry_date=date(2025, 12, 19), # option expiry date you care about
risk_free_rate=0.04, # annualized risk-free rate
)
# 2 - run estimator, auto fetching data from Yahoo Finance
est = RND.from_ticker("AAPL", market)
# 3 ─ access results and plots
est.prob_at_or_above(120) # P(price >= $120)
est.prob_below(100) # P(price < $100)
est.plot() # plot probability and cumulative distribution functions
OIPD also supports manual CSV or DataFrame uploads.
See TECHNICAL_README.md
for more details, and the academic theory behind the technique.
See more examples with provided options data.
Event-driven strategies: assess market's belief about the likelihood of mergers
- Nippon Steel offered to acquire US Steel for $55 per share; in early 2025, US Steel was trading at $30 per share. Using OIPD, you find that the market believed US Steel had a ~20% probability of acquisition (price >= $55 by end of year)
- If you believe that political backlash was overstated and the acquisition was likely to be approved, then you can quantify a trade's expected payoff. Compare your subjective belief with the market-priced probability to determine expected value of buying stock or calls
Risk management: compute forward-looking Value-at-Risk
- A 99% 12-month VaR of 3% is (i) backward-looking and (ii) assumes a parametric distribution, often unrealistic assumptions especially before catalysts
- Ahead of earnings season, pull option-implied distributions for holdings. The forward-looking, non-parametric distribution point to a 6% portfolio-blended VaR
Treasury management: decide the next commodity hedge tranche
- As an airline, a portion of next year’s jet fuel demand is hedged; the rest floats. Use OIPD to estimate the probability of breaching your budget and the expected overspend (earnings-at-risk) on the unhedged slice
- If OIPD shows higher price risk, add a small 5–10% hedged tranche using to pull P(breach)/EaR back within board guardrails
Pull requests welcome! Reach out on GitHub issues to discuss design choices.
Join the Discord community to share ideas, discuss strategies, and get support. Message me with your feature requests, and let me know how you use this.
Convenience features:
- integrate other data vendors (Alpaca, Deribit) for automatic stock and crypto options data fetching
Algorithmic improvements:
- implement no-arbitrage checks
- fit IV smile using SABR model
- infer forward price using a band of near-ATM option-pairs, rather than the one nearest pair
- American-option de-Americanisation module
- full term-structure surface (
RNDTermSurface
) - Research in conversion from risk-neutral to physical probabilities
The list describes potential features and research directions; it is neither exhaustive nor a prescribed implementation schedule.