Transfer Multiple Account Example
import pandas as pd
pd.set_option('display.max_rows', None)
from absbox import Generic,API,EnginePath,readAccsCf
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})
,("acc02",None)
,("acc03",None)
,("acc04",None))
,(("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":[
["transferM",['acc02','acc03','acc04'],'acc01']
,["payFee","acc01",['trusteeFee']]
,["accrueAndPayInt","acc01",["A1"]]
,["payPrin","acc01",["A1"]]
,["payPrin","acc01",["B"]]
,["payIntResidual","acc01","B"]
]}
,[["CollectedInterest","acc01"]
,["CollectedPrincipal","acc02"]
,["CollectedPrepayment","acc03"]
,["CollectedRecoveries","acc04"]]
,None
,None
,None
,None
,("PreClosing","Amortizing")
)
localAPI = API(EnginePath.DEV, lang="english",check=False)
r = localAPI.run(test01
,poolAssump = ("Pool",("Mortgage",{"CDR":0.01},{"CPR":0.02},{"Lag":3,"Rate":0.4},None)
,None
,None)
,read=True)
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
/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(
withLimitTransfer = ['transferM', [('acc02',{"formula":("const",100)}), ('acc03',{"formula":("const",2)}), ('acc04',None)], 'acc01']
test01.waterfall['amortizing'][0] = withLimitTransfer
r = localAPI.run(test01
,poolAssump = ("Pool",("Mortgage",{"CDR":0.01},{"CPR":0.02},{"Lag":3,"Rate":0.4},None)
,None
,None)
,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['accounts']['acc01'].loc["2022-01-31":"2022-10-31"]
| balance | change | memo | |
|---|---|---|---|
| date | |||
| 2022-01-31 | 14.62 | 14.62 | <Pool:CollectedInterest> |
| 2022-02-20 | 114.62 | 100.00 | <Transfer:acc02,acc01> |
| 2022-02-20 | 116.62 | 2.00 | <Transfer:acc03,acc01> |
| 2022-02-20 | 116.62 | 0.00 | <Transfer:acc04,acc01> |
| 2022-02-20 | 86.62 | -30.00 | <SeqPayFee:trusteeFee> |
| 2022-02-20 | 37.75 | -48.87 | <PayInt:A1> |
| 2022-02-20 | 0.00 | -37.75 | <PayPrin:A1> |
| 2022-02-28 | 13.90 | 13.90 | <Pool:CollectedInterest> |
| 2022-03-20 | 113.90 | 100.00 | <Transfer:acc02,acc01> |
| 2022-03-20 | 115.90 | 2.00 | <Transfer:acc03,acc01> |
| 2022-03-20 | 115.90 | 0.00 | <Transfer:acc04,acc01> |
| 2022-03-20 | 110.74 | -5.16 | <PayInt:A1> |
| 2022-03-20 | 0.00 | -110.74 | <PayPrin:A1> |
| 2022-03-31 | 13.18 | 13.18 | <Pool:CollectedInterest> |
| 2022-04-20 | 113.18 | 100.00 | <Transfer:acc02,acc01> |
| 2022-04-20 | 115.18 | 2.00 | <Transfer:acc03,acc01> |
| 2022-04-20 | 115.18 | 0.00 | <Transfer:acc04,acc01> |
| 2022-04-20 | 110.12 | -5.06 | <PayInt:A1> |
| 2022-04-20 | 0.00 | -110.12 | <PayPrin:A1> |
| 2022-04-30 | 12.46 | 12.46 | <Pool:CollectedInterest> |
| 2022-05-20 | 112.46 | 100.00 | <Transfer:acc02,acc01> |
| 2022-05-20 | 114.46 | 2.00 | <Transfer:acc03,acc01> |
| 2022-05-20 | 115.20 | 0.74 | <Transfer:acc04,acc01> |
| 2022-05-20 | 110.94 | -4.26 | <PayInt:A1> |
| 2022-05-20 | 0.00 | -110.94 | <PayPrin:A1> |
| 2022-05-31 | 11.73 | 11.73 | <Pool:CollectedInterest> |
| 2022-06-20 | 111.73 | 100.00 | <Transfer:acc02,acc01> |
| 2022-06-20 | 113.73 | 2.00 | <Transfer:acc03,acc01> |
| 2022-06-20 | 114.44 | 0.71 | <Transfer:acc04,acc01> |
| 2022-06-20 | 110.70 | -3.74 | <PayInt:A1> |
| 2022-06-20 | 0.00 | -110.70 | <PayPrin:A1> |
| 2022-06-30 | 11.01 | 11.01 | <Pool:CollectedInterest> |
| 2022-07-20 | 111.01 | 100.00 | <Transfer:acc02,acc01> |
| 2022-07-20 | 113.01 | 2.00 | <Transfer:acc03,acc01> |
| 2022-07-20 | 113.61 | 0.60 | <Transfer:acc04,acc01> |
| 2022-07-20 | 110.62 | -2.99 | <PayInt:A1> |
| 2022-07-20 | 0.00 | -110.62 | <PayPrin:A1> |
| 2022-07-31 | 10.28 | 10.28 | <Pool:CollectedInterest> |
| 2022-08-20 | 110.28 | 100.00 | <Transfer:acc02,acc01> |
| 2022-08-20 | 112.28 | 2.00 | <Transfer:acc03,acc01> |
| 2022-08-20 | 112.91 | 0.63 | <Transfer:acc04,acc01> |
| 2022-08-20 | 110.48 | -2.43 | <PayInt:A1> |
| 2022-08-20 | 0.00 | -110.48 | <PayPrin:A1> |
| 2022-08-31 | 9.55 | 9.55 | <Pool:CollectedInterest> |
| 2022-09-20 | 109.55 | 100.00 | <Transfer:acc02,acc01> |
| 2022-09-20 | 111.55 | 2.00 | <Transfer:acc03,acc01> |
| 2022-09-20 | 112.13 | 0.58 | <Transfer:acc04,acc01> |
| 2022-09-20 | 110.36 | -1.77 | <PayInt:A1> |
| 2022-09-20 | 0.00 | -110.36 | <PayPrin:A1> |
| 2022-09-30 | 8.82 | 8.82 | <Pool:CollectedInterest> |
| 2022-10-20 | 108.82 | 100.00 | <Transfer:acc02,acc01> |
| 2022-10-20 | 110.82 | 2.00 | <Transfer:acc03,acc01> |
| 2022-10-20 | 111.38 | 0.56 | <Transfer:acc04,acc01> |
| 2022-10-20 | 110.30 | -1.08 | <PayInt:A1> |
| 2022-10-20 | 0.00 | -110.30 | <PayPrin:A1> |
| 2022-10-31 | 8.10 | 8.10 | <Pool:CollectedInterest> |