The Kuru AMM vault is tightly integrated with the Orderbook contract and is a first class citizen of the same. It places orders in such a way that at every price point, the value of the quote asset and the base asset is considered equal.
For practicality, let us assume that the vault is placing orders at a gap of 30 BPS. This means that the vault has orders at current price P, P * 1.003, P / 1.003, etc. Please note that the spread in the actual contract is configurable and is not necessarily 30 BPS.
First, we need to find out what size the orderbook needs to place at bid and ask prices (buy and sell). The bid and ask price has a spread of 30 BPS as well. Even though the vault is a passive market maker as far as LPs are concerned, it is an active MM to the Orderbook.
Let us find the size which needs to be placed for ask and bid. Before this, we assume the price at vault’s best ask price to be $p$ , where $p = b / a$ - b is the amount of quote assets that the vault owns and a is the amount of base assets it owns. This means that the vault’s best bid price must be at a gap of 30 BPS, which is $p/1.003$.
Coming to the Math:
Now, if the distribution of sizes along the curve is correct, it should add up to the base token amount $a$ owned by the vault. For this:
We know that the current ask size is $s_b = \frac {0.003a} {2.003}$. This means that at the next ask price, the new ask size must be $s’_b = \frac {0.003 (a - s_b)} {2.003}$.
→ $s’_b = \frac {0.003 * 2a} {2.003 * 2.003}$
→ $s’_b = \frac {2s_b} {2.003}$
→ $s’’_b = \frac {22s_b} {2.003*2.003}$
→ $s^n_b = \frac {2}{2.003}^n * s_b$
→ $\sum\limits^\infty_{i = 1} s^i_b = \frac {s_b} {1 - \frac {2} {2.003}}$ (Infinite geometric series summation with factor < 1)
→ $\sum\limits^\infty_{i = 1} s^i_b = \frac {s_b} {1 - \frac {2} {2.003}}$
→ $\sum\limits^\infty_{i = 1} s^i_b = \frac {2.003s_b} {0.003}$
→ $\sum\limits^\infty_{i = 1} s^i_b = \frac {2.003} {0.003} * \frac {0.003a} {2.003}$
→ $\sum\limits^\infty_{i = 1} s^i_b = a$
By property of symmetry, this must be true for the quote given for bids as well, which will amount to b.