{
"cells": [
{
"cell_type": "markdown",
"id": "0978bd9d",
"metadata": {},
"source": [
"### Run A resecuritization Deal"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "67e1bf5e",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
Connecting engine server -> http://localhost:8081\n",
"\n"
],
"text/plain": [
"Connecting engine server -> \u001b[4;94mhttp://localhost:8081\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"✅Connected, local lib:0.46.5, server:0.50.2\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;36m2\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from absbox import API,EnginePath,Generic\n",
"\n",
"localAPI = API(EnginePath.DEV,check=False)"
]
},
{
"cell_type": "markdown",
"id": "92e0964f",
"metadata": {},
"source": [
"#### What is a ReSec Deal ?"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "005cdf05",
"metadata": {},
"outputs": [
{
"ename": "ExecutableNotFound",
"evalue": "failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mFileNotFoundError\u001b[39m Traceback (most recent call last)",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/backend/execute.py:76\u001b[39m, in \u001b[36mrun_check\u001b[39m\u001b[34m(cmd, input_lines, encoding, quiet, **kwargs)\u001b[39m\n\u001b[32m 75\u001b[39m kwargs[\u001b[33m'\u001b[39m\u001b[33mstdout\u001b[39m\u001b[33m'\u001b[39m] = kwargs[\u001b[33m'\u001b[39m\u001b[33mstderr\u001b[39m\u001b[33m'\u001b[39m] = subprocess.PIPE\n\u001b[32m---> \u001b[39m\u001b[32m76\u001b[39m proc = \u001b[43m_run_input_lines\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcmd\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43minput_lines\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m=\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 77\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/backend/execute.py:96\u001b[39m, in \u001b[36m_run_input_lines\u001b[39m\u001b[34m(cmd, input_lines, kwargs)\u001b[39m\n\u001b[32m 95\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_run_input_lines\u001b[39m(cmd, input_lines, *, kwargs):\n\u001b[32m---> \u001b[39m\u001b[32m96\u001b[39m popen = \u001b[43msubprocess\u001b[49m\u001b[43m.\u001b[49m\u001b[43mPopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcmd\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstdin\u001b[49m\u001b[43m=\u001b[49m\u001b[43msubprocess\u001b[49m\u001b[43m.\u001b[49m\u001b[43mPIPE\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 98\u001b[39m stdin_write = popen.stdin.write\n",
"\u001b[36mFile \u001b[39m\u001b[32m/nix/store/2mab9iiwhcqwk75qwvp3zv0bvbiaq6cs-python3-3.13.3/lib/python3.13/subprocess.py:1039\u001b[39m, in \u001b[36mPopen.__init__\u001b[39m\u001b[34m(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)\u001b[39m\n\u001b[32m 1036\u001b[39m \u001b[38;5;28mself\u001b[39m.stderr = io.TextIOWrapper(\u001b[38;5;28mself\u001b[39m.stderr,\n\u001b[32m 1037\u001b[39m encoding=encoding, errors=errors)\n\u001b[32m-> \u001b[39m\u001b[32m1039\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_execute_child\u001b[49m\u001b[43m(\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexecutable\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpreexec_fn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mclose_fds\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1040\u001b[39m \u001b[43m \u001b[49m\u001b[43mpass_fds\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcwd\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43menv\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1041\u001b[39m \u001b[43m \u001b[49m\u001b[43mstartupinfo\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcreationflags\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mshell\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1042\u001b[39m \u001b[43m \u001b[49m\u001b[43mp2cread\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mp2cwrite\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1043\u001b[39m \u001b[43m \u001b[49m\u001b[43mc2pread\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mc2pwrite\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1044\u001b[39m \u001b[43m \u001b[49m\u001b[43merrread\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43merrwrite\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1045\u001b[39m \u001b[43m \u001b[49m\u001b[43mrestore_signals\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1046\u001b[39m \u001b[43m \u001b[49m\u001b[43mgid\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgids\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43muid\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mumask\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 1047\u001b[39m \u001b[43m \u001b[49m\u001b[43mstart_new_session\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mprocess_group\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1048\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[32m 1049\u001b[39m \u001b[38;5;66;03m# Cleanup if the child failed starting.\u001b[39;00m\n",
"\u001b[36mFile \u001b[39m\u001b[32m/nix/store/2mab9iiwhcqwk75qwvp3zv0bvbiaq6cs-python3-3.13.3/lib/python3.13/subprocess.py:1969\u001b[39m, in \u001b[36mPopen._execute_child\u001b[39m\u001b[34m(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group)\u001b[39m\n\u001b[32m 1968\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m err_filename \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1969\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m child_exception_type(errno_num, err_msg, err_filename)\n\u001b[32m 1970\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"\u001b[31mFileNotFoundError\u001b[39m: [Errno 2] No such file or directory: PosixPath('dot')",
"\nThe above exception was the direct cause of the following exception:\n",
"\u001b[31mExecutableNotFound\u001b[39m Traceback (most recent call last)",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/IPython/core/formatters.py:1036\u001b[39m, in \u001b[36mMimeBundleFormatter.__call__\u001b[39m\u001b[34m(self, obj, include, exclude)\u001b[39m\n\u001b[32m 1033\u001b[39m method = get_real_method(obj, \u001b[38;5;28mself\u001b[39m.print_method)\n\u001b[32m 1035\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m method \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m1036\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mmethod\u001b[49m\u001b[43m(\u001b[49m\u001b[43minclude\u001b[49m\u001b[43m=\u001b[49m\u001b[43minclude\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexclude\u001b[49m\u001b[43m=\u001b[49m\u001b[43mexclude\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 1037\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[32m 1038\u001b[39m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/jupyter_integration.py:98\u001b[39m, in \u001b[36mJupyterIntegration._repr_mimebundle_\u001b[39m\u001b[34m(self, include, exclude, **_)\u001b[39m\n\u001b[32m 96\u001b[39m include = \u001b[38;5;28mset\u001b[39m(include) \u001b[38;5;28;01mif\u001b[39;00m include \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;28;01melse\u001b[39;00m {\u001b[38;5;28mself\u001b[39m._jupyter_mimetype}\n\u001b[32m 97\u001b[39m include -= \u001b[38;5;28mset\u001b[39m(exclude \u001b[38;5;129;01mor\u001b[39;00m [])\n\u001b[32m---> \u001b[39m\u001b[32m98\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m {mimetype: \u001b[38;5;28;43mgetattr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmethod_name\u001b[49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 99\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m mimetype, method_name \u001b[38;5;129;01min\u001b[39;00m MIME_TYPES.items()\n\u001b[32m 100\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m mimetype \u001b[38;5;129;01min\u001b[39;00m include}\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/jupyter_integration.py:112\u001b[39m, in \u001b[36mJupyterIntegration._repr_image_svg_xml\u001b[39m\u001b[34m(self)\u001b[39m\n\u001b[32m 110\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_repr_image_svg_xml\u001b[39m(\u001b[38;5;28mself\u001b[39m) -> \u001b[38;5;28mstr\u001b[39m:\n\u001b[32m 111\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33;03m\"\"\"Return the rendered graph as SVG string.\"\"\"\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m112\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mpipe\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m=\u001b[49m\u001b[33;43m'\u001b[39;49m\u001b[33;43msvg\u001b[39;49m\u001b[33;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[43m=\u001b[49m\u001b[43mSVG_ENCODING\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/piping.py:104\u001b[39m, in \u001b[36mPipe.pipe\u001b[39m\u001b[34m(self, format, renderer, formatter, neato_no_op, quiet, engine, encoding)\u001b[39m\n\u001b[32m 55\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34mpipe\u001b[39m(\u001b[38;5;28mself\u001b[39m,\n\u001b[32m 56\u001b[39m \u001b[38;5;28mformat\u001b[39m: typing.Optional[\u001b[38;5;28mstr\u001b[39m] = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m 57\u001b[39m renderer: typing.Optional[\u001b[38;5;28mstr\u001b[39m] = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m (...)\u001b[39m\u001b[32m 61\u001b[39m engine: typing.Optional[\u001b[38;5;28mstr\u001b[39m] = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m 62\u001b[39m encoding: typing.Optional[\u001b[38;5;28mstr\u001b[39m] = \u001b[38;5;28;01mNone\u001b[39;00m) -> typing.Union[\u001b[38;5;28mbytes\u001b[39m, \u001b[38;5;28mstr\u001b[39m]:\n\u001b[32m 63\u001b[39m \u001b[38;5;250m \u001b[39m\u001b[33;03m\"\"\"Return the source piped through the Graphviz layout command.\u001b[39;00m\n\u001b[32m 64\u001b[39m \n\u001b[32m 65\u001b[39m \u001b[33;03m Args:\u001b[39;00m\n\u001b[32m (...)\u001b[39m\u001b[32m 102\u001b[39m \u001b[33;03m ' \u001b[39m\u001b[32m104\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_pipe_legacy\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[32m 105\u001b[39m \u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 106\u001b[39m \u001b[43m \u001b[49m\u001b[43mformatter\u001b[49m\u001b[43m=\u001b[49m\u001b[43mformatter\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 107\u001b[39m \u001b[43m \u001b[49m\u001b[43mneato_no_op\u001b[49m\u001b[43m=\u001b[49m\u001b[43mneato_no_op\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 108\u001b[39m \u001b[43m \u001b[49m\u001b[43mquiet\u001b[49m\u001b[43m=\u001b[49m\u001b[43mquiet\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 109\u001b[39m \u001b[43m \u001b[49m\u001b[43mengine\u001b[49m\u001b[43m=\u001b[49m\u001b[43mengine\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 110\u001b[39m \u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[43m=\u001b[49m\u001b[43mencoding\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/_tools.py:185\u001b[39m, in \u001b[36mdeprecate_positional_args..decorator..wrapper\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 177\u001b[39m wanted = \u001b[33m'\u001b[39m\u001b[33m, \u001b[39m\u001b[33m'\u001b[39m.join(\u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mname\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mvalue\u001b[38;5;132;01m!r}\u001b[39;00m\u001b[33m'\u001b[39m\n\u001b[32m 178\u001b[39m \u001b[38;5;28;01mfor\u001b[39;00m name, value \u001b[38;5;129;01min\u001b[39;00m deprecated.items())\n\u001b[32m 179\u001b[39m warnings.warn(\u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33mThe signature of \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfunc_name\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m will be reduced\u001b[39m\u001b[33m'\u001b[39m\n\u001b[32m 180\u001b[39m \u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33m to \u001b[39m\u001b[38;5;132;01m{\u001b[39;00msupported_number\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m positional arg\u001b[39m\u001b[38;5;132;01m{\u001b[39;00ms_\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;132;01m{\u001b[39;00mqualification\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m\n\u001b[32m 181\u001b[39m \u001b[33mf\u001b[39m\u001b[33m'\u001b[39m\u001b[33m \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mlist\u001b[39m(supported)\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m: pass \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mwanted\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m as keyword arg\u001b[39m\u001b[38;5;132;01m{\u001b[39;00ms_\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m'\u001b[39m,\n\u001b[32m 182\u001b[39m stacklevel=stacklevel,\n\u001b[32m 183\u001b[39m category=category)\n\u001b[32m--> \u001b[39m\u001b[32m185\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/piping.py:121\u001b[39m, in \u001b[36mPipe._pipe_legacy\u001b[39m\u001b[34m(self, format, renderer, formatter, neato_no_op, quiet, engine, encoding)\u001b[39m\n\u001b[32m 112\u001b[39m \u001b[38;5;129m@_tools\u001b[39m.deprecate_positional_args(supported_number=\u001b[32m1\u001b[39m, ignore_arg=\u001b[33m'\u001b[39m\u001b[33mself\u001b[39m\u001b[33m'\u001b[39m)\n\u001b[32m 113\u001b[39m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34m_pipe_legacy\u001b[39m(\u001b[38;5;28mself\u001b[39m,\n\u001b[32m 114\u001b[39m \u001b[38;5;28mformat\u001b[39m: typing.Optional[\u001b[38;5;28mstr\u001b[39m] = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m (...)\u001b[39m\u001b[32m 119\u001b[39m engine: typing.Optional[\u001b[38;5;28mstr\u001b[39m] = \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[32m 120\u001b[39m encoding: typing.Optional[\u001b[38;5;28mstr\u001b[39m] = \u001b[38;5;28;01mNone\u001b[39;00m) -> typing.Union[\u001b[38;5;28mbytes\u001b[39m, \u001b[38;5;28mstr\u001b[39m]:\n\u001b[32m--> \u001b[39m\u001b[32m121\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_pipe_future\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[32m 122\u001b[39m \u001b[43m \u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m=\u001b[49m\u001b[43mrenderer\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 123\u001b[39m \u001b[43m \u001b[49m\u001b[43mformatter\u001b[49m\u001b[43m=\u001b[49m\u001b[43mformatter\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 124\u001b[39m \u001b[43m \u001b[49m\u001b[43mneato_no_op\u001b[49m\u001b[43m=\u001b[49m\u001b[43mneato_no_op\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 125\u001b[39m \u001b[43m \u001b[49m\u001b[43mquiet\u001b[49m\u001b[43m=\u001b[49m\u001b[43mquiet\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 126\u001b[39m \u001b[43m \u001b[49m\u001b[43mengine\u001b[49m\u001b[43m=\u001b[49m\u001b[43mengine\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 127\u001b[39m \u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[43m=\u001b[49m\u001b[43mencoding\u001b[49m\u001b[43m)\u001b[49m\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/piping.py:149\u001b[39m, in \u001b[36mPipe._pipe_future\u001b[39m\u001b[34m(self, format, renderer, formatter, neato_no_op, quiet, engine, encoding)\u001b[39m\n\u001b[32m 146\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m encoding \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m 147\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m codecs.lookup(encoding) \u001b[38;5;129;01mis\u001b[39;00m codecs.lookup(\u001b[38;5;28mself\u001b[39m.encoding):\n\u001b[32m 148\u001b[39m \u001b[38;5;66;03m# common case: both stdin and stdout need the same encoding\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m149\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_pipe_lines_string\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mencoding\u001b[49m\u001b[43m=\u001b[49m\u001b[43mencoding\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 150\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m 151\u001b[39m raw = \u001b[38;5;28mself\u001b[39m._pipe_lines(*args, input_encoding=\u001b[38;5;28mself\u001b[39m.encoding, **kwargs)\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/backend/piping.py:212\u001b[39m, in \u001b[36mpipe_lines_string\u001b[39m\u001b[34m(engine, format, input_lines, encoding, renderer, formatter, neato_no_op, quiet)\u001b[39m\n\u001b[32m 206\u001b[39m cmd = dot_command.command(engine, \u001b[38;5;28mformat\u001b[39m,\n\u001b[32m 207\u001b[39m renderer=renderer,\n\u001b[32m 208\u001b[39m formatter=formatter,\n\u001b[32m 209\u001b[39m neato_no_op=neato_no_op)\n\u001b[32m 210\u001b[39m kwargs = {\u001b[33m'\u001b[39m\u001b[33minput_lines\u001b[39m\u001b[33m'\u001b[39m: input_lines, \u001b[33m'\u001b[39m\u001b[33mencoding\u001b[39m\u001b[33m'\u001b[39m: encoding}\n\u001b[32m--> \u001b[39m\u001b[32m212\u001b[39m proc = \u001b[43mexecute\u001b[49m\u001b[43m.\u001b[49m\u001b[43mrun_check\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcmd\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcapture_output\u001b[49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mquiet\u001b[49m\u001b[43m=\u001b[49m\u001b[43mquiet\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 213\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m proc.stdout\n",
"\u001b[36mFile \u001b[39m\u001b[32m~/repo/AbsBox/lib/python3.13/site-packages/graphviz/backend/execute.py:81\u001b[39m, in \u001b[36mrun_check\u001b[39m\u001b[34m(cmd, input_lines, encoding, quiet, **kwargs)\u001b[39m\n\u001b[32m 79\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[32m 80\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m e.errno == errno.ENOENT:\n\u001b[32m---> \u001b[39m\u001b[32m81\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m ExecutableNotFound(cmd) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01me\u001b[39;00m\n\u001b[32m 82\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m\n\u001b[32m 84\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m quiet \u001b[38;5;129;01mand\u001b[39;00m proc.stderr:\n",
"\u001b[31mExecutableNotFound\u001b[39m: failed to execute PosixPath('dot'), make sure the Graphviz executables are on your systems' PATH"
]
},
{
"data": {
"text/plain": [
""
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from graphviz import Digraph\n",
"# Create Digraph object\n",
"dot = Digraph()\n",
"dot.node('Top Deal')\n",
"dot.node('Child Deal 1')\n",
"dot.node('Bond A1')\n",
"dot.node('Bond A2')\n",
"\n",
"dot.node(\"Pool A\")\n",
"dot.node(\"Pool B\")\n",
"dot.node(\"Pool C\")\n",
"\n",
"dot.edge(\"Pool B\",'Child Deal 2')\n",
"dot.edge(\"Pool A\",'Child Deal 1')\n",
"dot.edge(\"Pool C\",'Top Deal')\n",
"\n",
"\n",
"dot.edge('Child Deal 1','Bond A1')\n",
"dot.edge('Child Deal 1','Bond A2')\n",
"\n",
"\n",
"dot.node('Child Deal 2')\n",
"dot.node('Bond B1')\n",
"dot.node('Bond B2')\n",
"dot.edge('Child Deal 2','Bond B1')\n",
"dot.edge('Child Deal 2','Bond B2')\n",
"# Add edge between 1 and 2\n",
"dot.edge('Bond A1',\"Pool C\")\n",
"dot.edge('Bond B2',\"Pool C\")\n",
"dot"
]
},