This page was drafted in December 2020 and is currently due for an update. The core concepts are implemented as planned and the only difference is the formula used to plot the curve: y = kp/(x+k)

Context

An additional disadvantage of the pair-based structure is its lack of capital efficiency. Liquidity provided to one pair is restricted to usage within that pool alone. Even if an asset is staked in large quantities within the AMM, disproportionate distribution across the pairs results in some pairs having low liquidity and higher slippage.

Centaur Swap is designed to enable asset pools to trade with each other in a seamless manner. This means that once an asset pool is funded, it is effectively paired against every other existing asset pool. Based on the curve described in the previous segment, the price for each token against USDT or ETH can be calculated at any point in time, while taking into account the Current Balance of each individual pool. The price of any two tokens can then be used as a reference to determine an exchange rate for a direct swap.

Approach

Consider a swap from Token A, which is currently in Deficit to Token B, which is currently in Surplus.

Due to the Deficit of Token A, its price at point A1 is above i, the External Price and traders are incentivised to sell Token A. The intended quantity of tokens sold by the trader would increase the Current Balance to point A2 and the value would be represented by the shaded area under the curve ("|A|").

By integrating the curve $y = -kx^3 + i$, the value for |A| can be calculated

where the $x_1$ and $x_2$ represent the values of A1 and A2.

After deriving |A|, the its value can be projected onto the curve of Token B, which is currently in Surplus at point B1. As token swaps must result in an equivalent exchange of value, the shaded area between points B1 and B2 ("|B|") will be exactly the same as |A|. With that, we can solve for B2 to calculate the new Current Balance after the trade is executed, and after dividing the quantity of Token B received by the quantity of Token A sold, we can determine the exchange rate for any two tokens liquidity pool in a manner that does not rely on pairing.