{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "455f0976", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Connecting engine server -> https://absbox.org/api/dev\n",
"\n"
],
"text/plain": [
"Connecting engine server -> \u001b[4;94mhttps://absbox.org/api/dev\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/xiaoyu/repo/AbsBox/lib/python3.13/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\n",
" warnings.warn(\n"
]
},
{
"data": {
"text/html": [
"✅Connected, local lib:0.46.5, server:0.50.1\n", "\n" ], "text/plain": [ "✅Connected, local li\u001b[1;92mb:0\u001b[0m.\u001b[1;36m46.5\u001b[0m, server:\u001b[1;36m0.50\u001b[0m.\u001b[1;36m1\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from absbox import API,EnginePath\n", "\n", "localAPI = API(EnginePath.DEV,check=False)" ] }, { "cell_type": "markdown", "id": "a9b4874b", "metadata": {}, "source": [ "### Triggers with waterfall actions" ] }, { "cell_type": "markdown", "id": "1dc06740", "metadata": {}, "source": [ "There is example `trigger04` which shipped with trigger with waterfall actions" ] }, { "cell_type": "code", "execution_count": 3, "id": "b0d94a5a", "metadata": {}, "outputs": [], "source": [ "from absbox.examples import trigger04" ] }, { "cell_type": "code", "execution_count": 4, "id": "fb01b996", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'AfterCollect': {'poolDef': {'condition': [('cumPoolDefaultedBalance',),\n", " '>',\n", " 20],\n", " 'effects': ('actions', ['calcInt', 'A1'], ['payInt', 'acc01', ['A1']]),\n", " 'status': False,\n", " 'curable': False}}}" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trigger04.trigger" ] }, { "cell_type": "markdown", "id": "36f13b74", "metadata": {}, "source": [ "#### Mannual fire trigger in assumption" ] }, { "cell_type": "markdown", "id": "2c163acd", "metadata": {}, "source": [ "User can mannually trigger via `fireTrigger` assumption , with\n", "\n", "* `Date`\n", "* `trigger location`\n", "* `trigger name`" ] }, { "cell_type": "code", "execution_count": 5, "id": "9e4ab866", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/xiaoyu/repo/AbsBox/lib/python3.13/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\n", " warnings.warn(\n" ] } ], "source": [ "r = localAPI.run(trigger04\n", " ,poolAssump = (\"Pool\"\n", " ,(\"Mortgage\"\n", " ,{\"CDR\":0.02} ,None, None, None)\n", " ,None\n", " ,None)\n", " ,runAssump = [(\"fireTrigger\",[(\"2021-10-01\",\"AfterCollect\",\"poolDef\")])]\n", " ,read=True)" ] }, { "cell_type": "markdown", "id": "3139f066", "metadata": {}, "source": [ "Now , at 2021-10-01, at end of pool collection, the waterfall actions were executed" ] }, { "cell_type": "code", "execution_count": 6, "id": "c3e631a7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | balance | \n", "change | \n", "memo | \n", "
|---|---|---|---|
| date | \n", "\n", " | \n", " | \n", " |
| 2021-10-01 | \n", "9.62 | \n", "9.62 | \n", "<Pool:CollectedInterest> | \n", "
| 2021-10-01 | \n", "116.29 | \n", "106.67 | \n", "<Pool:CollectedPrincipal> | \n", "
| 2021-10-01 | \n", "116.29 | \n", "0.00 | \n", "<Pool:CollectedPrepayment> | \n", "
| 2021-10-01 | \n", "116.29 | \n", "0.00 | \n", "<Pool:CollectedRecoveries> | \n", "
| 2021-10-01 | \n", "115.87 | \n", "-0.42 | \n", "<PayInt:A1> | \n", "