Suilo is a comprehensive DeFi lending protocol built on Sui blockchain, designed to facilitate peer-to-peer lending and borrowing with robust risk management. The protocol operates through decentralized markets that pair debt tokens (like SUI) with collateral tokens, allowing flexible cross-asset lending.
Core Architecture
Multi-Module Design:
- Vault Module - Generic storage wrapper for managing coin balances (liquidity pools and collateral reserves)
- Interest Module - Sophisticated rate model using compounding indices to track debt growth over time
- Loan Module - Central market orchestrator handling deposits, borrows, repayments, and liquidations
- Admin Module - Capability-based system for creating and configuring markets
- Liquidation Module - Standalone interface for liquidating under-collateralized positions
Key Features
- Liquidity Provisioning
- Users deposit SUI (or other debt tokens) into liquidity pools
- Deposits earn passive interest as borrowers pay fees
- Users can withdraw liquidity anytime, subject to availability
- Collateralized Borrowing
- Users lock collateral tokens to borrow debt tokens
- Loan-to-Value (LTV) limits prevent over-leverage
- Example: 80% LTV means $100 collateral allows $80 borrowing
- Multiple positions per user supported
- Compound Interest Accrual
- Interest accrues continuously based on elapsed time
- Borrow index converts between debt shares and actual debt
- Interest rate configurable per market (basis points per year)
- Formula: debt = shares * (index / 1_000_000_000)
- Liquidation Mechanism
- Positions with debt exceeding LTV threshold are liquidatable
- Liquidators repay debt and receive collateral + bonus
- Liquidation bonus (e.g., 5%) incentivizes liquidators
- Prevents protocol insolvency from collateral price drops
- Admin Capabilities
- Markets created only with AdminCap (transferred to deployer)
- Configurable parameters: LTV, liquidation bonus, interest rate
- Upgrade capabilities for future protocol improvements
Technical Implementation
Sui-Specific Features:
- Uses Sui's object model for state management
- Share objects for immutable market configuration
- Table structures for user position tracking
- Clock integration for time-based interest accrual
- Efficient coin operations using Balance<T>
Safety Measures:
- Assertions prevent invalid amounts, insufficient liquidity, and over-borrowing
- Price oracle integration (external) for LTV calculations
- Separation of concerns between modules for maintainability