> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gauntlet.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# MultiDepositorVault

> Multi-depositor vault with order solving, tokenized vault units, and price reporting

## Overview

`MultiDepositorVault` extends [BaseVault](/contract-reference/base-vault) to support multiple depositors with tokenized ERC-20 vault units. Depositors interact with the vault through the [Provisioner](/contract-reference/provisioner) contract, which manages minting, redeeming, and async order fulfillment. The vault itself holds assets and executes guardian operations, while the Provisioner handles the depositor-facing interface.

Multi-depositor vaults use a more complex guardian model than single-depositor vaults. The guardian submits operations through the standard `submit` function inherited from `BaseVault`, but the vault also integrates with a `PriceAndFeeCalculator` for unit-based pricing and fee calculation. Price reporting uses managed accountant snapshots to prevent fee manipulation.

Transfer hooks (`IBeforeTransferHook`) can be configured on the vault's ERC-20 units to enforce compliance, blocklists, or transfer restrictions. See [Hooks](/contract-reference/hooks) for hook interface details.

## Functions

### totalAssets

Returns the total value of assets held by the vault, denominated in the vault's unit of account. Used for share price calculations.

**Signature:**

```solidity theme={null}
function totalAssets() external view returns (uint256)
```

### convertToShares

Converts an asset amount to the equivalent number of vault shares at the current exchange rate.

**Signature:**

```solidity theme={null}
function convertToShares(uint256 assets) external view returns (uint256 shares)
```

| Parameter | Type      | Description                 |
| --------- | --------- | --------------------------- |
| `assets`  | `uint256` | Amount of assets to convert |

### convertToAssets

Converts a share amount to the equivalent number of assets at the current exchange rate.

**Signature:**

```solidity theme={null}
function convertToAssets(uint256 shares) external view returns (uint256 assets)
```

| Parameter | Type      | Description                 |
| --------- | --------- | --------------------------- |
| `shares`  | `uint256` | Amount of shares to convert |

### balanceOf

Returns the vault unit balance for a given address.

**Signature:**

```solidity theme={null}
function balanceOf(address account) external view returns (uint256)
```

| Parameter | Type      | Description      |
| --------- | --------- | ---------------- |
| `account` | `address` | Address to query |

### totalSupply

Returns the total supply of vault units.

**Signature:**

```solidity theme={null}
function totalSupply() external view returns (uint256)
```

### transfer

Transfers vault units between addresses. Transfer hooks fire before the transfer if configured.

**Signature:**

```solidity theme={null}
function transfer(address to, uint256 amount) external returns (bool)
```

| Parameter | Type      | Description                       |
| --------- | --------- | --------------------------------- |
| `to`      | `address` | Recipient address                 |
| `amount`  | `uint256` | Number of vault units to transfer |

### setTransferHook

Sets the before-transfer hook contract for vault unit transfers. Only callable by the vault owner.

**Signature:**

```solidity theme={null}
function setTransferHook(address hook) external
```

| Parameter | Type      | Description                                 |
| --------- | --------- | ------------------------------------------- |
| `hook`    | `address` | Contract implementing `IBeforeTransferHook` |

### setPriceCalculator

Sets the price and fee calculator contract. Only callable by the vault owner.

**Signature:**

```solidity theme={null}
function setPriceCalculator(address calculator) external
```

| Parameter    | Type      | Description                                     |
| ------------ | --------- | ----------------------------------------------- |
| `calculator` | `address` | Address of the `PriceAndFeeCalculator` contract |

## Events

### Transfer

Standard ERC-20 transfer event for vault units.

```solidity theme={null}
event Transfer(address indexed from, address indexed to, uint256 value)
```

### TransferHookSet

Emitted when the transfer hook is configured.

```solidity theme={null}
event TransferHookSet(address indexed hook)
```

### PriceCalculatorSet

Emitted when the price calculator is configured.

```solidity theme={null}
event PriceCalculatorSet(address indexed calculator)
```

## Errors

### MultiDepositorVault\_\_TransferHookFailed

Thrown when the before-transfer hook reverts during a vault unit transfer.

```solidity theme={null}
error MultiDepositorVault__TransferHookFailed()
```

### MultiDepositorVault\_\_InsufficientBalance

Thrown when a transfer or redemption exceeds the sender's vault unit balance.

```solidity theme={null}
error MultiDepositorVault__InsufficientBalance()
```

## Inheritance

* [BaseVault](/contract-reference/base-vault) -- Core guardian operations, Merkle verification, hooks, pause
  * **MultiDepositorVault** -- Adds multi-depositor ERC-20 units, pricing, transfer hooks

<Info>
  This page was manually created as a baseline. Run the [contract reference generation pipeline](/contract-reference/overview#generation-pipeline) to update with complete NatSpec documentation from the Solidity source.
</Info>
