Refinance by rate example

It’s common that in CLO transaction ,the equity holder has the option to reset the bond’s interest rate.

from absbox import Generic

test01 = Generic(
    "TEST01"
    ,{"cutoff":"2021-03-01","closing":"2021-06-15","firstPay":"2021-07-26"
     ,"payFreq":["DayOfMonth",20],"poolFreq":"MonthEnd","stated":"2030-01-01"}
    ,{'assets':[["Mortgage"
        ,{"originBalance":2200,"originRate":["fix",0.045],"originTerm":30
          ,"freq":"Monthly","type":"Level","originDate":"2021-02-01"}
          ,{"currentBalance":2200
          ,"currentRate":0.08
          ,"remainTerm":20
          ,"status":"current"}]]}
    ,(("acc01",{"balance":0}),)
    ,(("A1",{"balance":1000
             ,"rate":0.07
             ,"originBalance":1000
             ,"originRate":0.07
             ,"startDate":"2020-01-03"
             ,"rateType":{"Fixed":0.08}
             ,"bondType":{"Sequential":None}})
      ,("B",{"balance":1000
             ,"rate":0.0
             ,"originBalance":1000
             ,"originRate":0.07
             ,"startDate":"2020-01-03"
             ,"rateType":{"Fixed":0.00}
             ,"bondType":{"Equity":None}
             }))
    ,(("trusteeFee",{"type":{"fixFee":30},"feeStart":"2021-06-15"}),)
    ,{"amortizing":[
         ["payFee","acc01",['trusteeFee']]
         ,["accrueAndPayInt","acc01",["A1"]]
         ,["payPrin","acc01",["A1"]]
         ,["payPrin","acc01",["B"]]
         ,["payIntResidual","acc01","B"]
     ]}
    ,[["CollectedInterest","acc01"]
      ,["CollectedPrincipal","acc01"]
      ,["CollectedPrepayment","acc01"]
      ,["CollectedRecoveries","acc01"]]
    ,None
    ,None
    ,None
    ,None
    ,("PreClosing","Amortizing")
    )
from absbox import API,EnginePath

localAPI = API(EnginePath.DEV, lang='english', check=False)
Connecting engine server -> https://absbox.org/api/dev
/home/docs/checkouts/readthedocs.org/user_builds/absbox-doc/envs/stable/lib/python3.11/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
✅Connected, local lib:0.52.3, server:0.52.3

By using refinance ,user can set assumption to change the rate type of a bond in future .

User can setup different scenario to see how different refinancing options affecting equity returns.

runAssumption = [("refinance"
                  ,("byRate","2022-07-30","acc01", "A1", {"Fixed":0.05}))
                ]


r = localAPI.run(test01
                ,runAssump=runAssumption
                ,read=True)
/home/docs/checkouts/readthedocs.org/user_builds/absbox-doc/envs/stable/lib/python3.11/site-packages/urllib3/connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'absbox.org'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
r['bonds']['A1'].loc["2022-06-20":]
balance interest principal rate cash intDue intOverInt factor memo
date
2022-06-20 507.70 3.69 114.16 0.07 117.85 0 0 0.50770 [<PayInt:A1>, <PayPrin:A1>]
2022-07-20 392.76 2.92 114.94 0.07 117.86 0 0 0.39276 [<PayInt:A1>, <PayPrin:A1>]
2022-08-20 276.78 1.87 115.98 0.05 117.85 0 0 0.27678 [<PayInt:A1>, <PayPrin:A1>]
2022-09-20 160.10 1.17 116.68 0.05 117.85 0 0 0.16010 [<PayInt:A1>, <PayPrin:A1>]
2022-10-20 42.89 0.65 117.21 0.05 117.86 0 0 0.04289 [<PayInt:A1>, <PayPrin:A1>]
2022-11-20 0.00 0.18 42.89 0.05 43.07 0 0 0.00000 [<PayInt:A1>, <PayPrin:A1>]
10/365*391.76*0.07
0.7513205479452054
21/365*391.76*0.05+0.75
1.8769808219178081