# Active Liquidity Manager

Concentrated liquidity positions require constant attention from depositors. If they want to keep earning fees and avoid their LP becoming ‘inactive’, they have to adjust constantly (i.e. rebalance) price ranges. This is especially true for those who choose to provide liquidity in tight or exotic ranges to capture maximum fees.

Even after that, deploying liquidity on CLMMs is hard. To do it effectively, users must consider multiple factors, such as the current price and expected volatility of both assets in a pair. In some cases, liquidity provision might seem like it is a full-time job with good knowledge of mathematics and finance. Research shows that many liquidity providers on Uniswap V3 lose money due to Impermanent Loss even when accounting for fees.&#x20;

Rivera is making CLMM market-making accessible for everyone, degens and institutions alike. Rivera ALM provides risk-managed vaults for investors to explore and deploy capital as per their appropriate risk appetite. Our built-in algorithmic modules supercharge LP strategies with active liquidity management and auto-compounding rewards. This gives a boost to the generated yield and enables a fully passive LPing experience for the investors.

**Range Rebalancer**

We have developed an algorithmic LP manager for CLMMs. This DeFi primitive helps users efficiently manage their positions and optimize their capital deployment. We allow users to configure their price range or set automation to maintain a specified lower and upper limit bound of the current price.&#x20;

Whenever the range is modified, we need to swap some tokens. This is because the deposited assets on CLMMs have to be in a fixed ratio. This ratio depends upon the current price of the token0 in token1 terms and the price range to deploy liquidity. If the price lies within the price range specified, then the ratio of the two token quantities is the following:

<figure><img src="/files/HDS55bmp6avVDfzxeNiW" alt=""><figcaption></figcaption></figure>

If the current price of token0 in terms of token1 price is greater than the upper bound of the price range, users can only deposit token1 into the pool. On the other hand, if the current price of token0 in terms of token1 is lower than the lower bound of the price range, then users can only deposit token0 into the pool.

Rivera calculates all the required parameters for the specified price ranges and rebalances LP positions to ensure the entire capital remains within the ‘active’ liquidity zone and earning rewards. Algorithms running on Gelato automate user LP'ing strategies.

**Algorithmic harvester**

In contrast to LPs of CPMM, LPs of CLMM are responsible for manually harvesting their fee earnings from the LP position. Furthermore, any protocol rewards also require manual harvesting by the users. Harvesting too early can erode users' earnings due to gas fees involved with the compounding transactions; while leaving the rewards unharvested for long periods will lead to poor capital efficiency.

We have built a DeFi primitive for harvesting earnings algorithmically. It enables users to execute reward compounding at the optimal point and maximize the strategy’s efficiency. The algorithm takes in strategy & network parameters to figure out the best time to signal transactions. The automation running on Gelato Network triggers the auto-compounding function that performs the necessary set of actions to deploy the rewards back into the strategy.

<br>

<figure><img src="/files/VPnEEBjOeOx1Nu2l3oOV" alt=""><figcaption></figcaption></figure>


---

# 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://rivera.gitbook.io/docs/technology/active-liquidity-manager.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.
