Skip to main content
MarketInputs is the frozen dataclass you pass to every OIPD fitting method. It captures the risk-free rate, valuation date, and optional market data such as the underlying price. When you fetch an option chain with sources.fetch_chain, the returned VendorSnapshot carries the vendor’s price data and download timestamp — you can use it to populate MarketInputs with minimal boilerplate.
from oipd import MarketInputs

MarketInputs

MarketInputs is a frozen dataclass. All fields are set at construction and cannot be modified afterward. The valuation_date field is normalized to a pd.Timestamp with intraday precision when the object is created.
from oipd import MarketInputs

market = MarketInputs(
    risk_free_rate=0.053,
    valuation_date="2025-04-01",
    underlying_price=512.40,
)

Fields

risk_free_rate
float
required
The risk-free interest rate used for option pricing and forward price calculation. Interpretation depends on risk_free_rate_mode. For "annualized" mode, provide the simple annualized nominal rate (e.g., 0.053 for 5.3%). For "continuous" mode, provide the continuously compounded rate.
valuation_date
DateTimeLike
required
The pricing date. Accepts str (ISO format, e.g., "2025-04-01"), Python date, Python datetime, or pd.Timestamp. The value is normalized to a timezone-naive pd.Timestamp on construction.
risk_free_rate_mode
Literal['annualized', 'continuous']
default:"\"annualized\""
Specifies how risk_free_rate is quoted. "annualized" treats the rate as a simple annualized nominal rate on an ACT/365 basis. "continuous" treats it as a continuously compounded rate.
underlying_price
float | None
default:"None"
Current price of the instrument the options are written on. For equity or ETF spot options (Black-Scholes), this is the cash spot price S. For options on futures (Black-76), this is the current futures price F of the relevant contract. Required when calling VolCurve.fit, VolSurface.fit, or any probability method.
By default, you do not need to enter dividends. OIPD infers the forward price from put-call parity and uses Black-76 for IV inversion. The fitted forward already reflects the market’s expected carry, including dividends.

VendorSnapshot

VendorSnapshot is a frozen dataclass returned by sources.fetch_chain. It records the point-in-time market data retrieved from the vendor, including the underlying price and the time of download.
from oipd import VendorSnapshot

Fields

asof
datetime
required
Timestamp of when the data was downloaded from the vendor.
vendor
str
required
Vendor name string. For the default integration, this is "yfinance".
underlying_price
float | None
default:"None"
Underlying asset price reported by the vendor at the time of download.

Examples

Manual

Use MarketInputs directly when you have your own market data.
from oipd import MarketInputs

market = MarketInputs(
    risk_free_rate=0.053,
    valuation_date="2025-04-01",
    underlying_price=512.40,
)

Vendor snapshot

When you use sources.fetch_chain, the returned VendorSnapshot provides the data you need to build MarketInputs with one step.
from oipd import MarketInputs, sources

chain, snapshot = sources.fetch_chain("SPY", horizon="3m")

market = MarketInputs(
    risk_free_rate=0.053,
    valuation_date=snapshot.asof,            # datetime from vendor
    underlying_price=snapshot.underlying_price,
)

Rate convention

from oipd import MarketInputs

market = MarketInputs(
    risk_free_rate=0.0516,
    valuation_date="2025-04-01",
    risk_free_rate_mode="continuous",
    underlying_price=512.40,
)
MarketInputs is frozen. Once created, none of its fields can be modified. To change any parameter, create a new instance.