The attachment contains a toy RFR (e.g. SOFR, ESTR) )curve calibrator and a Libor-type pricer.
It is called a toy because the day count convention and effective/settlement date are not accurately considered. Also, the fine structure of the front end of the RFR curve (short tenors) is not handled. To handle front-end fine structure, short maturity instruments should be used as calibration instruments for example FRA (forward rate agreements). In this toy example, only par swap rates are used.
A key part of an interest rate calibrator is an optimizer or a solver (bootstrapping case only). In this toy example, Excel Solver is used. This is a widely available tool as long as you have Excel. See the Microsoft help page for how to turn on Solver: Load the Solver Add-in in Excel.
Note 1: The calibrator part is set up for a swap whose floating leg pay frequency is annual only, e.g., ESTR and SOFR, because the cashflows are evaluated out of 1-year forward rate. If you were to strip a Libor curve, you have to make the tenors granular enough to cover every payment (every quarter in the Libor case) and add more interpolation pillars.

Note 2: The RFR rate is compounded daily. The actual interest rate paid is a backward-looking backward rate. But it is still reasonable to use a forward rate to evaluate cashflows because any compounding format describes borrowing money for a certain period. The key variable that drives the whole curve is the discount factor, which could be equivalently expressed as forward rate, zero rate, etc.

![Rendered by QuickLaTeX.com \[\small \begin{aligned} PV_{\mbox{payer}} =& \mathbb{E}_0^{\mathbb{Q}}\left[\left(V_{\mbox{float}}(\hat{T})-V_{\mbox{fixed}}(\hat{T})\right)^+P(0,\hat{T})\right] \\ =& \mathbb{E}_0^{\mathbb{Q}}\left[ \left(S_{\hat{T}}(\hat{T},\hat{T}+\Delta)A(\hat{T})-KA(\hat{T})\right)^+P(0,\hat{T})\right] \\ = & A(0) \mathbb{E}^{A}_{0} \left[\left(S_{\hat{T}}(\hat{T},\hat{T}+\Delta) - K\right)^+\right] \end{aligned}\]](https://sisitang0.com/wp-content/ql-cache/quicklatex.com-46b8968ad668b901d385cf47984bfdcb_l3.png)
![Rendered by QuickLaTeX.com \[\small \begin{aligned} & \mathbb{E}^{A}_{0} \left[\left(S_{\hat{T}} - K\right)^+\right] \\ = & \int_{K}^{+\infty} (x-K) \frac{1}{\sigma \sqrt{2\pi\hat{T}}} e^{-\frac{(x-S_0)^2}{2\sigma^2\hat{T}}} \textrm{d} x \\ = & \sigma \sqrt{\hat{T}} \cdot \varphi (d_1) + (S_0 - K) \cdot \Phi(d_1) \end{aligned} ,\]](https://sisitang0.com/wp-content/ql-cache/quicklatex.com-eb1476fe039617fd4d4d8a91e72ba15f_l3.png)

![Rendered by QuickLaTeX.com \[\begin{aligned}f(t,T)&=\lim_{\delta\rightarrow 0}\frac{1}{\delta}\left(\frac{P(t,T)}{P(t,T+\delta)}-1\right) \\ & = -\frac{\partial \log P(t,T)}{\partial T}\end{aligned}.\]](https://sisitang0.com/wp-content/ql-cache/quicklatex.com-b5a0732f224c579d77f26db98449ca36_l3.png)
![Rendered by QuickLaTeX.com \[A_n(t) = \sum_{k=n+1}^{N+1} \alpha_{k-1}P(t,T_k).\]](https://sisitang0.com/wp-content/ql-cache/quicklatex.com-b2ec3de0caee6a648cf582e5f4fa3a7f_l3.png)
![Rendered by QuickLaTeX.com \[\begin{aligned}& PV_{\mbox{float}} \\ = & \sum_{k=n}^N L_k(t)\alpha_k P(t,T_{k+1}) \\ =& \sum_{k=n}^N \frac{1}{\alpha_k}\left(\frac{P(t,T_k)}{P(t,T_{k+1})}-1\right) \alpha_k P(t,T_{k+1}) \\ =& \sum_{k=n}^N \left(P(t,T_k) - P(t,T_{k+1})\right) \\ =& P(t,T_n) - P(t,T_{N+1}) \end{aligned}\]](https://sisitang0.com/wp-content/ql-cache/quicklatex.com-faa76195580877c1bc9e022c4ab6f116_l3.png)