State Management & Operations

State Management & Operations

Core State Structures

Vault State Structure

/// @notice A struct describing the status of an underlying vault
/// @dev Contains data about a vault's chain ID, share price, oracle, and more
struct VaultData {
    /// @dev The ID of the chain where the vault is deployed
    uint64 chainId;
    /// @dev The superform ID of the vault in the Superform protocol
    uint256 superformId;
    /// @dev The oracle that provides the share price for the vault
    ISharePriceOracle oracle;
    /// @dev The number of decimals used in the ERC4626 shares
    uint8 decimals;
    /// @dev The total assets invested in the vault
    uint128 totalDebt;
    /// @dev The address of the vault
    address vaultAddress;
}

Request States

Withdrawal Queue State

Request State Lifecycle

Request Configuration

Initial State → PendingRequest

PendingRequest → ClaimableRequest

ClaimableRequest → Completed

Cross-Chain State Management

Investment State Tracking

Withdrawal State Tracking

Direct Investment Flow

State Updates

Security Considerations

State Locks

State Validations

Critical Invariants

  1. Total Assets = Idle + Debt + Pending Investments

  2. Share Price Watermark ≤ Current Share Price

  3. Request Queue Ordering Must Be Maintained

  4. Receiver Contracts Must Be Unique Per Request

State Recovery

Last updated