Identification of Function
This section defines the core functions within the Web3 Lending Protocol and describes the roles they play in the protocol. Identifying these functions forms the foundation for threat modeling and risk assessment, focusing on the security implications of each feature.
Deposit
The deposit function allows users to supply assets to the lending protocol, earning interest or rewards in return. This function is foundational to liquidity provision and forms the basis for other lending and borrowing operations within the protocol.
Withdraw
The withdraw function enables users to retrieve their deposited assets, including any accumulated interest. This function ensures liquidity remains accessible to depositors while maintaining protocol solvency.
Borrow
The borrow function allows users to take loans by using their deposited assets as collateral. Borrowing introduces risk to the protocol, as collateralization ratios must be managed to prevent under-collateralized positions.
Repay
The repay function lets users return borrowed funds to the protocol, closing out their debt. Repayment impacts protocol liquidity and risk exposure, as it affects the amount of assets available for other borrowers.
Liquidation
The liquidation function enables the protocol to secure assets when borrowers’ collateral falls below required thresholds. This function is critical in mitigating risks associated with under-collateralized loans and maintaining protocol stability.
Interest Model
The interest model determines the rates at which users earn on deposits and pay on borrowings. It often adjusts dynamically based on supply and demand, impacting user incentives and overall protocol liquidity.
Oracle Data
Oracle data provides external pricing information for assets within the protocol. Accurate and timely oracle data is essential for maintaining fair collateral valuations and preventing price manipulation vulnerabilities.
Protocol Management
Protocol management encompasses the administrative functions that control parameters, deploy upgrades, and oversee protocol governance. This function is critical for maintaining security, adaptability, and compliance with community or governance standards.
User State
User state tracks individual user actions, balances, collateral, and debt positions. It ensures accurate record-keeping for user accounts and underpins the security of each user’s assets and liabilities within the protocol.
Protocol State
Protocol state maintains global variables such as total liquidity, outstanding debt, and interest rates. It serves as a snapshot of the protocol's overall health and is central to risk assessment and management, impacting the protocol’s ability to respond to market changes.
Last updated