Constructing Pricing Objects#

Curves#

Rateslib has two fundamental curve classes:

rateslib.curves.Curve(*args, **kwargs)

A _BaseCurve with DF parametrisation at given node dates with interpolation.

rateslib.curves.LineCurve(*args, **kwargs)

A _BaseCurve with value parametrisation at given node dates with interpolation.

There are also additional, more complex objects, which serve as containers which composite multiple objects.

rateslib.curves.CompositeCurve(curves[, id, ...])

A dynamic composition of a sequence of other _BaseCurve.

rateslib.curves.ProxyCurve(cashflow, ...[, id])

A _BaseCurve which returns dynamic DFs from an FXForwards object and FX parity.

rateslib.curves.MultiCsaCurve(curves[, id])

A dynamic composition of a sequence of other _BaseCurve.

rateslib.curves.CreditImpliedCurve([...])

Imply a _BaseCurve from credit components.

And there are other containers which facilitate different types of curve operations.

rateslib.curves.RolledCurve(curve, roll_days)

Create a new _BaseCurve type by translating the rate space of an input curve horizontally in time.

rateslib.curves.ShiftedCurve(curve, shift[, id])

Create a new _BaseCurve type by compositing an input with another flat curve of a set number of basis points.

rateslib.curves.TranslatedCurve(curve, start)

Create a new _BaseCurve type by maintaining the rate space of an input curve but shifting the initial node date forwards in time.

It is also possible for a user to construct custom curve classes and interact them with all of the established tools, in particular for pricing instruments and obtaining risk sensitivities. For an example of this see the cookbook article on Building Custom Curves (Nelosn-Siegel).

Curves are required for pricing all Instruments in rateslib.

Smiles & Surfaces#

For FX volatility pricing rateslib has two fundamental models:

rateslib.fx_volatility.FXDeltaVolSmile(...)

Create an FX Volatility Smile at a given expiry indexed by delta percent.

rateslib.fx_volatility.FXSabrSmile(nodes, ...)

Create an FX Volatility Smile at a given expiry indexed by strike using SABR parameters.

These cross-sectional elements are combined into a generalist surface which interpolates volatility in the objects:

rateslib.fx_volatility.FXDeltaVolSurface(...)

Create an FX Volatility Surface parametrised by cross-sectional Smiles at different expiries.

rateslib.fx_volatility.FXSabrSurface(...[, ...])

Create an FX Volatility Surface parametrised by cross-sectional Smiles at different expiries.

Solver#

In rateslib defining pricing objects and then solving them with calibrating instruments are two separate processes. This provides maximal flexibility whilst providing a process that is fully generalised and consistent throughout.

Note

Rateslib uses a global optimizer and weighted least squares object function to calibrate pricing objects.

Rateslib does not bootstrap. Bootstrapping is an analytical process that determines pricing object parameters sequentially and exactly by solving a series of equations for a well defined set of parameters and instruments.

Any bootstrapped object can be solved, also, by a global optimization process. Many global optimization solutions cannot be determined by a bootstrap process.

The following pages give further details to these summaries and code examples.