Skip to main content

LoanKernel

LoanKernel

Upload loan, Repay Loan and conclude loan

registry

contract Registry registry

initialize

function initialize(contract Registry _registry) public

validFillingOrderAddresses

modifier validFillingOrderAddresses(address[] _orderAddresses)

_concludeLoan

function _concludeLoan(address creditor, bytes32 agreementId) internal

This function concludes a loan agreement by burning the associated LoanAssetToken.

Parameters

NameTypeDescription
creditoraddressThe address of the borrower who owes the debt.
agreementIdbytes32A unique identifier for the loan agreement.

getLoansValue

function getLoansValue(struct ILoanKernel.FillDebtOrderParam fillDebtOrderParam) public view returns (uint256, uint256[][])

Calculates the value of loans based on provided parameters.

This function calculates the expected value of assets in a loan order, taking into account the terms and conditions of each loan. It also checks if the LAT token IDs match with the agreement IDs from the issuance data. The function returns two values: an overall expected asset value and an array of individual expected loan values for each LAT.

Parameters

NameTypeDescription
fillDebtOrderParamstruct ILoanKernel.FillDebtOrderParamStructure containing all necessary information to calculate the loans' value.

Return Values

NameTypeDescription
[0]uint256expectedAssetsValue Total expected value of assets in the loan order.
[1]uint256[][]expectedAssetValues Array of individual expected loan values for each LAT.

fillDebtOrder

function fillDebtOrder(struct ILoanKernel.FillDebtOrderParam fillDebtOrderParam) external

This function is used to fill a debt order. It mints loan assets and collects assets from the pool.

The function requires that the sender has the necessary permissions and that the parameters are valid.

Parameters

NameTypeDescription
fillDebtOrderParamstruct ILoanKernel.FillDebtOrderParamParameters for filling a debt order.

repayInBatch

function repayInBatch(bytes32[] agreementIds, uint256[] amounts, address tokenAddress) external returns (bool)

This function is used to repay a loan in batch. It checks all the loans must have the same owner and updates the pool's state accordingly.

The function requires that the sender has the necessary permissions, that the parameters are valid, and that the repayment request is successful.

Parameters

NameTypeDescription
agreementIdsbytes32[]Array of loan agreement IDs to be repaid.
amountsuint256[]Amounts to be repaid for each loan.
tokenAddressaddressAddress of the currency used for repayment.