Products and Pricing
Code Layers
The Vector Risk pricing functions are split into two layers which we call "product" and "pricing".
The outer level "product" code is responsible for collecting trade details and rates, and sometimes generating cashflows from trade details. This level of the code also works with the risk engine to ensure path sensitive trades are able to track variables (such as barriers or averages) through a trade aging credit simulation.
The inner layer "pricing" code is simply the valuation formula, which is given the value date and all the trade details and rates that it needs to price a trade. The function headers and code in this layer resembles what you would see in a book or academic paper, with the subtle difference that the Vector Risk code is vectorised for performance (allowing a pricing function to process thousands of rate sets in a single call to the function). This inner layer is further organised to ensure re-use of common financial algorithms across the library.
Proprietary Pricing
A customer may have a need to supply a proprietary pricing algorithm. This action is supported by Vector Risk. A product level function is used to "wrap" the customer's pricing algorithm and it is housed in a "private" library that other customers cannot see or access. The customer code can be supplied in compiled format for extra security and does not need to be vectorised as the wrapper code can call the pricing function separately for each scenario being priced.