Tuesday, May 9

PYBOR - multi-curve interest rate framework in Python

I have been recently working on a project PYBOR, a multi-curve interest rate framework and risk engine based on multivariate optimization techniques, written in Python (hence the name twist of a libor rate).

Linear interpolation of the logarithm of discount factors (aka piecewise-constant in forward-rate space)

Linear interpolation of the continuously-compounded zero-rates

Cubic interpolation of the logarithm of discount factors

Curve naming conventions

For the purpose of this project, the curves are named in the following way:

USD.LIBOR3M refers to USD BBA LIBOR reference rate with 3 month tenor

GBP.SONIA refers to overnight GBP SONIA compound reference rate

USD.OIS refers to overnight USD Federals Fund compound reference rate

In a mono-currency context, the reference rates above can be used also for discounting (e.g. USD.OIS curve used for discounting of collateralised USD trades and USD.LIBOR.3M curve for discounting of unsecured USD trades).

In a cross-currency context, the naming convention for discounting curves is as follows:

<CurrencyOfCashFlow>/<RatePaidOnCollateral>

Few examples:

USD/USD.OIS Discounting curve for USD cash-flows of a trade which is collateralised in USD, paying collateral rate linked to USD.OIS. Names USD/USD.OIS and USD.OIS refers to the same curve.

GBP/GBP.SONIA Discounting curve for GBP cash-flows of a trade which is collateralised in GBP, paying collateral rate linked to GBP.SONIA. Names GBP/GBP.SONIA and GBP.SONIA refers to the same curve.

GBP/USD.OIS Cross-currency discounting curve for GBP cash-flows of a trade which is collateralised in USD, paying collateral rate linked to USD.OIS.

TODO

Solve stages for global optimizer (performance gain)

Proper market conventions (day count and calendar roll conventions)

Smoothing penalty functions

Risk transformation between different instrument ladders

Split-curve interpolators (different interpolation method for short-end and long-end of the curve)