Put-Call Parity¶
quantflow.options.parity.PutCallParity
pydantic-model
¶
Bases: BaseModel
A matched put-call parity at a single strike, used for discount curve calibration.
Fields:
quantflow.options.parity.PutCallParities
pydantic-model
¶
Bases: BaseModel
A collection of put-call parities for a given maturity
Fields:
-
parities(list[PutCallParity]) -
spot(Decimal) -
ttm(Decimal) -
inverse(bool)
from_parities
classmethod
¶
Source code in quantflow/options/parity.py
regressand
¶
Calculate the regressand for put-call parity regression.
For direct options, the regressand is (C - P) / S, while for inverse options it is simply c - p.
Source code in quantflow/options/parity.py
regressor
¶
Calculate the regressor for put-call parity regression, which is the strike price divided by the spot price.
fit_discounts
¶
Return the fitted discount factors, or None if the result is invalid.
Both direct and inverse options satisfy the same normalized equation y = Da - (Dq/S) * K, where y = mid/S for direct and y = mid for inverse.
When both known values are None a full OLS is run via constrained least squares. When one is provided the other is solved analytically as the mean over pairs. Discount factors are bounded by D <= exp(-min_rate * ttm), so min_rate=0 enforces D <= 1 (non-negative rates).
Source code in quantflow/options/parity.py
plot
¶
Plot the normalized put-call parity data and the fitted regression line.