# How the strategy works

### Overview

A strategy is deployed for a certain pool on Uniswap, such as ETH/USDC. It has two main parameters:

* B (base threshold)
* L (limit threshold)

The strategy always maintains two range orders:

* **Base order symmetric around current price X**, in the tick range \[X-B, X+B].
* **Limit order just above or below the current price.** It will be a single-token order in the tick range \[X-R, X], or \[X, X+R], depending on which token it holds more of after the base order was placed. This order helps the strategy rebalance and get closer to 50:50 to reduce inventory risk.

Every 48 hours, the *rebalance()* method is called by a keeper. This shifts the two orders according to the updated price and token balances. If the strategy performs well, this time period can be decreased.

Note that the rebalance order doesn’t guarantee the ratio returns to 50:50 - it just makes it more likely. If it holds more ETH than USDC, it makes it more likely it’ll sell more ETH than buying more ETH. However, if the price keeps increasing, the strategy will get more and more unbalanced, but on average it’s more likely to return to 50:50 since it’s offering to sell more tokens than it’s offering to buy.

### Code

The logic for rebalancing the strategy can be found in the `rebalance()` method in PassiveStrategy.sol.

<https://github.com/charmfinance/alpha-vaults-contracts/blob/main/contracts/PassiveStrategy.sol>

### Example <a href="#id-69c1" id="id-69c1"></a>

![](https://miro.medium.com/max/8000/1*opc067wuqu7mPhX89ZsBIw@2x.png)

For example, let’s say the current price is 150 ticks, B = 50 and R = 20, and the strategy holds 1 ETH and 160 USDC. It would then place a base order between \[100, 200] ticks using 1 ETH and 150 USDC. The base order is symmetric around the current price so it deposits equal values of ETH and USDC.

It then has 10 USDC left over, which is used for a rebalancing order between \[130, 150] ticks in order to try to buy more ETH with its USDC to get closer to a 50/50 ratio.

![](https://miro.medium.com/max/8000/1*ehJA0hlJXOEqPhCLWO_svQ@2x.png)

If the price goes up to 180, after rebalancing, the base order will be shifted up to \[130, 230]. Let’s say the strategy now holds 1.2 ETH and 90 USDC. The strategy would then use 0.5 ETH and 90 USDC for its base order. It has 0.7 ETH left over, so it uses it for a rebalancing order between \[180, 200].


---

# 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://learn.charm.fi/charm-finance/alpha-vaults/strategy.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.
