The RedeemQueue contract enables delayed, batched redemptions of vault shares into underlying assets. Redemptions are processed in two phases:
This separation supports asynchronous liquidity management, gas efficiency, and protection against griefing.
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:
(shares, timestamp) pair.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.
To enable flexible and asynchronous liquidity management, redemption is handled in two distinct phases:
Post-Request:
Vault curators monitor and, if needed, pull liquidity from external protocols.
Post-Oracle Report:
handleBatches(n) on the RedeemQueue,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.