# SignatureRedeemQueue

### Purpose

`SignatureRedeemQueue` extends `SignatureQueue` to enable **instant share redemption** from a vault without the usual delay of on-chain oracle processing. It leverages **off-chain consensus signatures** conforming to EIP-712 or EIP-1271 to authorize redemptions, allowing trusted users to convert shares to assets in a fast and secure manner.

This module provides a **low-latency redemption path** under stronger trust assumptions, useful in environments where responsiveness is critical and participants are whitelisted by a governance consensus.

### Key Features

* Off-chain authorized redemptions using signed `Order` messages
* Oracle-bound price validation to prevent manipulation
* EIP-712 structured data signature verification
* Direct burning of shares and asset pulling from the vault and payout
* Nonce-based replay protection
* Vault hook execution and balance tracking
* **No redeem fee** applied (unlike possible fees in `RedeemQueue`)

### Function: `redeem`

```solidity
function redeem(Order calldata order, IConsensus.Signature[] calldata signatures) external payable nonReentrant
```

### Parameters:

* `order`: A signed redemption `Order` struct specifying asset amount and recipient
* `signatures`: Validator signatures from the consensus group

### Workflow

1. **Validation** via `validateOrder(...)`:
   * Signature freshness (`deadline`)
   * Queue and asset correctness
   * Caller authenticity and correct nonce
   * Signatures validated by registered `Consensus` contract
   * Price computed from `ordered` and `requested` values and verified via oracle
2. **Nonce incremented** for the caller to prevent signature reuse
3. **Vault liquid asset check**:
   * Ensures enough liquidity is available for the redemption
   * Reverts with `InsufficientAssets` if funds are lacking
4. **Redemption Processing**:
   * Burns `order.ordered` shares from the user via `shareManager`
   * Calls `vault.callHook(...)` for any strategy exit logic
   * Transfers `order.requested` assets to the user
   * Updates internal vault balance via the `RiskManager`
5. **Event Emitted**:
   * `OrderExecuted(order, signatures)` confirms successful execution

### Error: `InsufficientAssets`

```solidity
error InsufficientAssets(uint256 requested, uint256 available);
```

Thrown when the vault does not have enough liquid assets to fulfill the request. Ensures safety during instantaneous exits.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mellow.finance/core-vaults/architecture/queues/signatureredeemqueue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
