Aftermath Perpetuals
When we set out to build perpetuals, we wanted to do something different than what other perps DEXes have done: put the entire order book on-chain on a general purpose L1. We chose Sui, because from a technical standpoint it was far and away the best choice to allow us to realize our vision. From that point on, our mandate has been to build products that are fully optimized for Sui, and that can only be built on Sui.
Until this point, the typical model for an order book-based exchange is to run the matching engine off-chain on a centralized server, and settle the orders on chain. The first to do so was dydx way back in 2017. This model works fine and has spawned countless copycats over the years, but is not without its drawbacks. Namely, the matching engine is a black box. There is no way for any user to confirm what is actually happening behind the scenes. Hence, dydx themselves and many others who wish to innovate have moved away from this model, to put more of the order book on-chain for a more trustless, transparent trading experience.
The next logical step has been appchains that are specifically optimized for perpetuals. This is a step in the right direction, but still has seen a few drawbacks. Users must bridge to these chains in order to trade, and some feature a very small, centralized validator set. Users still can not be fully confident that everything is fair and aboveboard with so few parties in charge of ordering and confirming transactions.
The optimal solution is to run the order book on a layer one blockchain with a large and widely distributed validator set; a chain which is designed with speed, low latency, low cost, and fairness as its core principles. Sui with its recent Mysticeti consensus upgrade is the most ideal environment ever seen for balancing a centralized exchange-like trading experience with the transparency, trustlessness, and fairness of putting everything on-chain.
Sui by its very nature makes it extremely difficult to perform the typical trickery seen with MEV on other blockchains. Sui is a Directed Acyclic Graph (DAG), which means the chain advances in a series of rounds, each with multiple proposers and leaders. If you are interested in a technical description of DAGs and Mysticeti and how they promote fairness, this article written by our CTO explains it in great detail. The TL;DR is that it is a major breakthrough that allows for a trading experience as good as more centralized solutions, yet still is completely verifiable for fairness as everything from matching to settlement are performed on-chain. Win win.
The loudest opponents of building fully on-chain order books have pointed to two possible drawbacks: network congestion and gas costs. For the first, Sui was designed from the ground up to run transactions concurrently, ensuring the performance of the chain is unaffected by spikes in user activity. Gas costs remain stable as well due to Sui’s novel gas model, which brings us to point two. Another innovation brought forth by Sui is storage rebates. When writing data onto the chain, the user pays a fee. When deleting data from the chain, a rebate is paid to the user.
The result of Sui’s groundbreaking gas and storage model is that the gas costs are negligible and there is essentially no difference in cost between updating one hundred orders at a time as there is just one. Sui with Mysticeti has finally made it possible to have the best of both worlds: the trading experience of a centralized venue, with complete transparency and fairness.
We have spent the past two years building our order book from scratch, and optimizing it for speed and low cost. It is our own design, and offers our users the best performance possible for a smooth trading experience. Just as Sui has continued to evolve and update since launch with its recent Mysticeti upgrade, we will continue to optimize and innovate as well. This is the future of perpetuals trading, and that will become more and more clear with time.
Last updated