Internal Design of Inflation CapFloor Engine¶
Overview¶
Inflation option can be cap and floor. An inflation cap (floor) is a financial asset that offers protection against inflation being higher (lower) than a given rate of inflation, and can therefore be used by investors to insure against such inflation outcomes.
Implemention¶
the YoYInflationBlackCapFloorEngine is year-on-year inflation cap/floor engine based on black formula. The structure of the engine is shown as the figure below:
As we can see from the figure, the engine mainly contains 4 functions.
- function discountFactor: the discount factor is calculated at the corresponding time point.
- function totalVariance: the total variance of volatility is calculated at the corresponding time point.
- function yoyRateImpl: the year-on-year forward rate is calculated at the corresponding time point.
- function blackFormula: the black formula calculates the value of the option based on the results of the three functions mentioned above.
Finally, the addition of the results from each time point is the final price (NPV).