AVS

Interface

IAlephAVS

interface IAlephAVS is IAVSRegistrar {
    // View functions
    function erc20Factory() external view returns (IERC20Factory);
    function vaultToSlashedStrategy(address vault) external view returns (IStrategy);
    function vaultToOriginalStrategy(address vault) external view returns (IStrategy);
    
    // Vault initialization (owner only)
    function initializeVault(
        uint8 _classId,
        address _vault,
        IStrategy _lstStrategy
    ) external returns (IStrategy slashedStrategy);
    
    // Allocation (operators only)
    function allocate(
        address _alephVault, 
        IAlephVaultDeposit.RequestDepositParams calldata _requestDepositParams
    ) external;
    
    // Unallocation - Step 1: Request (any token holder)
    function requestUnallocate(
        address _alephVault,
        uint256 _tokenAmount
    ) external returns (uint48 batchId, uint256 estAmountToRedeem);
    
    // Unallocation - Step 2: Complete (any token holder)
    function completeUnallocate(
        address _alephVault,
        uint256 _strategyDepositExpiry,
        bytes calldata _strategyDepositSignature
    ) external returns (uint256 amount, uint256 shares);
    
    // View helpers for unallocation
    function calculateUnallocateAmount(
        address _alephVault, 
        uint256 _tokenAmount
    ) external view returns (uint256 estimatedAmount, IStrategy strategy, IERC20 token);
    
    function getPendingUnallocateStatus(
        address _user,
        address _alephVault
    ) external view returns (
        uint256 userPendingAmount,
        uint256 totalPendingAmount,
        uint256 redeemableAmount,
        bool canComplete
    );
    
    function calculateCompleteUnallocateAmount(
        address _user,
        address _alephVault
    ) external view returns (uint256 expectedAmount);
}

Storage Layout (ERC-7201)

Operator Sets

The AVS maintains one operator set for organizing strategies:

Set ID
Name
Purpose

0

LST_STRATEGIES_OPERATOR_SET

Original LST strategies

The operator set is configured as a redistributing operator set, meaning slashed amounts are sent to the AVS contract rather than being burned.

Functions

initializeVault

Initializes a vault by creating its slashed token and strategy.

Parameters:

  • _classId: The share class ID for the vault

  • _vault: The vault address to initialize

  • _lstStrategy: The original LST strategy for the vault's underlying token

Returns:

  • slashedStrategy: The created slashed strategy address

Events:

allocate

Allocates delegated stake to a vault by slashing, depositing, and creating rewards.

Parameters:

  • _alephVault: Target vault address

  • _requestDepositParams: Deposit parameters including classId, amount, and auth signature

Events:

requestUnallocate

First step of the two-step unallocation process. Requests to redeem slashed tokens from a vault.

Parameters:

  • _alephVault: Vault to unallocate from

  • _tokenAmount: Amount of slashed strategy tokens to burn

Returns:

  • batchId: The batch ID for the redeem request

  • estAmountToRedeem: The estimated amount that will be redeemed from the vault

Events:

Use Case: This is the first step. After calling this, the user must wait for the vault to process the redemption request before calling completeUnallocate.

completeUnallocate

Second step of the two-step unallocation process. Completes the unallocation by withdrawing redeemable amount and depositing back to strategy.

Parameters:

  • _alephVault: Vault to complete unallocation from

  • _strategyDepositExpiry: Signature expiry timestamp

  • _strategyDepositSignature: EIP-712 signature for strategy deposit

Returns:

  • amount: The amount of tokens redeemed from the vault and deposited to the strategy

  • shares: The shares received in the original LST strategy

Events:

Use Case: Call after requestUnallocate once the vault has redeemable amount available. Use getPendingUnallocateStatus() to check if this can be called.

calculateUnallocateAmount

View function to estimate redemption amounts for the first step.

Use Case: Call before requestUnallocate to determine the estimated amount that will be redeemed.

getPendingUnallocateStatus

View function to check pending unallocation status.

Use Case: Check if completeUnallocate can be called. Returns canComplete = true if the user has pending amount and the vault has redeemable amount.

calculateCompleteUnallocateAmount

View function to calculate the expected amount for completeUnallocate.

Use Case: Call before completeUnallocate to get the exact expected amount for signature generation. This ensures the signature matches the amount that will be deposited.

Libraries

AlephSlashing

Handles redistribution calculations and execution.

AlephVaultManagement

Handles vault interactions.

RewardsManagement

Handles reward submissions.

Events Reference

Last updated

Was this helpful?