LoanManager
Inherits: ILoanManager, IERC721Receiver, LoanManagerStorage, ReentrancyGuard, VersionedInitializable
State Variables
LOAN_MANAGER_REVISION
HUNDRED_PERCENT
SCALED_ONE
PRECISION
ADDRESSES_PROVIDER
Functions
constructor
initialize
Initializes the Loan Manager.
Function is invoked by the proxy contract when the Loan Manager Contract is added to the PoolAddressesProvider of the market
Parameters
Name | Type | Description |
---|---|---|
|
| The address of the PoolAddressesProvider |
whenNotPaused
Can only be called when the function is not paused
onlyPoolAdminOrGovernor
Can only be called by the Pool Admin or the Governor
onlyPoolAdmin
Can only be called by the Pool Admin
getRevision
Returns the revision number of the contract
Needs to be defined in the inherited class as a constant.
Returns
Name | Type | Description |
---|---|---|
|
| The revision number |
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 amounf 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 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 interest due for the loan |
onERC721Received
updateAccounting
Manually updates the accounting state of the pool
approveLoan
Approves loan to be created with the following terms.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| Token ID of the receivable that would be used as collateral |
|
| Grace period for the loan |
|
| Amount of principal approved by the buyer |
|
| Rates parameters: [0]: interestRate, [1]: lateInterestPremiumRate, |
Returns
Name | Type | Description |
---|---|---|
|
| Id of the loan that is created |
fundLoan
Funds the loan
Parameters
Name | Type | Description |
---|---|---|
|
| The id of the loan |
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
Withdraw the funds from a loan.
Parameters
Name | Type | Description |
---|---|---|
|
| Id of the loan to withdraw funds from |
|
| The destination address for the funds |
|
| The amount to withdraw |
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 |
_getIssuance
_getInterestBreakdown
_getInterest
_getLateInterest
_getPeriodicInterestRate
_poolConfigurator
_globals
_governor
_poolAdmin
_pool
_vault
_updateInterestAccounting
_updateUnrealizedLosses
_updatePrincipalOut
_clearLoanAccounting
_advanceGlobalPaymentAccounting
_updateIssuanceParams
_compareAndSubtractAccountedInterest
_getAccruedAmount
_getDefaultInterestAndFees
_getInterestAndFeesFromLiquidationInfo
_getNetInterest
_getPaymentAccruedInterest
_accountToEndOfPayment
_deletePayment
_handlePaymentAccounting
_queuePayment
_reverseLoanImpairment
_addPaymentToList
_removePaymentFromList
_distributeClaimedFunds
_handleDefault
_revertIfPaused
_revertIfNotPoolAdminOrGovernor
_revertIfNotPoolAdmin
_revertIfCallerNotReceivableBuyer
_revertIfInvalidReceivable
_min
Last updated