# Rebalancing

**The key characteristics of the Chamber are:**

* Hedge deviation (shows how close is current state to delta-neutral). Applicable to each borrowed token.

$$
hedgeDeviation\_i = \frac{|tokenInPool\_i-tokenBorrowed\_i|}{tokenInPool\_i}, i = {1,2}
$$

* Position LTV (shows how close is the liquidation).

$$
LTV = \frac{\sum\_{i=1}^2 tokenBorrowed\_i\times USDPrice\_i}{collateralAmount\times collateralUSDPrice}
$$

* Range bounds (shows how concentrated is provided liquidity).

$$
upperBound = currentPrice\times k\_u \\
lowerBound = \frac{currentPrice}{k\_l}
$$

**Chamber's hyperparameters are:**

* Hedge deviation threshold: **hedgeDev**
* **maxLTV**, **minLTV**, **targetLTV**
* Target range width **k**

***We have Chainlink and Gelato keepers set up to check for rebalancing condition to trigger it whenever possible, making position management fully decentralized.***

When hedgeDeviation of any token is higher than **hedgeDiv** or LTV is out of **(minLTV, maxLTV)** bounds rebalance is triggered. \
\&#xNAN;*After rebalancing position is returned to hedgeDeviation = 0 for every token, LTV = **targetLTV**, and range bounds set symmetrically around current price.*

Such management approach perfectly fits low volatility crab market or medium-bullish(bearish) markets. The worst condition is highly volatile crab market, as rebalancing causes *impermanent* loss to become *realized* loss and thus accumulates IL from every price spike.
