Rebasing Mechanism

Overview

CeDeFi V2 introduces an advanced rebasing mechanism that automatically reflects yield earnings in token balances, marking a significant improvement over V1. This implementation leverages the ERC-4626 tokenized vault standard to provide a more streamlined and efficient yield distribution system.

Key Features

  • Automatic Yield Reflection: Token balances automatically update to reflect earned yield

  • ERC-4626 Compliance: Implements the standardized tokenized vault interface

  • Flexible Position Management: Supports partial position modifications and seamless subscription/unsubscription

Technical Implementation

ERC-4626 Integration

The protocol implements the ERC-4626 standard, which provides a standardized interface for tokenized vaults. This offers several advantages:

interface IERC4626 is IERC20, IERC20Metadata {
    function asset() external view returns (address assetTokenAddress);
    function totalAssets() external view returns (uint256 totalManagedAssets);
    function convertToShares(uint256 assets) external view returns (uint256 shares);
    function convertToAssets(uint256 shares) external view returns (uint256 assets);
    // ... additional interface methods
}

Rebasing Mechanism

How It Works

  1. When yield is generated, it is automatically distributed proportionally to all token holders

  2. Token balances increase to reflect the earned yield

  3. The underlying asset-to-share ratio is continuously updated

Advantages Over V1

Feature
V1
V2

Yield Distribution

Manual claim required

Automatic reflection

Position Management

All-or-nothing withdrawals

Partial withdrawals supported

Standard Compliance

Custom implementation

ERC-4626 compliant

Integration Complexity

High

Low

Security Considerations

  • All rebasing calculations are performed atomically to prevent exploitation

  • Share-to-asset conversions include safety checks against slippage

  • Integrators should implement proper decimal handling for share calculations

Further Resources

Last updated