eip | title | description | author | status | type | category | created | requires | ||
---|---|---|---|---|---|---|---|---|---|---|
XXXX |
DeFi Protocol Solvency Proof Mechanism |
A standardized interface for verifying and reporting DeFi protocol solvency status through smart contracts |
Sean Luis Guada Rodríguez (@SeanLuis) <[email protected]> |
Draft |
Standards Track |
ERC |
2025-01-30 |
|
A standardized interface that enables DeFi protocols to implement verifiable solvency proofs through smart contracts. The standard defines methods for reporting assets, liabilities, and financial metrics, enabling real-time verification of protocol solvency.
The DeFi ecosystem currently lacks standardization in financial health reporting, leading to:
- Inconsistent reporting methodologies across protocols
- Limited transparency in real-time financial status
- Absence of standardized early warning systems
- Complex and time-consuming audit processes
- Difficulty in assessing cross-protocol risks
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
flowchart TB
subgraph ApplicationLayer[Application Layer]
direction LR
D[Dashboards] --- A[Alerts] --- API[APIs]
end
subgraph ProtocolLayer[Protocol Layer]
direction LR
Assets[Assets] --- Solvency[Solvency] --- History[History]
end
subgraph DataLayer[Data Layer]
direction LR
Oracles[Oracles] --- Prices[Prices] --- Stats[Statistics]
end
ApplicationLayer --> ProtocolLayer
ProtocolLayer --> DataLayer
The standard defines a comprehensive interface for solvency verification. Key features include:
-
Asset and Liability Management
- Protocol assets tracking
- Protocol liabilities tracking
- Real-time value updates
-
Solvency Verification
- Ratio calculations
- Health factor monitoring
- Historical data tracking
-
Risk Alert System
- Threshold monitoring
- Event emissions
- Emergency notifications
For the complete interface specification, see ISolvencyProof.sol.
The solvency verification system is based on comprehensive mathematical models:
Where:
-
$TA = \sum(A_i × P_i)$ // Total Assets -
$TL = \sum(L_i × P_i)$ // Total Liabilities -
$A_i$ = Amount of asset i -
$P_i$ = Price of asset i -
$L_i$ = Liability i
Where:
-
$W_i$ = Risk weight of asset i$(0 < W_i \leq 1)$ -
$R_i$ = Risk factor for liability i$(R_i \geq 1)$
Where:
-
$\mu$ = Expected return -
$\sigma$ = Standard deviation -
$z(\alpha)$ = z-value for confidence level$\alpha$
Where:
- HQLA = High Quality Liquid Assets
- TNCO = Total Net Cash Outflows (30 days)
Where:
-
$w_1,w_2,w_3$ = Weighting factors -
$\sigma$ = System volatility
Where:
- DD = Distance to Default
- T = Time horizon
- N() = Standard normal distribution
The following thresholds have been validated through extensive testing:
Risk Level | Ratio Range | Action Required | Validation Status |
---|---|---|---|
CRITICAL | < 105% | Emergency Stop | ✅ Validated |
HIGH RISK | 105% - 110% | Risk Alert | ✅ Validated |
WARNING | 110% - 120% | Monitor | ✅ Validated |
HEALTHY | ≥ 120% | Normal | ✅ Validated |
Testing has confirmed that:
- The system correctly handles 50% market drops
- Ratios are calculated accurately in all scenarios
- State updates maintain consistency
- Ratio limits are effective for early detection
stateDiagram-v2
[*] --> Healthy: SR ≥ 120%
Healthy --> Warning: SR < 120%
Warning --> HighRisk: SR < 110%
HighRisk --> Critical: SR < 105%
Critical --> [*]: Emergency
Critical --> HighRisk: SR ≥ 105%
HighRisk --> Warning: SR ≥ 110%
Warning --> Healthy: SR ≥ 120%
The standard implements a multi-tiered risk assessment system:
-
Primary Metrics:
- Base Solvency Ratio (SR)
- Risk-Adjusted Health Factor (HF)
- Liquidity Coverage Ratio (LCR)
-
Threshold Levels:
flowchart LR H[Healthy] -->|"SR < 120%"| W[Warning] W -->|"SR < 110%"| R[High Risk] R -->|"SR < 105%"| C[Critical]
This standard intentionally leaves oracle implementation flexible. Protocols MAY implement price feeds in various ways:
-
Direct Integration
- Using existing oracle networks (Chainlink, API3, etc.)
- Custom price feed implementations
- Internal price calculations
-
Aggregation Strategies
- Multiple oracle sources
- TWAP implementations
- Medianized price feeds
flowchart LR
subgraph DataSources[Price Data Sources]
O[Oracle Networks]
P[Price Feeds]
end
subgraph Integration[Price Integration]
A[Aggregator]
end
O --> A
P --> A
A --> C[Contract]
-
Asset Management:
- Real-time asset tracking
- Price feed integration
- Historical data maintenance
-
Liability Tracking:
- Debt obligation monitoring
- Collateral requirement calculation
- Risk factor assessment
-
Reporting System:
- Event emission for significant changes
- Threshold breach notifications
- Historical data access
While not part of the core standard, implementations should consider including oracle management:
// Recommended but not required
event OracleUpdated(address indexed oracle, bool authorized);
function setOracle(address oracle, bool authorized) external;
This provides:
- Flexible price feed management
- Security controls
- Update authorization
The core standard focuses on solvency verification, leaving oracle management implementation details to individual protocols.
Based on conducted tests, it is recommended:
-
Liability Management:
- Maintain constant liabilities during price updates
- Validate that liabilities are never 0 to avoid division by zero
- Update liabilities only when actual positions change
-
Ratio Calculation:
function calculateRatio(uint256 assets, uint256 liabilities) pure returns (uint256) { if (liabilities == 0) { return assets > 0 ? RATIO_DECIMALS * 2 : RATIO_DECIMALS; } return (assets * RATIO_DECIMALS) / liabilities; }
-
State Validation:
- Verify values before updating
- Maintain accurate history
- Emit events for significant changes
-
Gas Considerations:
- Optimize history storage
- Batch updates for multiple tokens
- Limit array sizes in updates
The standard's design prioritizes:
- Reliability through multiple oracle support and robust calculations
- Efficiency via optimized data structures
- Flexibility through modular design
- Transparency via standardized metrics
This EIP is compatible with existing DeFi protocols and requires no changes to existing token standards.
Test cases are provided in the reference implementation demonstrating:
- Solvency ratio calculations
- Risk threshold monitoring
- Oracle integration
- Historical data tracking
A reference implementation is provided in SolvencyProof.sol.
Key security considerations include:
-
Oracle Security:
- Multiple price feed sources
- Manipulation resistance
- Fallback mechanisms
-
Access Control:
- Authorized updaters
- Rate limiting
-
Risk Management:
- Threshold calibration
- Alert system reliability
Copyright and related rights waived via CC0.