Advance Payment Accounting

Overview

Whenever any interaction is made with a Fixed Term Loan from the FixedTermLoanManager, _advanceGlobalPaymentAccounting is called. The purpose of this function is to account all Loans' outstanding interest and to represent the current state at the current timestamp.

For all of the below examples, the following abbreviations are used:

  • AIAI: accountedInterest

  • IRIR: issuanceRate

  • DSDS: domainStart

  • DEDE: domainEnd

For all of the below examples, $accountedInterest$ starts as the following:

AIpreAGPA=(IR1×(DE0DS0))+(IR1+2×(DE1DS1))\large \begin{align} \nonumber AI_{pre-AGPA} = \Big(IR_1 \times (DE_0 - DS_0)\Big) + \Big(IR_{1+2} \times (DE_1 - DS_1)\Big) \end{align}

Example 1: Call before domainEnd

In this example, the payment is made before the domainEnd, so no payments are removed from the sorted list.

AIpostAGPA=AIpreAGPA+(IR1+2+3×(tpaymentDS2))\large \begin{align} \nonumber AI_{post-AGPA} = AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (t_{payment} - DS_2)\Big) \end{align}
AGPA 1

Example 2: Call after domainEnd, before Loan 2 Payment Due Date

In this example, the payment is made after the domainEnd, so Loan 1 is removed from the sorted list and domainEnd is updated.

AIpostAGPA=AIpreAGPA+(IR1+2+3×(DE2DS2))+(IR2+3×(tpaymentDS3))\large \begin{align} \nonumber AI_{post-AGPA} = AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (DE_2 - DS_2)\Big) + \Big(IR_{2+3} \times (t_{payment} - DS_3)\Big) \end{align}
AGPA 2

Example 3: Call after domainEnd, before Loan 3 Payment Due Date

In this example, the payment is made after the domainEnd and Loan 2's payment due date, so Loans 1 and 2 are removed from the sorted list and domainEnd is updated.

AIpostAGPA=AIpreAGPA+(IR1+2+3×(DE2DS2))+(IR2+3×(DE3DS3))+(IR3×(tpaymentDS4))\large \begin{align} \nonumber AI_{post-AGPA} = &AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (DE_2 - DS_2)\Big) + \\ &\Big(IR_{2+3} \times (DE_3 - DS_3)\Big) + \Big(IR_{3} \times (t_{payment} - DS_4)\Big) \end{align}
AGPA 3

Example 4: Call after domainEnd, after Loan 3 Payment Due Date

In this example, the payment is made after the domainEnd, Loan 2, and Loan 3's payment due dates, so Loans 1, 2 and 3 are removed from the sorted list and domainEnd is updated.

AIpostAGPA=AIpreAGPA+(IR1+2+3×(DE2DS2))+(IR2+3×(DE3DS3))+(IR3×(DE4DS4))+(0×(tpaymentDS5))\begin{align} \nonumber AI_{post-AGPA} = &AI_{pre-AGPA} + \Big(IR_{1+2+3} \times (DE_2 - DS_2)\Big) + \Big(IR_{2+3} \times (DE_3 - DS_3)\Big) + \\ &\Big(IR_{3} \times (DE_4 - DS_4)\Big) + \Big(0 \times (t_{payment} - DS_5)\Big) \end{align}
AGPA 4

Last updated