Pricing a single asset

m = ["Mortgage"
        ,{"originBalance": 12000.0
            ,"originRate": ["fix",0.045]
            ,"originTerm": 30
            ,"freq": "Monthly"
            ,"type": "Level"
            ,"originDate": "2021-02-01"}
        ,{"currentBalance": 10000.0
            ,"currentRate": 0.075
            ,"remainTerm": 20
            ,"status": "Current"}]
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

Pricing by balance

### Pricing a single Mortgage

r = localAPI.runAsset("2020-01-02"
                     ,[m]
                     ,poolAssump=("Pool"
                                    ,("Mortgage", {"CDR":0.01}
                                                , None
                                                , {"Rate":0.3,"Timing":[0.5,0.25,0.25]}
                                                , None)
                                    ,None
                                    ,None)
                     ,pricing=["Current|Defaulted",0.95,0]
                     ,read=True)
r[1]
/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(
Pricing WAL Duration Convexity AccruedInterest
0 9500 2.95 -1 -1 -1

Pricing by rate

r = localAPI.runAsset("2021-12-01"
                     ,[m]
                     ,poolAssump=("Pool"
                                    ,("Mortgage", {"CDR":0.01}
                                                , None
                                                , {"Rate":0.3,"Timing":[0.5,0.25,0.25]}
                                                , None)
                                    ,None
                                    ,None)
                     ,pricing=["PvRate",0.0525]
                     ,read=True)
r[1]
/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(
Pricing WAL Duration Convexity AccruedInterest
0 10142.91 0.92 0.859649 0 61.64

Pricing by curve

r = localAPI.runAsset("2021-12-01"
                     ,[m]
                     ,poolAssump=("Pool"
                                    ,("Mortgage", {"CDR":0.01}
                                                , None
                                                , {"Rate":0.3,"Timing":[0.5,0.25,0.25]}
                                                , None)
                                    ,None
                                    ,None)
                     ,pricing=["PVCurve",[["2021-12-01",0.0525]
                                          ,["2022-12-01",0.0825]]]
                     ,read=True)
r[1]
/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(
Pricing WAL Duration Convexity AccruedInterest
0 9930.16 0.92 0.852143 0 61.64