The Pool contract is the core lending protocol contract that manages all lending and borrowing operations in the Zeur protocol. It handles two types of assets: collateral assets (ETH, LINK) and debt assets (EUR-based stablecoins). The contract implements a comprehensive lending system with liquid staking token (LST) integration, health factor-based risk management, and automated liquidation mechanisms.
Pool_CollateralFrozen/Paused: Emergency state active
Pool_HealthFactorNotLiquidatable: User not eligible for liquidation
Events
All major operations emit events for off-chain monitoring:
Supply, Withdraw, Borrow, Repay, Liquidate
InitCollateralAsset, InitDebtAsset
SetCollateralConfiguration, SetDebtConfiguration
Best Practices
For Users
Monitor health factor regularly
Maintain adequate collateralization
Understand liquidation risks
Consider market volatility in position sizing
For Integrators
Always check asset type before operations
Implement proper error handling
Monitor events for state changes
Respect emergency controls (freeze/pause)
For Administrators
Set conservative risk parameters initially
Monitor utilization rates and caps
Regular risk parameter reviews
Emergency response procedures
Technical Implementation Notes
Gas Optimization
Batch operations where possible
Efficient storage layout with packing
Minimal external calls per operation
Precision Handling
18-decimal precision for calculations
Proper decimal scaling for different assets
Safe math operations throughout
State Management
Atomic operations for consistency
Proper state updates before external calls
Event emission for all state changes
This documentation provides a comprehensive understanding of the Pool contract's functionality, security measures, and integration points. The contract serves as the foundation of the Zeur lending protocol, enabling secure and efficient lending and borrowing operations with integrated liquid staking capabilities.
struct UserAccountData {
uint256 totalCollateralValue; // Total collateral value in USD
uint256 totalDebtValue; // Total debt value in USD
uint256 availableBorrowsValue; // Available borrowing capacity
uint256 currentLiquidationThreshold; // Weighted avg liquidation threshold
uint256 ltv; // Current loan-to-value ratio
uint256 healthFactor; // Health factor (>1 = safe, <1 = liquidatable)
}