> For the complete documentation index, see [llms.txt](https://promethium.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://promethium.gitbook.io/docs/promethium-features/rebalancing.md).

# Rebalancing

The Promethium Rebalancer: A deep dive into automated portfolio optimization

#### 🔹 **The Rebalancer: An Overview**

The Rebalancer is Promethium's solution to the challenge of portfolio optimization. It operates around the clock, rebalancing deposits and refinancing loans in pursuit of the best rates, all while maintaining a conservative level of risk. This means your portfolio is always optimized for performance, saving you both time and effort.

#### 🔹 **How the Rebalancer Works**

The Rebalancer operates through a series of steps, each designed to ensure optimal portfolio performance. Here's a step-by-step breakdown of the process:

1. **Rate Retrieval:** The backend of the Rebalancer retrieves rates from various sources.
2. **Optimal Distribution Matrix Calculation:** The Rebalancer calculates the Optimal Distribution Matrix (ODM), a mathematical model that determines the optimal distribution of assets across different protocols.
3. **Matrix Transfer:** The ODM is transferred to the vaults, which are secure digital storage spaces for assets.
4. **Rebalancing:** The vaults rebalance the deposits according to the ODM.

This process is automated and continuous, ensuring that your portfolio is always optimized for the best possible returns.

#### 🔹 **Main Pool**

The Main Pool is the central hub of Promethium's Rebalancer. It aggregates the main pools of all supported lending protocols, effectively creating a large, diversified pool of assets. The Main Pool is designed to optimize returns by continuously rebalancing these assets based on the most favorable rates available across the integrated lending protocols.

The Main Pool's operation is guided by an Optimal Distribution Matrix (ODM), which is calculated by Promethium’s backend. The ODM determines the ideal distribution of assets across the various lending protocols to maximize returns while maintaining a conservative risk profile. This dynamic rebalancing ensures that the Main Pool is always optimized for the best possible performance.

#### 🔹 **Isolated Pools (coming soon)**

While the Main Pool covers a broad range of assets and lending protocols, Promethium's Rebalancer also includes Isolated Pools. These pools are designed to cater to specific markets or assets that are not included in the main pools of the supported lending protocols.

Isolated Pools can aggregate money markets or specific lending protocols that are not part of the Main Pool. This includes NFT-secured lending protocols and lending protocols with two-token pools. By offering these specialized pools, Promethium ensures that it can cater to a wide range of user needs and market conditions.

#### 🔹 **Risk Management**

Promethium's Rebalancer is designed with risk management in mind. It currently operates based on a [set of predefined rules and parameters](/docs/safety-framework.md), ensuring that your portfolio is not only optimized for returns but also for risk mitigation. However, Promethium has plans to incorporate a mathematical framework for assembling a portfolio of assets such that the expected return is maximized for a given level of risk.
