Although Sui announced DeepBook, a central limit order book (CLOB), as its first native liquidity layer, automated market maker (AMM) platforms can also play a role on Sui. In fact, DeepBook enables a type of hybrid AMM-CLOB that can serve builders and users interested in AMM functionality.
In this construction, an AMM works as a front-end for a CLOB, leveraging the CLOB's trading functionality while providing its users an easy and quick trading experience.
CLOBs and AMMs
CLOBs and AMMs are two categories of trading platforms used on blockchains. Each facilitates buying and selling of digital assets. Each allows people to list assets they would like to sell, and lets potential buyers choose the assets they want. However, a CLOB offers an array of sophisticated trading options, while an AMM simplifies the process.
CLOBs support both limit and market orders. With the former, a buyer or seller sets a price they would like to receive or pay for assets in the market. If no one meets that price, either as a buyer or seller, the order is not met and no transaction takes place. Typically with limit orders a buyer or seller can set an expiration date. With a market order, a buyer or seller is willing to take whatever the going rate is for that digital asset, based on current market activity.
AMMs differ from CLOBs in that they rely on an automated protocol to calculate the value of digital assets based on supply compared to other digital assets traded in their markets. As the volume of a particular asset in the AMM trading pool increases, its value would typically decrease, at least compared to other assets in the pool. Given this automated trading mechanism, AMMs do not let traders set a price for their assets, as with a limit order.
Despite these differences, an AMM on Sui can leverage DeepBook's existing market, accessing its liquidity to let users trade assets. One way to construct an AMM on DeepBook would be to route new user orders to a DeepBook limit order for fulfillment. When orders placed through the AMM exhaust all the limit orders available on DeepBook at a given price, orders would then process against the AMM itself. When slippage begins to occur on the AMM, asset prices not meeting expectations, then orders would again be fulfilled through DeepBook as soon as the next limit order is hit. This process would perpetuate, leveraging DeepBook as needed to deliver more accurate market values.
Rather than displace or nullify the potential for other liquidity layers and exchanges on Sui, DeepBook is just one solution. Builders may create their own liquidity layers or even contribute to DeepBook's open source code.
DeepBook can also serve to support other exchanges and DeFi apps. As an open liquidity layer, builders can leverage its trading mechanisms in any way that serves their users.