Skip to content
All library documents

Equity and Index Swap Support in Quantitative Libraries

Article Quant Q&A · Author: Fabio Nassar

Summary

The document addresses whether a general-purpose quantitative finance library can value swaps whose cash flows depend on equity or index performance. Its answer is that the core library does not provide the needed instruments directly. For users working in C++, it points to a separate open-source extension that supplies equity indexes, indexed payment legs, and equity swaps. A Python interface is also mentioned, with a caution that its upkeep is limited.

The practical lesson is to distinguish capabilities in a core toolkit from those available through companion extensions. The response is a brief pointer rather than a valuation guide: it gives no implementation steps, pricing formulas, examples, or performance evidence. It also does not discuss model assumptions, market data, contract conventions, or validation, so researchers would need to investigate those before relying on such a setup.

Key ideas

  • The core quantitative library described does not directly support equity-linked swap valuation.
  • A separate C++ extension is identified as providing equity indexes, indexed legs, and equity swaps.
  • A Python binding is available, though its maintenance is described as weak.
  • The response offers pointers to software components rather than pricing methods or validation evidence.

Tags

Full text
# Does quantlib support Equity/Index Swap valuations?


# Does quantlib support Equity/Index Swap valuations?












Is there a way to create a Leg in quantlib in which the notional and reset amounts are calculated by how an index/equity performs?

## Answer by lampishthing (score 0, accepted)

https://quant.stackexchange.com/a/70606

QuantLib does not, but if you're using C++ then you can check out the "open source risk engine", which adds an equity index class, equity indexed legs, and equity swaps:

https://github.com/OpenSourceRisk/Engine/blob/master/OREData/ored/portfolio/equityswap.cpp

https://github.com/OpenSourceRisk/Engine/blob/master/QuantExt/qle/indexes/equityindex.cpp

If you're using Python there is SWIG wrapper available too, but it's not maintained so well:

https://github.com/OpenSourceRisk/ORE-SWIG/tree/master/QuantExt-SWIG/Python

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.