Purpose

The RedeemQueue contract enables delayed, batched redemptions of vault shares into underlying assets. Redemptions are processed in two phases:

  1. Oracle pricing – Shares are priced via a trusted price report.
  2. Liquidity settlement – Vault liquidity is allocated to fulfill priced requests.

This separation supports asynchronous liquidity management, gas efficiency, and protection against griefing.

Overview

The RedeemQueue enables users to convert their vault shares into underlying assets, introducing a time delay enforced by an oracle-defined redeemInterval. It maintains the following core invariants:

  1. Request Format: Each request is structured as a (shares, timestamp) pair.
  2. Non-Cancellable: Redemption requests cannot be cancelled to prevent griefing (e.g., submitting and canceling after unstaking starts).
  3. Multiple Requests Allowed: Users may submit multiple independent redemption requests.

Upon receiving an oracle report at reportTimestamp, the system processes all requests with:

timestamp <= reportTimestamp - redeemInterval

On the next step these vault shares are converted to assets at the price specified in the oracle report in this step.

Liquidity Processing (Two-Stage)

To enable flexible and asynchronous liquidity management, redemption is handled in two distinct phases:

  1. Post-Request:

    Vault curators monitor and, if needed, pull liquidity from external protocols.

  2. Post-Oracle Report:

Scalability Approach

Unlike deposits, redemption requests are never cancelled, which allows for a simplified and gas-efficient tracking model: A prefix sum array is used to efficiently manage cumulative share redemptions over time.

Redemption Processing Logic