from absbox import API,EnginePath

localAPI = API(EnginePath.DEV,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

Triggers with waterfall actions

There is example trigger04 which shipped with trigger with waterfall actions

from absbox.examples import trigger04
trigger04.trigger
{'AfterCollect': {'poolDef': {'condition': [('cumPoolDefaultedBalance',),
    '>',
    20],
   'effects': ('actions', ['calcInt', 'A1'], ['payInt', 'acc01', ['A1']]),
   'status': False,
   'curable': False}}}

Mannual fire trigger in assumption

User can mannually trigger via fireTrigger assumption , with

  • Date

  • trigger location

  • trigger name

r = localAPI.run(trigger04
                 ,poolAssump = ("Pool"
                                ,("Mortgage"
                                 ,{"CDR":0.02} ,None, None, None)
                                 ,None
                                 ,None)
                 ,runAssump = [("fireTrigger",[("2021-10-01","AfterCollect","poolDef")])]
                 ,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(

Now , at 2021-10-01, at end of pool collection, the waterfall actions were executed

r['accounts']['acc01'].loc["2021-10-01"]
balance change memo
date
2021-10-01 9.62 9.62 <Pool:CollectedInterest>
2021-10-01 116.29 106.67 <Pool:CollectedPrincipal>
2021-10-01 116.29 0.00 <Pool:CollectedPrepayment>
2021-10-01 116.29 0.00 <Pool:CollectedRecoveries>
2021-10-01 115.87 -0.42 <PayInt:A1>