# Max Deposit Limits

### Maximum Deposit Limits

Maximum deposit limits protect Nodes from excessive capital inflows that could impact strategy execution. Each Node enforces a configurable maximum deposit size that applies to all depositors, and automatically prevents deposits when pricing data is stale. This ensures fair and accurate pricing for depositors and incentivizes rebalancers to rebalance the Node in order to accept deposits.

#### Default Setting

In Node.sol, set during initialization:

```solidity
maxDepositSize = 10_000_000 * 10 ** decimals();  // 10M units
```

#### Configuration

Node owner can update:

```solidity
function setMaxDepositSize(uint256 newMaxDepositSize) external onlyOwner {
    if (newMaxDepositSize > 1e36) revert ErrorsLib.ExceedsMaxDepositLimit();
    maxDepositSize = newMaxDepositSize;
    emit EventsLib.MaxDepositSizeSet(newMaxDepositSize);
}
```

#### Implementation

Deposit limits are enforced through ERC4626 max functions:

```solidity
function maxDeposit(address /* controller */ ) public view returns (uint256 maxAssets) {
    return isCacheValid() ? maxDepositSize : 0;
}

function maxMint(address /* controller */ ) public view returns (uint256 maxShares) {
    return isCacheValid() ? convertToShares(maxDepositSize) : 0;
}
```

Key behaviors:

* Returns 0 if cache is invalid (prevents deposits with stale pricing)
* Cache validity checked via:

  ```solidity
  function isCacheValid() public view returns (bool) {
      return (block.timestamp < lastRebalance + rebalanceWindow + rebalanceCooldown);
  }
  ```
* Deposit and mint functions revert if amount exceeds max
* Applied uniformly to all depositors
* No minimum deposit size enforced


---

# 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://nashpoint.gitbook.io/nashpoint/managing-a-node/max-deposit-limits.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.
