I have newly started with Quantlib-Python for valuing derivatives. In all the examples stated in this bolg or in other places, market quote is inserted and bootstrapping is done via individual rate helpers to create the zero curve.

Is there a way I can directly insert the zero rates in Quantlib so that it can interpolate from the zero rates and give the final NPV.


1 Answer 1


If you already have the zero rates, you can construct the zero curve using the set of maturities (dates) and zero rates values, in addition to a day count convention in this way:

import QuantLib as ql
ql.Settings.instance().evaluationDate = ql.Date(26, 7, 2018)
dates = [ql.Date(26, 7, 2019), ql.Date(26, 7, 2020), ql.Date(26, 7, 2030)]
zero_rates = [0.03, 0.04, 0.06]
zero_curve = ql.ZeroCurve(dates, zero_rates, ql.Actual365Fixed())

I don't understand what NPV you are looking for though? The NPV will be related to an instrument, not to a zero curve.

  • 1
    $\begingroup$ I meant valuation, not looking for NPV, it was a mistake, thanks $\endgroup$
    – amitbisai
    Commented Jul 27, 2018 at 11:17
  • 1
    $\begingroup$ Welcome. Glad I was able to help! $\endgroup$
    – byouness
    Commented Jul 27, 2018 at 12:11

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.