DeepBook Demystified: Fueling DeFi Innovation in Sui

DeepBook offers advanced trading features and deep liquidity while also making optimal use of Sui's consensus mechanism to execute trades concurrently.

DeepBook Demystified: Fueling DeFi Innovation in Sui

Discover the power of DeepBook! Offering open access to deep liquidity for all apps building on Sui. Advanced trading capabilities can be incorporated into any app. Explore DeepBook’s architecture and create a new chapter in the story of DeFi with Sui.

DeepBook, an ecosystem-wide liquidity layer, plays a critical role in supporting Sui’s DeFi ecosystem by providing stable and efficient infrastructure for trading activities available to all builders. It serves as the foundation upon which DeFi apps can operate, providing greater access to assets and enabling efficient trading. With such a tool, DeFi builders can focus on developing unique features and incentives instead of troubleshooting problems with simple trading logic and bootstrapping independent liquidity pools. 

As a sophisticated Central Limit Order Book (CLOB) system, DeepBook enhances the efficiency and liquidity of Sui's overall DeFi ecosystem, enabling traders to execute orders quickly and at fair prices while leveraging advanced trading capabilities. This functionality not only attracts more participants but also reduces slippage and enhances overall market stability. Paired with Sui’s high-performance consensus engine, DeepBook offers a trading experience rivaling those of centralized trading entities. 

Understanding CLOBs and AMMs

Central Limit Order Books (CLOBs) and Automated Market Makers (AMMs) represent two distinct approaches to decentralized trading. CLOBs, like DeepBook, facilitate order matching by maintaining an order book of buy and sell orders. In contrast, AMMs utilize algorithms to determine asset prices and execute trades. While both CLOBs and AMMs offer unique advantages and cater to different trading preferences, CLOBs are particularly well-suited for traders seeking price discovery and order book transparency, making them an important tool for DeFi ecosystems.

Creating a CLOB presents significant challenges due to the complexity of order matching algorithms and the need for efficient market liquidity. Developing and maintaining a CLOB requires sophisticated technical expertise and substantial resources, which can be prohibitive for many DeFi builders. However, offering an open-access CLOB accessible to all builders can have a transformative impact on the ecosystem. 

DeepBook democratizes access to advanced trading functionalities, such as limit orders, allowing developers to create unique trading platforms tailored to specific market needs. For example, by integrating a native CLOB into their protocol, builders can experiment with hybrid models that combine unique elements of AMMs with the powerful features of a CLOB. This opens up possibilities for innovative trading experiences that cater to diverse user preferences and trading strategies.

Deciphering DeepBook's architecture

At the core of DeepBook lies its unique structure, where each trading pair has its own shared object representing the pool. DeepBook's approach utilizes Sui's consensus engine optimally by dedicating separate pools to each pair. This design minimizes conflicts between pairs and allows for parallelized transactions, enhancing efficiency. By leveraging Sui's consensus engine in this manner, DeepBook achieves remarkable throughput while ensuring seamless trading across various pairs.

DeepBook serves as a valuable resource for app developers seeking access to deep liquidity. Leveraging the DeepBook API, apps can provide sophisticated trading functionalities, enabling users to execute trades using its smart routing feature to ensure competitive swap prices.

Users place trades through app interfaces which are integrated with DeepBook. Trades involving separate pools are processed concurrently, even if initiated by the same user via the same app.

Sui’s next-generation consensus mechanism, Mysticeti, will enable transaction speed rivaling those of centralized execution environments. With Mysticeti’s lightning-fast transaction processing capabilities and DeepBook’s advanced trading infrastructure, users can expect seamless and efficient trading experiences equivalent to those of traditional financial infrastructure. As Mysticeti and DeepBook continue to evolve in tandem, they empower Sui DeFi builders to build products not feasible on other blockchain platforms.   

Order book structure

DeepBook employs a streamlined method for storing and processing orders. Each pool stores the unfilled maker orders and matches taker orders which are paired immediately upon submission. Order matching within DeepBook occurs autonomously, eliminating the need for centralized oversight.

DeepBook gives apps the ability to offer their users  the flexibility to place market orders and various types of limit orders. Market orders, which are considered taker orders, are matched instantly against existing maker orders upon submission, all within the same transaction. Limit orders, on the other hand, are initially matched as taker orders against existing maker orders. If the limit order cannot be completely filled, the remaining quantity can either be added to the order book as a maker order or discarded, depending on the limit order's configuration.

DeepBook utilizes a smart routing functionality, enabling traders to find the most efficient paths for token swap routes. Leveraging Depth-First-Search (DFS) algorithms, traders can simulate swaps across different pools to optimize their trades. This strategic approach ensures that swaps are cost-effective and enhances overall trading efficiency on the platform.

DEEP token 

DeepBook’s upcoming token, DEEP, will further improve the economic dynamics of DeepBook. Those serious about trading on Sui will be able to stake DEEP in order to receive discounted trading fees, additional maker incentives, and the ability to participate in DeepBook pool governance. 

Those that stake DEEP to a specific pool and actively swap within that pool over an epoch will pay less taker fees than those that are occasionally participating in swapping. Within an epoch, a user who has the threshold of staked DEEP will experience a decline in taker fees with respect to their volume taken in that pool over the epoch. Additionally, those who also meet the staked DEEP requirements and are providing liquidity to the pool they have staked to will receive maker incentives. Governance of pools allow for the adjustment of parameters around fees and staking requirements. There are no minimum stake requirements to participate in governance and governance rights increase with stake weights.

While the DEEP token is not currently available, unique soulbound NFTs have been distributed ahead of the upcoming token launch.

Detering wash trading

To deter manipulative practices, DeepBook adopts a carefully balanced approach to incentivizing liquidity provision. While incentives are offered to active liquidity providers, there's a risk of traders creating artificial volume to earn more rewards. To counter this exploit, DeepBook intentionally sets maker incentives lower than the fees collected on trades once a pool reaches a minimal liquidity threshold. This ensures that incentives are proportionate to genuine trading activity, discouraging manipulative behavior.

As an additional safeguard, DeepBook implements a burning mechanism for tokens involved in wash trading. If someone tries to inflate trading volumes within an epoch by repeatedly looping tokens through the pool without any net change, these tokens are labeled as residual tokens. To uphold platform integrity, these residual tokens are removed from circulation through burning. This ensures that rewards are earned through genuine trading activity and not deceptive practices like wash trading, maintaining the platform's integrity.

To learn more about the economic incentives and dynamics around DeepBook and the DEEP token, explore the DeepBook token whitepaper.

Turning the page with DeepBook

DeepBook democratizes access to advanced trading functionalities, empowering developers to create unique trading platforms and providing users with experiences rivaling those of centralized trading platforms. Through carefully balanced incentives and innovative mechanisms to deter manipulative practices like wash trading, DeepBook maintains platform integrity and ensures rewards are earned only through genuine trading activity. 

Numerous DeFi apps on Sui are integrating DeepBook into their product suites. Among the most prominent are Aftermath, Cetus, KriyaDEX, Turbos, and Typus. If you're eager to witness DeepBook's capabilities in action, these DeFi platforms serve as excellent showcases of its utilization. Explore their docs to see how they’re integrated DeepBook into their offerings.

As DeepBook continues to evolve and with the upcoming launch of the DEEP token, it stands to further revolutionize decentralized trading and empower DeFi participants within the Sui community.



Note: This content is for general educational and informational purposes only and should not be construed or relied upon as an endorsement or recommendation to buy, sell, or hold any asset, investment or financial product and does not constitute financial, legal, or tax advice.