ILoanManager
Inherits: ILoanManagerEvents, ILoanManagerStorage
Creates and manages loans.
Functions
initialize
Initializes the loan manager.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the asset used for the pool. |
getLoanInfo
Gets the loan info.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan. |
Returns
Name | Type | Description |
---|---|---|
|
| Struct that contains the info of the loan. |
accruedInterest
Gets the amount of interest up until this point in time.
Returns
Name | Type | Description |
---|---|---|
|
| The amount of accrued interest up until this point in time. |
assetsUnderManagement
Gets the total assets under management.
Returns
Name | Type | Description |
---|---|---|
|
| The total value of assets under management. |
getLoanPaymentDetailedBreakdown
Gets the detailed payment breakdown of a loan up until this point in time.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan. |
Returns
Name | Type | Description |
---|---|---|
|
| The principal due for the loan. |
|
| Interest Parameter: [0]: The interest due for the loan. [1]: The late interest due for the loan. |
getLoanPaymentBreakdown
Gets the payment breakdown of a loan up until this point in time.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan. |
Returns
Name | Type | Description |
---|---|---|
|
| The principal due for the loan. |
|
| The total interest due for the loan. |
updateAccounting
Manually updates the accounting state of the pool.
fundLoan
Used by the pool admin to fund the loan requested by the buyer.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan. |
impairLoan
Impairs the loan.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan. |
removeLoanImpairment
Removes the impairment on the loan.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan. |
triggerDefault
Triggers the default of a loan.
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan that is triggered. |
Returns
Name | Type | Description |
---|---|---|
|
| The amount of remaining losses. |
|
| The amount of protocol fees. |
requestLoan
Used by buyer to request a loan from the pool with the following terms.
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the receivableAsset |
|
| Token ID of the receivable that would be used as collateral. |
|
| Grace period of the loan. |
|
| Amount of principal requested by the buyer. |
|
| Rates parameters: [0]: interestRate. [1]: lateInterestPremiumRate. |
Returns
Name | Type | Description |
---|---|---|
|
| Id of the loan that is created. |
repayLoan
Repays the loan (note that the loan can be repaid early but not partially).
Parameters
Name | Type | Description |
---|---|---|
|
| Id of the loan to repay. |
Returns
Name | Type | Description |
---|---|---|
|
| Principal amount repaid. |
|
| Interest amount repaid. |
withdrawFunds
Used by sellers to withdraw funds from a loan.
Parameters
Name | Type | Description |
---|---|---|
|
| Id of the loan to withdraw funds from. |
|
| The destination address for the funds. |
Last updated