The UnRisk Financial Language (UFL) is a domain specific language giving the user the possibility to describe objects in the world of quantitative finance. As it is oriented on the terms and concepts quants and risk managers see in their daily work UFL is a high level interface. 

UFL provides classes for a large number of different objects:

  • Instruments and instrument groups
  • Portfolios
  • Financial models
  • Market data
  • Calculation control
  • Calculation results 

It is written in C++ and makes heavy use of template classes allowing the users to realise orthogonal concepts in free combination. The key benefits for the users are:

  • Consistent interfaces (for example across asset classes)
  • Large scope of operation by combining simple to understand building bricks 


As an example we show the template class hierachy for financial instruments. Additionally to the  basis instruments like InterestRateInstrument, FXInstrument, Equity and Commodity the hirachy Derivative<Tunderlying> allows the description of derivatives on the basis instruments as well as on derivative instruments. 

For example the user can describe a single barrier option on an equity (SingleBarrierOption<Equity>), on a commodity (SingleBarrierOption<Commodity>) or on a commodity future (SingleBarrierOption<Future<Commodity>>) in a consistent scheme and notation. The interface of the resulting class is build from the interface template of the SingleBarrierOption and the class interface of the underlying (for example Commodity).