This framework in L1 as shown in Figure 1 that is a trinomial tree based lattice, where the Rate Model supports multiple models including Vasicek, Hull-White, Black-Karasinski, CoxIngersollRoss, Extended-CoxIngersollRoss, Two-additive-factor gaussian, also instruments including swaption, swap, capfloor, callablebond. The process is shown as follows:
- The Setup module of the framework is based on the structure of the tree and Interest Rate Model, and the floating interest rates and tree related parameters are calculated from \(0\) to \(N\) point-by-point to prepare the interest rates and the tree related parameters for the following calculations. To save the on-chip RAM resources, we simply store intermediate results (e.g. \(probs\), \(index\), \(size\), and so on) of single time-point instead all of them from each time points, because they can be directly calculated using the adjacent ones.
- The Rollback module uses the same structure of the tree and discount functions from the Rate Model to obtain the values of each tree node at the opposite direction. When the time point is 0, the NPV is achieved. The implementation is shown in Figure 2, where the data flows along with the arrows.