{
"cells": [
{
"cell_type": "markdown",
"id": "dd38fc6c",
"metadata": {},
"source": [
"### How deal is ended ?"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "476bfb4e",
"metadata": {},
"outputs": [],
"source": [
"from absbox.examples import test01"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "d88cc31b",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
Connecting engine server -> https://absbox.org/api/dev\n",
"\n"
],
"text/plain": [
"\u001b[1;35mConnecting engine server -> \u001b[0m\u001b[1;4;35mhttps://absbox.org/api/dev\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"✅Connected, local lib:0.26.4, server:0.27.13\n",
"\n"
],
"text/plain": [
"✅\u001b[1;32mConnected, local li\u001b[0m\u001b[1;32mb:0\u001b[0m\u001b[1;32m.\u001b[0m\u001b[1;32m26.4\u001b[0m\u001b[1;32m, server:\u001b[0m\u001b[1;32m0.27\u001b[0m\u001b[1;32m.\u001b[0m\u001b[1;32m13\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": "878ca21b",
"metadata": {},
"source": [
"#### Natural Way\n",
"\n",
"Deal projection will ended if:\n",
"* no more pool cashflow\n",
"* all account balances are zero\n",
"* it's not revolving"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "4c572b05",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Warning Message from server:\n",
"Bond B is not paid off\n",
"\n"
],
"text/plain": [
"Warning Message from server:\n",
"\u001b[1;33mBond B is not paid off\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Date | \n",
" From | \n",
" To | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 2021-04-01 | \n",
" PreClosing | \n",
" Amortizing | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Date From To\n",
"0 2021-04-01 PreClosing Amortizing"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r = localAPI.run(test01\n",
" ,poolAssump = None\n",
" ,runAssump = None\n",
" ,read=True)\n",
"r['result']['status']"
]
},
{
"cell_type": "markdown",
"id": "2601f0a2",
"metadata": {},
"source": [
"#### it's called\n",
"\n",
"Deal projection will stop when it a call assumption is being satisfied"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "3721cdb6",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Warning Message from server:\n",
"Bond B is not paid off\n",
"\n"
],
"text/plain": [
"Warning Message from server:\n",
"\u001b[1;33mBond B is not paid off\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Date | \n",
" From | \n",
" To | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 2021-04-01 | \n",
" PreClosing | \n",
" Amortizing | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Date From To\n",
"0 2021-04-01 PreClosing Amortizing"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r = localAPI.run(test01\n",
" ,poolAssump = None\n",
" ,runAssump = [(\"call\",(\"afterDate\",\"2022-06-01\"))]\n",
" ,read=True)\n",
"\n",
"r['result']['status']"
]
},
{
"cell_type": "markdown",
"id": "a2726451",
"metadata": {},
"source": [
"#### Mannual stopped\n",
"\n",
"Deal projection will stop when at a date specified in `runAssump` . For debug purpose"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "8c18033c",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Warning Message from server:\n",
"Bond B is not paid off\n",
"\n"
],
"text/plain": [
"Warning Message from server:\n",
"\u001b[1;33mBond B is not paid off\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Date | \n",
" From | \n",
" To | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 2021-04-01 | \n",
" PreClosing | \n",
" Amortizing | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Date From To\n",
"0 2021-04-01 PreClosing Amortizing"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r = localAPI.run(test01\n",
" ,poolAssump = None\n",
" ,runAssump = [(\"stop\",\"2022-04-01\")]\n",
" ,read=True)\n",
"\n",
"r['result']['status']"
]
},
{
"cell_type": "markdown",
"id": "f87319bb",
"metadata": {},
"source": [
"#### Hit stated maturity"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "05819062",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'cutoff': '2021-03-01',\n",
" 'closing': '2021-04-01',\n",
" 'firstPay': '2021-06-20',\n",
" 'payFreq': ['DayOfMonth', 20],\n",
" 'poolFreq': 'MonthFirst',\n",
" 'stated': '2022-05-01'}"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test01.dates"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "cfa53a32",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Warning Message from server:\n",
"Bond B is not paid off\n",
"\n"
],
"text/plain": [
"Warning Message from server:\n",
"\u001b[1;33mBond B is not paid off\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Date | \n",
" From | \n",
" To | \n",
"
\n",
" \n",
" \n",
" \n",
" | 0 | \n",
" 2021-04-01 | \n",
" PreClosing | \n",
" Amortizing | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Date From To\n",
"0 2021-04-01 PreClosing Amortizing"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test01.dates['stated'] = \"2022-05-01\"\n",
"\n",
"r = localAPI.run(test01\n",
" ,poolAssump = None\n",
" ,runAssump = None\n",
" ,read=True)\n",
"\n",
"r['result']['status']"
]
}
],
"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.11.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}