Pool Interactions
Overview
The Riskify protocol supports various types of pool interactions, enabling risk transfer and management across different pool types. This document details how different pool types interact and the mechanisms for risk propagation.
Pool Type Matrix
From/To | Structured | Cross | Passive Structured | Passive Cross |
---|---|---|---|---|
Structured | ✓ | ✓ | ✓ | ✓ |
Cross | ✓ | ✓ | ✓ | ✓ |
Passive Structured | ✗ | ✗ | ✓ | ✓ |
Passive Cross | ✗ | ✗ | ✓ | ✓ |
Interaction Types
1. Direct Risk Transfer
function _handleDirectPropagation(
uint256 sourcePoolId,
uint256 targetPoolId,
uint256 amount
) internal
Direct risk transfer between pools with compatible risk profiles and sufficient capacity.
2. Bundled Risk Transfer
function _handleBundlePropagation(
uint256 sourcePoolId,
uint256 targetPoolId,
uint256 amount,
bytes memory data
) internal
Transfer of bundled risk positions with optimization for diversification and yield.
3. Cross-Chain Risk Transfer
function _handleCrossChainPropagation(
uint256 sourcePoolId,
uint256 targetPoolId,
uint256 amount,
bytes memory data
) internal
Risk transfer across different blockchain networks with validation and proof verification.
Pool-Specific Handling
Structured Pool Interactions
As Source
function _handleStructuredPoolSource(
address sourcePool,
address targetPool,
uint256 amount,
uint256 collateralAmount
) internal
- Validates tranche capacity
- Manages risk transfer from tranches
- Ensures collateral requirements
As Target
function _handleStructuredPoolTarget(
address targetPool,
uint256 sourcePoolId,
uint256 amount,
uint256 collateralAmount
) internal
- Calculates optimal tranche allocation
- Manages risk acceptance across tranches
- Updates tranche metrics
Cross Pool Interactions
As Source
function _handleCrossPoolSource(
address sourcePool,
address targetPool,
uint256 amount,
uint256 collateralAmount
) internal
- Validates cross-pool limits
- Creates cross-pool positions
- Manages correlation constraints
As Target
function _handleCrossPoolTarget(
address targetPool,
uint256 sourcePoolId,
uint256 amount,
uint256 collateralAmount
) internal
- Validates acceptance criteria
- Manages cross-pool risk acceptance
- Updates network metrics
Risk Calculation
Tranche Allocation
function _calculateTrancheAllocations(
IStructuredPool.TrancheMetrics[] memory metrics,
uint256 amount
) internal pure returns (uint256[] memory)
Optimizes risk allocation across tranches based on:
- Current utilization
- Risk capacity
- Target yield
Network Risk
function _calculateSystemicRisk(
uint256 tokenId
) internal view returns (uint256)
Calculates systemic risk based on:
- Pool correlations
- Network connectivity
- Risk concentration
Validation and Safety
Pool Compatibility
- Type compatibility checks
- Capacity validation
- Risk limit verification
- Correlation constraints
Risk Limits
- Maximum concentration: 80%
- Maximum correlation: 70%
- Minimum collateral ratio: 10%
- Maximum leverage: 20x
Events
Risk Propagation Events
event RiskPropagated(
uint256 indexed sourcePoolId,
uint256 indexed targetPoolId,
uint256 amount,
uint256 collateralAmount,
IPoolBase.PoolType sourceType,
IPoolBase.PoolType targetType,
bool isAutomatic,
ParticipationReason reason,
PropagationType propagationType,
IBaseRiskToken.RiskTokenType tokenType
);
Bundle Events
event BundlePropagated(
bytes32 indexed bundleId,
uint256 indexed sourcePoolId,
uint256 indexed targetPoolId,
uint256[] tokenIds,
uint256[] amounts,
PropagationType propagationType
);
Error Handling
Common Error Cases
- Insufficient capacity
- Incompatible pool types
- Exceeded risk limits
- Invalid collateral ratio
- Failed validation
Error Resolution
- Retry with reduced amount
- Use bundle propagation
- Rebalance pools
- Adjust risk parameters
- Update validation criteria
Best Practices
Risk Assessment
- Always validate pool compatibility
- Check risk metrics before transfer
- Monitor network effects
Optimization
- Use bundle propagation for large transfers
- Optimize tranche allocation
- Balance network exposure
Monitoring
- Track risk metrics
- Monitor pool utilization
- Watch correlation levels
Safety
- Implement circuit breakers
- Use gradual risk transfer
- Maintain collateral buffers
Navigation
← Back to Pool Types | Pool Types |