ILendingPool
ILendingPool
This interface defines LendingPool events, structs, and LoanDesk function hooks.
LoanDeskSet
Setter event
TreasurySet
Setter event
ProtocolRevenue
Event for when the protocol revenue is issued
LoanDefaulted
Event for when a loan is defaulted
OfferLiquidityAllocated
Event for when a liquidity is allocated for a loan offer
OfferLiquidityDeallocated
Event for when the liquidity is removed from a loan offer
LoanRepaymentProcessed
Event for when a loan repayments are made
onOfferAllocate
Hook for a new loan offer. Caller must be the LoanDesk.
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to be allocated for loan offers. |
onOfferDeallocate
Hook for a loan offer amount update. Caller must be the LoanDesk.
Name | Type | Description |
---|---|---|
amount | uint256 | Previously allocated amount being returned. |
onRepay
_Hook for repayments. Caller must be the LoanDesk.
Name | Type | Description |
---|---|---|
loanId | uint256 | ID of the loan which has just been borrowed |
borrower | address | Borrower address |
payer | address | Actual payer address |
transferAmount | uint256 | Amount chargeable |
interestPayable | uint256 | Amount of interest paid, this value is already included in the payment amount |
borrowedTime | uint256 | Block timestamp when this loan was borrowed |
onDefault
Hook for defaulting a loan. Caller must be the LoanDesk. Defaulting a loan will cover the loss using the staked funds. If these funds are not sufficient, the lenders will share the loss.
Name | Type | Description |
---|---|---|
loanId | uint256 | ID of the loan to default |
principalLoss | uint256 | Unpaid principal amount to resolve |
yieldLoss | uint256 | Unpaid yield amount to resolve |
canOffer
View indicating whether or not a given loan can be offered by the staker.
Hook for checking if the lending pool can provide liquidity for the total offered loans amount.
Name | Type | Description |
---|---|---|
amount | uint256 | Amount to check for new loan allocation |
Name | Type | Description |
---|---|---|
[0] | bool | True if the pool has sufficient lending liquidity, false otherwise |
Last updated