
{
"cell_type": "markdown",
"id": "96ba58c8",
"metadata": {},
"source": [
"In general , Resec deal has a pool of structured tranches, which cashflow comes from other deals."
]
},
{
"cell_type": "markdown",
"id": "ff863792",
"metadata": {},
"source": [
"##### Underlying Deal\n",
"\n",
"The underlying deal has two tranches. The tranche \"A1\" was bought by \"Top Deal\"."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "7a8f0158",
"metadata": {},
"outputs": [],
"source": [
"test01 = Generic(\n",
" \"underlyingDeal\"\n",
" ,{\"collect\":[\"2022-11-01\",\"2022-12-01\"] \n",
" ,\"pay\":[\"2022-11-15\",\"2022-12-15\"] \n",
" ,\"stated\":\"2030-01-01\",\"poolFreq\":\"MonthEnd\",\"payFreq\":[\"DayOfMonth\",20]}\n",
" ,{'assets':[[\"Mortgage\"\n",
" ,{\"originBalance\":3600,\"originRate\":[\"fix\",0.045],\"originTerm\":30\n",
" ,\"freq\":\"Monthly\",\"type\":\"Level\",\"originDate\":\"2021-02-01\"}\n",
" ,{\"currentBalance\":3600\n",
" ,\"currentRate\":0.08\n",
" ,\"remainTerm\":30\n",
" ,\"status\":\"current\"}]]\n",
" ,'issuanceStat':{\"IssuanceBalance\":2200}}\n",
" ,((\"acc01\",{\"balance\":0}),)\n",
" ,((\"A1\",{\"balance\":1000\n",
" ,\"rate\":0.07\n",
" ,\"originBalance\":1000\n",
" ,\"originRate\":0.07\n",
" ,\"startDate\":\"2022-11-15\"\n",
" ,\"rateType\":{\"Fixed\":0.08}\n",
" ,\"bondType\":{\"Sequential\":None}})\n",
" ,(\"B\",{\"balance\":1000\n",
" ,\"rate\":0.0\n",
" ,\"originBalance\":1000\n",
" ,\"originRate\":0.07\n",
" ,\"startDate\":\"2022-11-15\"\n",
" ,\"rateType\":{\"Fixed\":0.00}\n",
" ,\"bondType\":{\"Equity\":None}\n",
" }))\n",
" ,((\"trusteeFee\",{\"type\":{\"fixFee\":30},\"feeStart\":\"2022-12-15\"}),)\n",
" ,{\"amortizing\":[\n",
" [\"payFee\",\"acc01\",['trusteeFee']]\n",
" ,[\"accrueAndPayInt\",\"acc01\",[\"A1\"]]\n",
" ,[\"payPrin\",\"acc01\",[\"A1\"]]\n",
" ,[\"payPrin\",\"acc01\",[\"B\"]]\n",
" ,[\"payIntResidual\",\"acc01\",\"B\"]\n",
" ]}\n",
" ,[[\"CollectedInterest\",\"acc01\"]\n",
" ,[\"CollectedPrincipal\",\"acc01\"]\n",
" ,[\"CollectedPrepayment\",\"acc01\"]\n",
" ,[\"CollectedRecoveries\",\"acc01\"]]\n",
" ,None\n",
" ,None\n",
" ,None\n",
" ,None\n",
" ,\"Amortizing\"\n",
" )"
]
},