I'm trying to figure out how to build a discount curve to price bonds from spot rates using some advance interpolation methods like PiecewiseLogCubicDiscount. I know I can build this curve with BondHelpers if I have par bond yield, but what if I only have spot rates? The only example I've seen so far has liner interpolation on rates.


1 Answer 1


If you have the spot rates, you don't need helpers and you can build the curve directly with spot rates and dates. You have several interpolation possibilities that have the same required inputs: dates, yields, dayCounter. There are other optional parameters that have defaults.

Here are some example of the classes, where the names are hopefully self explanatory:

import QuantLib as ql
dates = [ql.Date(31,12,2019),  ql.Date(31,12,2020),  ql.Date(31,12,2021)]
zeros = [0.01, 0.02, 0.03]

ql.ZeroCurve(dates, zeros, ql.ActualActual())
ql.LogLinearZeroCurve(dates, zeros, ql.ActualActual())
ql.CubicZeroCurve(dates, zeros, ql.ActualActual())
ql.NaturalCubicZeroCurve(dates, zeros, ql.ActualActual())
ql.LogCubicZeroCurve(dates, zeros, ql.ActualActual())
ql.MonotonicCubicZeroCurve(dates, zeros, ql.ActualActual())
  • $\begingroup$ Yes, that is correct $\endgroup$ Commented Sep 18, 2020 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.