Crescent Docs
Search
K
Comment on page

Hybrid DEX

There are many ways to define a hybrid DEX, but in the context of Crescent, hybrid refers to both AMM and traditional order-book trading operating simultaneously in the same market.
In a typical DEX, a calculation logic such as CPM(constant product model) determines the amount of tokens that can be received in a swap or the amount of tokens that must be put in to obtain a certain amount of outputs(exact-in, exact-out), and the swap price, which is determined as a ratio of the input and output quantities, appears to increase or decrease continuously. The fact that the swap price is continuous means that as the user's order quantity changes, the rate of exchange actually exchanged changes slightly. This results in the inability to exchange tokens at an identical swap price for two different orders, even if the difference between their input quantities is minuscule.
However, the continuous nature of swap prices is incompatible with order-book in traditional finance. In the order book, the execution price does not change no matter how many tokens a trader buys, as long as the liquidity already at the best price allows. Then, when the liquidity at that price is exhausted, the next price will start to fill, and the order will never fill at a price between those prices. This means that the execution price is “discrete”. As mentioned earlier, there are ticks in the order-book, and as a hybrid DEX, Crescent is designing the basic UI and UX in a way that is not off-putting to traditional order-book users, so we want to provide an order-book with an explicit tick system. Therefore, when the amount that a pool can provide is calculated through CPM and applied to the order-book, it is necessary to calibrate the liquidity to the discrete tick system. Instead of making a calibration, it might be better to modify the CPM logic itself or develop a different way of providing pool liquidity. However, given the computational benefits and additional convenience we gain by sticking with CPM, we felt that tweaking the original was a much better direction than going the hard way.
Hybrid DEX