DeepBook Supercharges DeFi on Sui
The launch of Sui's first native central limit order book gives builders an easy means of plugging liquidity into their apps.
Sui opens a new chapter in DeFi with the launch of DeepBook, its first native decentralized central limit order book (CLOB). Built by a community of Sui contributors, DeepBook provides a stable liquidity layer enabling a new generation of DeFi apps.
With DeepBook, DeFi and other builders will find a ready-to-use liquidity layer leveraging Sui's consensus mechanism for optimum performance. Its open API lets builders plug in apps and take advantage of asset trading.
At launch, a number of exchanges leverage DeepBook for trading functionality and contribute to its liquidity. KriyaDEX, Turbos.Finance, Aftermath Finance, Cetus, Kairon Labs, and MovEX helped test and currently use DeepBook to enable their own services. DeepBook will be supported by Kairon Labs as its initial market maker in addition to other liquidity providers.
DeepBook supports both limit and market orders from sellers and buyers. Designed as permissionless and released as open source, DeepBook exists as a Move package that lets anyone publish a liquidity pool to enable trading between a pair of assets. DeepBook does not have a token, and all the fees it collects are burned. It is a public good providing generic infrastructure that DeFi builders can tap into for audited and efficient code, and for liquidity.
Trading
As a CLOB, DeepBook supports markets where sellers list assets at a specific price, commonly called a limit order, or at a market price. Buyers browse the DeepBook ledger to find assets they want to purchase. This model gives traders the freedom to buy and sell at prices they choose, supporting traditional supply and demand economics.
DeepBook's transparency into the order process and permissionless nature supports Sui's ethos of fairness and decentralization. Users can view the order flow, order book depth, and order matching process. Anyone can buy and sell on the exchange with no restrictions.
Architecture
DeepBook consists of two key components, its core matching engine and its smart order routing engine. The matching engine uses an order book built on per-asset shared object pools. Order matching between assets occurs on-chain, while the routing engine processes transactions off-chain.
For each base and quote asset trading pair, DeepBook creates a globally shared pool to handle order placement, cancellation, and settlement. Under this architecture, transactions involving different trading pairs can be easily parallelized to maximize throughput.
Pools store unfilled maker orders. Taker orders are filled instantaneously from the available maker orders within the same transaction the order is submitted. Bid and ask orders are stored separately, each with a two-level nested crit-bit tree, an efficient means of storing bit strings.
The DeepBook SDK bootstraps DeFi builders with code snippets for trades and swaps, swap routing, and pool queries.
Secure
In an audit commissioned by MovEx, blockchain security company Zellic tested DeepBook and compiled a report discussing vulnerabilities and remediations. Zellic considered specific criteria for its audit, such as whether funds could be drained from the custodian, and whether an attacker could lockup funds or gain an unfair trading advantage.
The audit examined the DeepBook modules for coding mistakes, logic errors, integration risks, and code maturity.
The company found four critical errors, one medium, and one low. As one example, DeepBook allowed zero-quantity orders, which could be exploited to flood the system in a denial-of-service attack. All of the vulnerabilities found during the audit were successfully remediated through code changes.
Contribute
MovEX originally designed and created DeepBook before making it open source and contributing it to Sui. Other contributors, including Mysten Labs, Jump, Kairon Labs, GSR, Wintermute, and Aftermath Finance, played an integral role in DeepBook’s development. Further community involvement will be critical in ensuring that DeepBook evolves to meet the needs of Sui DeFi builders.
Help make DeepBook serve the Sui community by exploring the documentation and SDK, and engaging in the Sui Improvement Proposals process to suggest improvements and features.