Core Concepts
Key Terminology
Assets
Collateral Asset: Crypto assets that can be deposited as collateral (ETH, LINK)
Debt Asset: Stablecoins that can be borrowed (EURC, EURI)
Underlying Asset: The original asset before tokenization
Tokenized Asset: Wrapped representation of deposits/debts
Tokens
ColToken: Represents collateral deposits (colETH, colLINK)
DebtToken: Represents borrowed amounts (debtEUR)
ColEUR: ERC4626 vault token for EUR stablecoin deposits
Financial Metrics
LTV (Loan-to-Value): Maximum borrowing power as percentage of collateral value
Liquidation Threshold: Health factor threshold below which liquidation occurs
Health Factor: Measure of position safety (collateral value × threshold / debt value)
Liquidation Bonus: Discount liquidators receive on seized collateral
Core Mechanics
1. Collateral Supply
When users supply collateral assets:
Process:
User transfers asset to the protocol
Asset is forwarded to the appropriate vault
Vault stakes the asset across LST protocols
User receives colToken representing their deposit
User can now borrow against this collateral
For ETH:
Asset goes to VaultETH
Automatically distributed across Lido, RocketPool, EtherFi, Morpho
User receives colETH tokens
For LINK:
Asset goes to VaultLINK
Automatically stakes via StakeLink
User receives colLINK tokens
2. EUR Stablecoin Supply
Users can also supply EUR stablecoins to earn lending interest:
Process:
User transfers EURC to the protocol
EURC is deposited into ColEUR vault (ERC4626)
User receives ColEUR shares representing their deposit
User earns interest from borrowers
3. Borrowing
Users borrow EUR stablecoins against their collateral:
Process:
Protocol checks user's available borrowing capacity
Mints debtEUR tokens to track the debt
Transfers EURC from ColEUR vault to user
User's health factor is updated
4. Repayment
Users repay their loans to unlock collateral:
Process:
User transfers EURC to ColEUR vault
Protocol burns corresponding debtEUR tokens
User's debt balance decreases
Borrowing capacity increases
5. Withdrawal
Users can withdraw their collateral (subject to utilization):
Process:
Protocol checks user's health factor remains > 1
Burns user's colToken
Unstakes assets from LST protocols via vault
Transfers unstaked assets to user
Mathematical Formulas
Health Factor Calculation
Where:
Collateral Value: Sum of all collateral in USD
Liquidation Threshold: Weighted average threshold across all collateral
Debt Value: Sum of all debt in USD
Example:
User has $10,000 ETH collateral (85% liquidation threshold)
User has $7,000 EURC debt
Health Factor = ($10,000 × 0.85) / $7,000 = 1.21
Available Borrowing Capacity
Example:
User has $10,000 ETH collateral (80% LTV)
User has $5,000 current debt
Available Borrow = ($10,000 × 0.80) - $5,000 = $3,000
Liquidation Calculation
Example:
User has $8,000 EURC debt (Health Factor = 0.9)
Liquidator repays $4,000 EURC (50% max)
ETH liquidation bonus = 5%
Collateral Seized = ($4,000 × 1.05) / ETH_Price
Weighted Average Calculations
For users with multiple collateral types:
Asset Configurations
Collateral Configuration
Each collateral asset has the following parameters:
Example ETH Configuration:
LTV: 80% (8000 bps)
Liquidation Threshold: 85% (8500 bps)
Liquidation Bonus: 5% (10500 bps, meaning 105%)
Reserve Factor: 10% (1000 bps)
Debt Configuration
Each debt asset has the following parameters:
State Management
User Account Data
The protocol tracks comprehensive user data:
Asset States
Assets can be in different states:
Active: Normal operations allowed
Frozen: Can withdraw/repay but not supply/borrow
Paused: No operations allowed (emergency only)
Price Oracle Integration
Chainlink Integration
The protocol uses Chainlink oracles for all price data:
Price Format:
All prices returned in USD with 8 decimals (Chainlink standard)
ETH/USD: e.g., 300000000000 (=$3,000.00)
EURC/USD: e.g., 108000000 (=$1.08)
Price Calculations
When calculating values, the protocol accounts for token decimals:
Example:
2 ETH (18 decimals) at $3,000
Value = (2 × 10^18 × 3000 × 10^8) / 10^18 = $6,000 × 10^8
Security Considerations
Reentrancy Protection
All external functions use
nonReentrantmodifierState changes before external calls
Access Control
Role-based permissions for administrative functions
Multi-signature requirements for critical operations
Oracle Security
Chainlink price feeds for reliable data
Circuit breakers for extreme price movements
Multiple oracle sources where possible
Liquidation Safety
Maximum 50% liquidation per transaction
Health factor checks prevent over-liquidation
Liquidation bonuses incentivize quick liquidations
Constants and Limits
System Constants
Decimal Handling
Different assets have different decimals:
ETH: 18 decimals
LINK: 18 decimals
EURC: 6 decimals
Prices: 8 decimals (Chainlink standard)
Health Factor: 18 decimals
All calculations account for these differences to ensure precision.
Gas Optimization
Batch Operations
Multiple LST protocols called in single transaction
Efficient storage packing in structs
Minimal external calls
Storage Efficiency
Packed structs to minimize storage slots
EnumerableSet for asset lists
Upgradeable storage patterns
This foundation enables all higher-level protocol features including lending, borrowing, staking integration, and liquidations.
Last updated