{ "cells": [ { "cell_type": "markdown", "id": "7bd0db22", "metadata": {}, "source": [ "### Example of fee flow by index" ] }, { "cell_type": "code", "execution_count": null, "id": "e6b83a04-dfe0-4f2c-b27d-0cf950896415", "metadata": {}, "outputs": [], "source": [ "from absbox import Generic\n", "\n", "test01 = Generic(\n", " \"deal with bond schedule by index\"\n", " ,{\"collect\":[\"2021-03-01\",\"2021-06-30\"],\"pay\":[\"2021-06-15\",\"2021-07-20\"]\n", " ,\"payFreq\":[\"DayOfMonth\",20],\"poolFreq\":\"MonthEnd\",\"stated\":\"2030-01-01\"}\n", " ,{'assets':[[\"Mortgage\"\n", " ,{\"originBalance\":2200,\"originRate\":[\"fix\",0.045],\"originTerm\":30\n", " ,\"freq\":\"Monthly\",\"type\":\"Level\",\"originDate\":\"2021-02-01\"}\n", " ,{\"currentBalance\":2200\n", " ,\"currentRate\":0.08\n", " ,\"remainTerm\":30\n", " ,\"status\":\"current\"}]]\n", " ,'issuanceStat':{\"IssuanceBalance\":2300}}\n", " ,((\"acc01\",{\"balance\":0}),)\n", " ,((\"A1\",{\"balance\":1000\n", " ,\"rate\":0.07\n", " ,\"originBalance\":1000\n", " ,\"originRate\":0.07\n", " ,\"startDate\":\"2020-01-03\"\n", " ,\"rateType\":{\"Fixed\":0.08}\n", " ,\"bondType\": \"Sequential\"\n", " })\n", " ,(\"B\",{\"balance\":1000\n", " ,\"rate\":0.0\n", " ,\"originBalance\":1000\n", " ,\"originRate\":0.07\n", " ,\"startDate\":\"2020-01-03\"\n", " ,\"rateType\":{\"Fixed\":0.00}\n", " ,\"bondType\":{\"Equity\":None}\n", " }))\n", " ,((\"feeByIndex\",{\"type\":{\"flowByBondPeriod\": [ [1,80],[2,120],[3,300] ]},\"feeStart\":\"2021-06-15\"}),)\n", " ,{\"amortizing\":[\n", " [\"calcAndPayFee\",\"acc01\",['feeByIndex']]\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", " ,None\n", " ,None\n", " ,None\n", " ,{\"BondPaidPeriod\": 0,\"PoolCollectedPeriod\":0}\n", " )" ] }, { "cell_type": "code", "execution_count": 52, "id": "eb9838ac-12ce-457b-adf8-7fb0f981cbdf", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Connecting engine server -> http://localhost:8081\n", "\n" ], "text/plain": [ "\u001b[1;35mConnecting engine server -> \u001b[0m\u001b[1;4;35mhttp://localhost:8081\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
✅Connected, local lib:0.28.7, server:0.42.0\n", "\n" ], "text/plain": [ "✅\u001b[1;32mConnected, local li\u001b[0m\u001b[1;32mb:0\u001b[0m\u001b[1;32m.\u001b[0m\u001b[1;32m28.7\u001b[0m\u001b[1;32m, server:\u001b[0m\u001b[1;32m0.42\u001b[0m\u001b[1;32m.\u001b[0m\u001b[1;32m0\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from absbox import API,EnginePath\n", "\n", "localAPI = API(EnginePath.DEV, check=False)" ] }, { "cell_type": "code", "execution_count": 53, "id": "cf1034ad-e1a1-4f70-b65d-18f47a3e0ba1", "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", " | balance | \n", "payment | \n", "due | \n", "
|---|---|---|---|
| date | \n", "\n", " | \n", " | \n", " |
| 2021-07-20 | \n", "0.00 | \n", "80.00 | \n", "0 | \n", "
| 2021-08-20 | \n", "0.00 | \n", "40.00 | \n", "0 | \n", "
| 2021-09-20 | \n", "98.85 | \n", "81.15 | \n", "0 | \n", "
| 2021-10-20 | \n", "116.55 | \n", "81.15 | \n", "0 | \n", "
| 2021-11-20 | \n", "53.10 | \n", "81.15 | \n", "0 | \n", "
| 2021-12-20 | \n", "0.00 | \n", "53.10 | \n", "0 | \n", "
| 2022-01-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-02-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-03-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-04-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-05-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-06-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-07-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-08-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-09-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-10-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-11-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2022-12-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-01-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-02-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-03-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-04-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-05-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-06-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-07-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-08-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "
| 2023-09-20 | \n", "0.00 | \n", "0.00 | \n", "0 | \n", "