
{
"cell_type": "markdown",
"id": "254953ff",
"metadata": {},
"source": [
"##### Top Deal\n",
"\n",
"The top deal bought \n",
"* 100% of tranche A1\n",
"* bought at date \"2022-03-31\", which suggest , tranche cashflow after that date will attribute to Top Deal "
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "7ceec039",
"metadata": {},
"outputs": [],
"source": [
"test02 = Generic(\n",
" \"TEST01\"\n",
" ,{\"cutoff\":\"2021-03-01\",\"closing\":\"2021-06-15\",\"firstPay\":\"2021-07-26\"\n",
" ,\"payFreq\":[\"DayOfMonth\",20],\"poolFreq\":\"MonthEnd\",\"stated\":\"2030-01-01\"}\n",
" ,{'deals':\n",
" {(\"A1\",'1 % 1',\"2022-03-31\"):test01}}\n",
" ,((\"acc01\",{\"balance\":0}),)\n",
" ,((\"A1\",{\"balance\":700\n",
" ,\"rate\":0.07\n",
" ,\"originBalance\":700\n",
" ,\"originRate\":0.07\n",
" ,\"startDate\":\"2020-01-03\"\n",
" ,\"rateType\":{\"Fixed\":0.08}\n",
" ,\"bondType\":{\"Sequential\":None}})\n",
" ,(\"B\",{\"balance\":700\n",
" ,\"rate\":0.0\n",
" ,\"originBalance\":700\n",
" ,\"originRate\":0.07\n",
" ,\"startDate\":\"2020-01-03\"\n",
" ,\"rateType\":{\"Fixed\":0.00}\n",
" ,\"bondType\":{\"Equity\":None}\n",
" }))\n",
" ,((\"trusteeFee\",{\"type\":{\"fixFee\":30},\"feeStart\":\"2021-06-15\"}),)\n",
" ,{\"amortizing\":[\n",
" [\"payFee\",\"acc01\",['trusteeFee']]\n",
" ,[\"accrueAndPayInt\",\"acc01\",[\"A1\"]]\n",
" ,[\"payPrin\",\"acc01\",[\"A1\"]]\n",
" ,[\"payPrin\",\"acc01\",[\"B\"]]\n",
" ,[\"payIntResidual\",\"acc01\",\"B\"]\n",
" ]}\n",
" ,[[\"CollectedInterest\",\"acc01\"]\n",
" ,[\"CollectedPrincipal\",\"acc01\"]]\n",
" ,None\n",
" ,None\n",
" ,None\n",
" ,None\n",
" ,(\"PreClosing\",\"Amortizing\")\n",
" )"
]
},