When you add liquidity to a liquidity pool, for example in BUSD-WBNB one, you must provide quantities of both tokens by respecting the ratio of tokens already in the pool. Why does this correspond to providing equal values (expressed in dollars for instance) of BUSD and WBNB? This is because otherwise, arbitrage between the prices of the tokens and the ratio of the pool is made possible. We make this arbitrage opportunity precise in this article, but first let us reformulate the problematic with numbers.
Let and be the respective prices of BUSD and WBNB expressed in dollars. If you have dollars to invest in this liquidity and you split these dollars equally in BUSD and WBNB, then you obtain tokens BUSD tokens WBNB. The ratio of tokens you obtain is then . The arbitrage-free formula then states that this ratio matches the ratio of the pool:
The arbitrage-free formula is also equivalent to the following equation:
which means that inside the BUSD-WBNB pool, the total value of BUSD tokens equal the total value of WBNB tokens.
Recall the swap formula that expresses the output quantity of WBNB tokens obtained from swapping an input quantity tokens BUSD:
In the absence of transaction fees () and of slippage (), the output quantity of WBNB would be:
In other words, in the absence of slippage and transaction fees, the ratio gives the amount of WBNB you would get per BUSD. This ratio is called the pool price of BUSD. Similarly, is called the pool price of WBNB.
So the arbitrage-free formula states that the pool price equals the ratio of the actual prices, expressed in dollars or any currency:
When the arbitrage-free formula does not hold, there is a possibility of arbitrage.
Let's say for instance that With dollars you can buy 1 WBNB token. Using the price pool (without transaction fees and slippage), you can then swap the WBNB token in the pool to obtain tokens BUSD. Selling the BUSD tokens you get back dollars, which is bigger than your initial investment .
The case where is symmetric: You can buy BUSD with dollars, then swap BUSD against WBNB using the pool and finally sell the resulting WBNB to obtain more dollars than you started with.