Pricing
- rivapy.pricing.analytics.compute_european_price_Buehler(strike: float, maturity: float, volatility: float, is_call: bool = True) float[source]
Compute a call/put option price for the Buehler model (w.r.t. x-process), i.e. no dividends, rates etc. :param strike: strike :type strike: float :param maturity: maturity :type maturity: float :param volatility: volatility :type volatility: float :param is_call: if option is call or put :type is_call: bool
- Returns:
Black-Scholes call price
- Return type:
float
- rivapy.pricing.analytics.compute_implied_vol_Buehler(strike: float, maturity: float, price: float, min_vol=0.05, max_vol=2.0, is_call=True, **kwargs) float[source]
Computes the implied volatility for a given cal/putl price using brentq from scipy. It throws an exception if no implied vol can be determined.
- Parameters:
strike (float) – [description]
maturity (float) – [description]
price (float) – [description]
min_vol (float, optional) – [description]. Defaults to 0.05.
max_vol (float, optional) – [description]. Defaults to 2.0. is_call (bool): if option is call or put
- Returns:
[description]
- Return type:
float
- class rivapy.pricing.pricing_data.AmericanPdePricingData(val_date: datetime, spec, discount_curve, vol_surface, pricing_request: Iterable[ResultType], time_steps_year: int = 60, spot_steps: int = 200)[source]
Bases:
objectConstructor for AmericanPdePricingDate
- Parameters:
val_date ([datetime]) – Valuation date.
spec ([type]) – Specification
discount_curve ([type]) – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
time_steps_year (int, optional) – [description]. Defaults to 60.
spot_steps (int, optional) – [description]. Defaults to 200.
- class rivapy.pricing.pricing_data.AnalyticCapPricingData(val_date: datetime, spec, discount_curve, vol_surface, pricing_request: Iterable[ResultType])[source]
Bases:
objectConstructor for AnalyticCapPricingData
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Specification
discount_curve – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.AnalyticSwaptionPricingData(val_date: datetime, spec, discount_curve, vol_cube, pricing_request: Iterable[ResultType])[source]
Bases:
objectConstructor for AnalyticSwaptionPricingData
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Swaptions specification
discount_curve – Discount curve.
vol_cube – Volatility cube.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.BasePricingData(pricer: str, pricing_request: PricingRequest)[source]
Bases:
object- property pricer: str
Getter for configured pricer.
- Returns:
Configured pricer.
- Return type:
str
- property pricing_request
Getter for configured pricing request.
- Returns:
Configured pricing request.
- Return type:
PricingRequest
- class rivapy.pricing.pricing_data.Black76PricingData(val_date: datetime, spec, discount_curve, vol_surface, pricing_request: Iterable[ResultType])[source]
Bases:
objectConstructor for Black76PricingDate
- Parameters:
val_date ([datetime]) – Valuation date.
spec ([type]) – Specification.
discount_curve ([type]) – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.BondPricingData(bond: BondBaseSpecification, valuation_date: date | datetime, discount_curve: DiscountCurve, fixing_curve: DiscountCurve, parameters: BondPricingParameter, pricing_request: BondPricingRequest, pricer: str = 'BondPricer', past_fixing: float = None, survival_curve: SurvivalCurve = None, recovery_curve: BaseDatedCurve = None)[source]
Bases:
BasePricingData- property bond
- property discount_curve
- property fixing_curve
- property parameters
- property past_fixing
- property recovery_curve
- property survival_curve
- property valuation_date
- class rivapy.pricing.pricing_data.CDSPricingData(spec: CDSSpecification, val_date, discount_curve, survival_curve, recovery_curve=None, integration_step=relativedelta(days=+30))[source]
Bases:
object
- class rivapy.pricing.pricing_data.DepositPricingData(deposit: DepositSpecification, val_date: date | datetime, pricing_request: DepositPricingRequest, pricer: str, discount_curve: DiscountCurve, parameters: dict = None)[source]
Bases:
BasePricingDataConstructor for DepositPricingData
- Parameters:
deposit (DepositSpecification) – Instrument specific specification class object
valuation_date (_Union[date, datetime]) – valuatiton date
pricing_request (DepositPricingRequest) – Instrument specific Pricing Request class with the desired output/calculation prameters
pricer (str) – chosen pricing algorithm
discount_curve (DiscountCurve) – discount curve (i.e. (dates, discountFactors))
parameters (dict) – Extra parameters…
- class rivapy.pricing.pricing_data.ForwardRateAgreementPricingData(fra: ForwardRateAgreementSpecification, val_date: date | datetime, pricing_request: ForwardRateAgreementPricingRequest, pricer: str, discount_curve: DiscountCurve, forward_curve: DiscountCurve, parameters: dict = None)[source]
Bases:
BasePricingDataConstructor for ForwardrateAgreementPricingData
- Parameters:
fra (ForwardRateAgreementSpecification) – Instrument specific specification class object
valuation_date (_Union[date, datetime]) – valuatiton date
pricing_request (DepositPricingRequest) – Instrument specific Pricing Request class with the desired output/calculation prameters
pricer (str) – chosen pricing algorithm
discount_curve (DiscountCurve) – discount curve (i.e. (dates, discountFactors))
forward_curve (DiscountCurve) – Forward curve (i.e. (dates, forward rate)) #TODO do we implement a ForwardCruve class?
parameters (dict) – Extra parameters…
- class rivapy.pricing.pricing_data.InterestRateSwapFloatLegPricingData(spec, discount_curve, fx_rate: float, weight: float, fixing_curve=None)[source]
Bases:
objectConstructor for AnalyticCapPricingData
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Specification
discount_curve – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.InterestRateSwapFloatLegPricingData_rivapy(spec, discount_curve, forward_curve, fixing_map, fixing_grace_period: int, spread: float = None, fx_rate: float = 1.0, weight: float = None, fixing_curve: DiscountCurve = None)[source]
Bases:
InterestRateSwapLegPricingData_rivapyConstructor for
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Specification
discount_curve – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.InterestRateSwapLegPricingData(spec, discount_curve, fx_rate: float, weight: float)[source]
Bases:
objectConstructor for AnalyticCapPricingData
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Specification
discount_curve – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.InterestRateSwapLegPricingData_rivapy(spec, discount_curve: DiscountCurve, forward_curve: DiscountCurve, fixing_map, desired_rate=None, fx_rate: float = 1.0, weight: float = None)[source]
Bases:
objectConstructor for
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Specification
discount_curve – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.InterestRateSwapPricingData(val_date: datetime, spec, ccy, leg_pricing_data, pricing_request: Iterable[ResultType])[source]
Bases:
objectConstructor for AnalyticCapPricingData
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Specification
discount_curve – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.
- class rivapy.pricing.pricing_data.InterestRateSwapPricingData_rivapy(spec: InterestRateSwapSpecification, val_date: date | datetime, pricing_request: InterestRateSwapPricingRequest, pricer: str, ccy, leg_pricing_data)[source]
Bases:
BasePricingDataConstructor for
- Parameters:
val_date ([datetime]) – Valuation date.
spec – Specification
discount_curve – Discount curve.
vol_surface ([type]) – Volatility surface.
pricing_request (Iterable[ResultType]) – Pricing request. Can be selected from rivapy.pricing.ResultType.