
{
"cell_type": "markdown",
"id": "dc7e8e09",
"metadata": {},
"source": [
"#### Inspect Underlying Deal Cashflow\n",
"\n",
"*Optional*\n",
"\n",
"Let's run underlying deal first and get `A1` bond cashflow"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7fb8facc",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Warning Message from server:Bond B is not paid off\n",
"\n"
],
"text/plain": [
"Warning Message from server:Bond B is not paid off\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"item 4 {'PoolConsol': [{'tag': 'CashFlowFrame', 'contents': [[0, '2023-08-31', None], []]}, [{'tag': 'CashFlowFrame', 'contents': [[0, '2023-08-31', None], []]}]]}\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" balance | \n",
" interest | \n",
" principal | \n",
" rate | \n",
" cash | \n",
" intDue | \n",
" intOverInt | \n",
" factor | \n",
" memo | \n",
"
\n",
" \n",
" | date | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" | 2022-12-15 | \n",
" 740.17 | \n",
" 5.75 | \n",
" 259.83 | \n",
" 0.07 | \n",
" 265.58 | \n",
" 0 | \n",
" 0 | \n",
" 0.74017 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-02-20 | \n",
" 646.91 | \n",
" 9.53 | \n",
" 93.26 | \n",
" 0.07 | \n",
" 102.79 | \n",
" 0 | \n",
" 0 | \n",
" 0.64691 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-03-20 | \n",
" 517.59 | \n",
" 3.47 | \n",
" 129.32 | \n",
" 0.07 | \n",
" 132.79 | \n",
" 0 | \n",
" 0 | \n",
" 0.51759 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-04-20 | \n",
" 387.86 | \n",
" 3.07 | \n",
" 129.73 | \n",
" 0.07 | \n",
" 132.80 | \n",
" 0 | \n",
" 0 | \n",
" 0.38786 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-05-20 | \n",
" 257.30 | \n",
" 2.23 | \n",
" 130.56 | \n",
" 0.07 | \n",
" 132.79 | \n",
" 0 | \n",
" 0 | \n",
" 0.25730 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-06-20 | \n",
" 126.03 | \n",
" 1.52 | \n",
" 131.27 | \n",
" 0.07 | \n",
" 132.79 | \n",
" 0 | \n",
" 0 | \n",
" 0.12603 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-07-20 | \n",
" 0.00 | \n",
" 0.72 | \n",
" 126.03 | \n",
" 0.07 | \n",
" 126.75 | \n",
" 0 | \n",
" 0 | \n",
" 0.00000 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" balance interest principal rate cash intDue intOverInt \\\n",
"date \n",
"2022-12-15 740.17 5.75 259.83 0.07 265.58 0 0 \n",
"2023-02-20 646.91 9.53 93.26 0.07 102.79 0 0 \n",
"2023-03-20 517.59 3.47 129.32 0.07 132.79 0 0 \n",
"2023-04-20 387.86 3.07 129.73 0.07 132.80 0 0 \n",
"2023-05-20 257.30 2.23 130.56 0.07 132.79 0 0 \n",
"2023-06-20 126.03 1.52 131.27 0.07 132.79 0 0 \n",
"2023-07-20 0.00 0.72 126.03 0.07 126.75 0 0 \n",
"\n",
" factor memo \n",
"date \n",
"2022-12-15 0.74017 [, ] \n",
"2023-02-20 0.64691 [, ] \n",
"2023-03-20 0.51759 [, ] \n",
"2023-04-20 0.38786 [, ] \n",
"2023-05-20 0.25730 [, ] \n",
"2023-06-20 0.12603 [, ] \n",
"2023-07-20 0.00000 [, ] "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r0 = localAPI.run(test01\n",
" ,poolAssump = None\n",
" ,runAssump = []\n",
" ,read=True)\n",
"\n",
"r0['bonds']['A1']"
]
},