Tulia Pool Functionalities
TuliaPool Functionalities
Overview The TuliaPool
contract serves as the central hub for managing various stages of loan operations, including creation, funding, activation, repayment, and handling defaults. It integrates essential components such as collateral management, interest calculations, and rewards distribution.
Key Components and Their Roles:
Loan Creation and Management
Loans are initiated by lenders and entail setting terms like the loan amount, interest rate, repayment token, and the duration for repayment.
The contract emits a
LoanOfferCreated
event upon the creation of a new loan, detailing the loan's specifics.
Loan Activation
A loan transitions from 'created' to 'active' when the borrower deposits sufficient collateral and the loan amount is disbursed.
The contract handles collateral through the
TuliaVault
, ensuring it's securely locked during the loan period.The
LoanActivated
event is emitted once the loan is active, indicating the collateral amount and marking the loan's commencement.
Funding the Loan
The lender funds the loan by transferring the agreed loan amount to the contract. This action moves the loan into a 'pending' state ready for activation.
Upon successful funding, a
LoanFunded
event is broadcasted.
Repayment and Interest Handling
Borrowers repay the loan according to the agreed terms. The contract calculates the total repayment amount, including interest, using an external
IInterestModel
.Repayment actions are tracked via the
RepaymentMade
event.
Default Management
The contract checks for defaults post-repayment due date. If a loan is defaulted, it handles the transfer of collateral to the lender and updates the loan state accordingly.
Default situations trigger a
LoanDefaulted
event.
Role-Based Access Control
Utilizes OpenZeppelin’s
AccessControl
to manage roles such as lenders and borrowers, enhancing security and compliance within the lending process.
Integrations with External Managers
Interfaces with
IPoolOrganizer
,IVaultManager
, andIRewardManager
to manage pool registrations, vault operations, and reward distributions, ensuring that all aspects of the loan lifecycle are managed cohesively.
Events for Lifecycle Tracking
The contract is designed to emit specific events at key points in the loan lifecycle, providing transparency and allowing participants to track the progress and state of loans effectively.
Last updated