Skip to content
All library documents

QuantLib Curve Interpolation and IRS Valuation During a Swap’s Life

Article Quant Q&A · Author: Antek

Summary

The document raises implementation questions about valuing an interest rate swap in QuantLib. It asks how a piecewise log-cubic discount curve uses dates and rates supplied through rate helpers, including whether the curve interpolates between those inputs. It also asks how to value a swap partway through its life when a current forward curve and historical overnight rates are available.

The post seeks clarification on whether the curve must be built at the swap’s original start date and relinked, or whether the valuation can use the current market curve directly. It contains no answer, code, valuation results, or instrument conventions, so it serves as a set of practical questions rather than a complete QuantLib method. Curve reference dates, interpolation choices, fixing histories, and schedule details would need to be specified to resolve the setup.

Key ideas

  • The post asks how QuantLib interpolates between curve inputs built from rate helpers.
  • It discusses a piecewise log-cubic discount curve for swap valuation.
  • Valuing an in-progress swap requires handling the current forward curve and historical overnight fixings.
  • The document poses implementation questions but supplies no solution or tested example.

Tags

Full text
# QuantLib: IRS valuation


# QuantLib: IRS valuation












I tried to value a simple IRS in QuantLib and failed. I have few questions, which will probably help to resolve these issues. Would be super grateful for answers in these matters.

- When I set up a valuation curve, e.g. valCurve = ql.RelinkableYieldTermStructure(SofrCurve). Sofr curve is built with PieacewiseLogCubicDiscount. But what about SofrCurve dates and rates? If I provided helpers for some days, does QuantLib interpolate between them? If no, how to do that?

- I have a forward curve at the time during swap life and historical ON rates. Normally, you can value the swap. However, in QuantLib it seems that I need to build a curve at the start of the swap and the relink new curve? Is that true, is there a way to avoid this?

Thank you!

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.