
{
"cell_type": "markdown",
"id": "149c6eeb",
"metadata": {},
"source": [
"##### Note\n",
"User don't have to run underlying deal.\n",
"User just need to run the top deal the engine will run underlying deal automatically\n",
"\n",
"Let's run the top deal with pool assumption tuple start with `ByDealName`"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "80c60a8a",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Warning Message from server:Bond B is not paid off\n",
"\n"
],
"text/plain": [
"Warning Message from server:Bond B is not paid off\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"item 4 {'BondFlow:underlyingDeal:A1:2022-03-31:1 % 1': [{'tag': 'CashFlowFrame', 'contents': [[0, '2023-07-31', None], []]}, None]}\n"
]
}
],
"source": [
"r = localAPI.run(test02\n",
" ,poolAssump = (\"ByDealName\"\n",
" ,{\"underlyingDeal\":((\"Pool\",(\"Mortgage\",None,None,None,None)\n",
" ,None,None)\n",
" ,[]\n",
" )})\n",
" ,runAssump = []\n",
" ,read=True)"
]
},
{
"cell_type": "markdown",
"id": "9b087d58",
"metadata": {},
"source": [
"We can inspect the pool cashflow ( actually ,it is bond flow from underlying deal )"
]
},
{
"cell_type": "code",
"execution_count": 81,
"id": "4c20895b",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" Balance | \n",
" Principal | \n",
" Interest | \n",
"
\n",
" \n",
" | Date | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" | 2022-11-30 | \n",
" 1000.00 | \n",
" 0.00 | \n",
" 0.00 | \n",
"
\n",
" \n",
" | 2022-12-31 | \n",
" 770.17 | \n",
" 229.83 | \n",
" 5.75 | \n",
"
\n",
" \n",
" | 2023-01-31 | \n",
" 770.17 | \n",
" 0.00 | \n",
" 0.00 | \n",
"
\n",
" \n",
" | 2023-02-28 | \n",
" 647.30 | \n",
" 122.87 | \n",
" 9.92 | \n",
"
\n",
" \n",
" | 2023-03-31 | \n",
" 517.98 | \n",
" 129.32 | \n",
" 3.47 | \n",
"
\n",
" \n",
" | 2023-04-30 | \n",
" 388.25 | \n",
" 129.73 | \n",
" 3.07 | \n",
"
\n",
" \n",
" | 2023-05-31 | \n",
" 257.69 | \n",
" 130.56 | \n",
" 2.23 | \n",
"
\n",
" \n",
" | 2023-06-30 | \n",
" 126.43 | \n",
" 131.26 | \n",
" 1.53 | \n",
"
\n",
" \n",
" | 2023-07-31 | \n",
" 0.00 | \n",
" 126.43 | \n",
" 0.72 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Balance Principal Interest\n",
"Date \n",
"2022-11-30 1000.00 0.00 0.00\n",
"2022-12-31 770.17 229.83 5.75\n",
"2023-01-31 770.17 0.00 0.00\n",
"2023-02-28 647.30 122.87 9.92\n",
"2023-03-31 517.98 129.32 3.47\n",
"2023-04-30 388.25 129.73 3.07\n",
"2023-05-31 257.69 130.56 2.23\n",
"2023-06-30 126.43 131.26 1.53\n",
"2023-07-31 0.00 126.43 0.72"
]
},
"execution_count": 81,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"r['pool']['flow']['underlyingDeal', 'A1', '1 % 1'].loc[\"2022-11-30\":,]"
]
},
{
"cell_type": "markdown",
"id": "e30cde1c",
"metadata": {},
"source": [
"#### Set with pool stress\n",
"\n",
"User can set pool performance stress to underlying deal when runnning the top deal.\n",
"\n",
"\n",
"Here, we set underlying pool with `CPR 10%` with deal name `underlyingDeal`"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "496181ed",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"Warning Message from server:Bond B is not paid off\n",
"\n"
],
"text/plain": [
"Warning Message from server:Bond B is not paid off\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"item 4 {'BondFlow:underlyingDeal:A1:2022-03-31:1 % 1': [{'tag': 'CashFlowFrame', 'contents': [[0, '2023-09-30', None], []]}, None]}\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" balance | \n",
" interest | \n",
" principal | \n",
" rate | \n",
" cash | \n",
" intDue | \n",
" intOverInt | \n",
" factor | \n",
" memo | \n",
"
\n",
" \n",
" | date | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" | 2023-04-20 | \n",
" 383.74 | \n",
" 2.94 | \n",
" 111.22 | \n",
" 0.07 | \n",
" 114.16 | \n",
" 0 | \n",
" 0 | \n",
" 0.548200 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-05-20 | \n",
" 274.17 | \n",
" 2.20 | \n",
" 109.57 | \n",
" 0.07 | \n",
" 111.77 | \n",
" 0 | \n",
" 0 | \n",
" 0.391671 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-06-20 | \n",
" 165.38 | \n",
" 1.62 | \n",
" 108.79 | \n",
" 0.07 | \n",
" 110.41 | \n",
" 0 | \n",
" 0 | \n",
" 0.236257 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-07-20 | \n",
" 57.91 | \n",
" 0.95 | \n",
" 107.47 | \n",
" 0.07 | \n",
" 108.42 | \n",
" 0 | \n",
" 0 | \n",
" 0.082729 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
" | 2023-08-20 | \n",
" 0.00 | \n",
" 0.34 | \n",
" 57.91 | \n",
" 0.07 | \n",
" 58.25 | \n",
" 0 | \n",
" 0 | \n",
" 0.000000 | \n",
" [<PayInt:A1>, <PayPrin:A1>] | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" balance interest principal rate cash intDue intOverInt \\\n",
"date \n",
"2023-04-20 383.74 2.94 111.22 0.07 114.16 0 0 \n",
"2023-05-20 274.17 2.20 109.57 0.07 111.77 0 0 \n",
"2023-06-20 165.38 1.62 108.79 0.07 110.41 0 0 \n",
"2023-07-20 57.91 0.95 107.47 0.07 108.42 0 0 \n",
"2023-08-20 0.00 0.34 57.91 0.07 58.25 0 0 \n",
"\n",
" factor memo \n",
"date \n",
"2023-04-20 0.548200 [, ] \n",
"2023-05-20 0.391671 [, ] \n",
"2023-06-20 0.236257 [, ] \n",
"2023-07-20 0.082729 [, ] \n",
"2023-08-20 0.000000 [, ] "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"poolPerf = (\"Pool\",(\"Mortgage\",None,{\"CPR\":0.1},None,None)\n",
" ,None,None)\n",
"\n",
"rStress = localAPI.run(test02\n",
" ,poolAssump = (\"ByDealName\"\n",
" ,{\"underlyingDeal\":(poolPerf,[])\n",
" })\n",
" ,runAssump = []\n",
" ,read=True)\n",
"\n",
"\n",
"rStress['bonds']['A1'].tail()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7200dcb4",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "200312e0",
"metadata": {},
"outputs": [],
"source": []
}
],
"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
}