Using Separate Forward and Discount Curves in QuantLib Cap Pricing
Summary
The document explains how to represent dual-curve pricing for caps and caplets in QuantLib Python. The curve handle supplied to the pricing engine is used to discount cash flows, while the curve associated with the Ibor index supplies forward rates. Assigning distinct term structures to those two components allows the setup to use a projection curve for rate estimation and a discount curve for present values.
It also states that QuantLib exposes a Bachelier cap-floor pricing engine through its Python interface, alongside the Black engine. The discussion answers a software usage question rather than presenting a pricing comparison or market study. Its examples refer to older QuantLib versions, so class availability and interface details may vary across releases; users should check the documentation for the version they run. The core modeling distinction remains that forwarding and discounting roles are assigned through separate objects.
Key ideas
- The pricing engine's yield curve handle supplies the discount curve.
- The Ibor index's term structure supplies the forward estimation curve.
- Different curves can be assigned to projection and discounting in a dual-curve setup.
- QuantLib Python includes a Bachelier cap-floor pricing engine as well as a Black engine.
- The examples reference older versions, so interface details may differ in newer releases.
Tags
Full text
# QuantLib Python: caplet/swaption pricing under dual curve # QuantLib Python: caplet/swaption pricing under dual curve Is there a way to price caplets/swaptions in QuantLib python (v 1.6.2) under dual curve i.e. pass projection curve for forwards and discounting curve for discounting the cash flows? Goutham has an example here but it uses single curve for both forwards and discount. I looked at BlackCapFloorEngine.hpp and could not find function which takes two curves as input. Secondly, is the Bachelier model exposed to python? Because I could not find it. ## Answer by byouness (score 5, accepted) https://quant.stackexchange.com/a/50174 #### Discount vs forward estimation curve The `YieldTermStructureHandle` passed to `BlackCapFloorEngine` corresponds to the discount curve, while the one passed to `IborIndex` corresponds to the forward estimation curve In the example you are referring two, it turns out both are identical, but you could very well define two different handles on two different curves, as follows: ``` disc_term_structure = ql.ZeroCurve(disc_dates, disc_zero_rates, ...) disc_ts_handle = ql.YieldTermStructureHandle(disc_term_structure) engine = ql.BlackCapFloorEngine(disc_ts_handle, vols) ``` #### Bachelier pricing engine As for your second question, there is a `BachelierCapFloorEngine` class in QuantLib, see here: https://github.com/lballabio/QuantLib/blob/master/ql/pricingengines/capfloor/bacheliercapfloorengine.hpp and it is exposed in Python (I am using QuantLib 1.16). You could for example, replace the Black engine instanciation with this line in Goutham's example: ``` engine = ql.BachelierCapFloorEngine(disc_ts_handle, ql.QuoteHandle(ql.SimpleQuote(0.03)) ```
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.