# Managing Rebalancers

### Managing Rebalancers

Rebalancers must first be whitelisted at the protocol level before they can be added to individual Nodes.

#### Protocol Level

```solidity
// Protocol owner whitelists rebalancer
registry.setRegistryType(rebalancerAddress, RegistryType.REBALANCER, true);
```

#### Node Level

```solidity
// Add rebalancer to Node
function addRebalancer(address newRebalancer) external onlyOwner {
    if (isRebalancer[newRebalancer]) revert ErrorsLib.AlreadySet();
    if (!registry.isRegistryType(newRebalancer, RegistryType.REBALANCER)) {
        revert ErrorsLib.NotWhitelisted();
    }
    isRebalancer[newRebalancer] = true;
}

// Remove rebalancer from Node
function removeRebalancer(address oldRebalancer) external onlyOwner {
    if (!isRebalancer[oldRebalancer]) revert ErrorsLib.NotSet();
    isRebalancer[oldRebalancer] = false;
}
```

#### Constraints

* Only Node owner can add/remove rebalancers
* Cannot add zero address
* Cannot add already-set rebalancer
* Cannot add non-whitelisted rebalancer
* Cannot remove non-existent rebalancer

#### Important Notes

* A Node without any rebalancers cannot execute rebalances or fulfill redemptions
* Best practice: Maintain at least one active rebalancer at all times
* Removing all rebalancers will not affect existing positions but will prevent:
  * Starting new rebalances
  * Fulfilling redemption requests
  * Investing in or liquidating from components


---

# 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/managing-rebalancers.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.
