The claim
function in the LoanManager is called atomically after every payment that is made against Loans. The claim
function is designed to:
- Consolidate and update past accounting of outstanding interest for all Loans in the LoanManager.
- Handle accounting of the payment that was just made within the LoanManager.
- Disburse funds from the payment to the Pool, Pool Delegate, and MapleTreasury.
- Calculate the interest accrual parameters based on the next scheduled payment in the Loan.
- Update the global accounting formula in the LoanManager to start accruing interest into the future.
Below is a flowchart demonstrating how the claim function handles all of this logic.