> 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="/files/eMD2KPjfJVZcqX6SHlGk" 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="/files/AIsuP3hpfzR6imkdlxsC" alt=""></div>

The parameter ![](/files/DdJvGST0hFakr0FkPpnZ) 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="/files/LgEln7Ehg0JR6wmdxgSD" 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>
