> For the complete documentation index, see [llms.txt](https://flype-protocol.gitbook.io/flype-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flype-protocol.gitbook.io/flype-protocol/imm/the-math-behind-imm/imm-balancing-indicator.md).

# IMM Balancing Indicator

The current total value of the pool is:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FerveQBuZh95JFXjqSvqh%2Fimage.png?alt=media&amp;token=28a51c7f-bc01-4a97-9cdd-11a7595d832c" alt=""></div>

We define the pool as balanced if Xc \* rX = Yc\* rY, i.e., the values of the LP token and ETH assets in the pool are equal.

So, we can determine the pool to be balanced if:

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FGFzQoeK6Pwj1o0VvWem5%2Fimage.png?alt=media&amp;token=36f1e2c2-eb61-4a4b-bbf1-ffba4bfee6ff" alt=""></div>

The parameter ![](https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FKmbYAPPOKfhVpe7dKWmV%2Fimage.png?alt=media\&token=a4245b9b-65e9-49a9-8237-e28478587be0) is used to measure the pool diversion from equilibrium state:

If q>1 there is a shortage of ETH.

If q>1 there is a shortage of ETH.

Function f(q) is used to adjust the Oracle price according to the pool state.

<div align="center"><img src="https://976579298-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Ftor5sd7sW1BdSm5MKyoe%2Fuploads%2FmUn7N309RZBPosEIw9Ei%2Fimage.png?alt=media&amp;token=399735fb-2b70-42fa-98e9-cd46f27c12ae" alt=""></div>

The parameters a, b are set on the following range:

0 <= b < 1

0 <= a < ∞

Due to solidity efficiency limitations, parameter “a” can only be set to values starting from 0 and increasing in 0.5 increments till infinity.

If q = 1, f(q) = 1, the pool is in equilibrium state and no adjustments are applied to the Oracle price.

If q>1, f(q) < 1, the pool is in shortage of ETH and the pool internal rate will be less than the Oracle price.

If q<1, f(q) > 1, the pool is in shortage of LP token and the internal rate will be higher than Oracle price.

<br>
