In the following sections we elaborate the PoolFactory.sol specification.
Pool Factory is used to create pools that allows a borrower to borrow from a group of lenders. Pool Factory stores the various global parameters to manage pools. Borrowers need to be verified to be able to create a pool.
- by deploying the contract
- gaining ownership from previous owner
- Can transfer ownership to another admin
- Can update logic contract implementation addresses
- Can update thresholds for parameters
- Users verified by one of the supported Verifiers
- Can call the createPool() to create new pools for loan requests
A verified user can create a lending pool to borrow from a group of lenders. The following function is used to create a pool.
msg.sendershould approve collateral tokens to the pool to be created, by pre-generating the pool address.
msg.sender: verified users only
msg.value: Only if
collateralTokenis address(0) (Ether) should be ==
- Note: All the parameters might be subject to range specified by admin. We threshold the following parameters:
These ranges have been defined purely to better manage risks, especially during the early stages. This thresholding can be removed at a later stage.
_poolSize: loan amount requested
_borrowRate: Interest rate per annum for borrowing. The interest rate fraction should be multiplied by
10**30. e.g. interest rate of 10% should be converted to
_borrowToken: Borrow Asset requested. If Ether, address(0) to be used
_collateralToken: Asset posted as collateral for the loan. If Ether, address(0) to be used
_collateralRatio: Limit on the ratio of collateral to the debt (principal + interest), which if falls below a threshold, results in liquidation (Refer to Broken link). The _collateralRatio should be multiplied by
_repaymentInterval: Interval in seconds after which 1 instalment of interest repayment for loan should be repaid
_noOfRepaymentIntervals: Number of instalments in which interest of loan will be repaid
_poolSavingsStrategy: Whitelisted strategy in which the collateral tokens should be invested in Savings Account
_collateralAmount: Amount of asset to be deposited as collateral for the loan
_transferFromSavingsAccount: Flag to determine if collateral will be added from the Savings Account or directly transferred from the borrower's wallet
_salt: random and unique initial seed used in pre-generation of the pool address
_verifier: Verifier that the borrower chooses to represent their identity for this pool. A modifer (
onlyBorrower()) is passed this parameter to check whether they've actually been verified by
_lenderVerifier: Verifier that lenders that wish to participate in the pool need to be verified by