{ "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", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
balancechangememo
date
2021-10-019.629.62<Pool:CollectedInterest>
2021-10-01116.29106.67<Pool:CollectedPrincipal>
2021-10-01116.290.00<Pool:CollectedPrepayment>
2021-10-01116.290.00<Pool:CollectedRecoveries>
2021-10-01115.87-0.42<PayInt:A1>
\n", "
" ], "text/plain": [ " balance change memo\n", "date \n", "2021-10-01 9.62 9.62 \n", "2021-10-01 116.29 106.67 \n", "2021-10-01 116.29 0.00 \n", "2021-10-01 116.29 0.00 \n", "2021-10-01 115.87 -0.42 " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r['accounts']['acc01'].loc[\"2021-10-01\"]" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.3" } }, "nbformat": 4, "nbformat_minor": 5 }