In June 2017, EtherDelta was officially launched and completed the registration procedures of the US Securities and Exchange Commission before going online. Similar to Bitshares, Etherdelta is also an order book DEX. On EtherDelta, users can issue, cancel and match buy and sell orders through trading contracts, and they need to pay gas fees. Once the counterparty clicks the order, the trading contract automatically deducts the buyer's assets and sends them to the seller. All transactions occur on the chain and are recorded by the smart contract, while the user's assets are always kept in their own wallet. In addition, EtherDelta charges a 0.3% transaction fee, which is borne by the buyer. Although EtherDelta has low transaction fees and fast transaction speeds, it also has some problems. For example, the transaction matching process requires manual operation by users, Ethereum's throughput limit leads to slow transaction speeds, and delays in the order book may cause transaction failures and waste of gas fees.
Loopring: The first ZK Rollup to go online, focusing on differentiation factors
With the advent of the DeFi craze, the transaction throughput problem of the first layer network began to emerge, and DEX also began to explore expansion to Layer2. Loopring was launched at the end of 2019. It is the first Ethereum ecosystem DEX protocol built on ZKRollup, using ZKP technology to achieve high throughput and non-custodial transactions. Loopring has gone through many iterations. The initial version only supported thin order transactions. The second version strengthened privacy and security by introducing ZKP technology, and the third version added support for the AMM model, making DEX more liquid.
You can see that Loopring combines the two narratives of DEX and ZK . In terms of performance, Loopring uses ZKP technology to complete all matching logic off-chain and submit it to the chain by generating proofs, which not only ensures the efficiency of the transaction, but also ensures its security and effectiveness. In addition, Loopring has also launched an order sharing mode. When the smart contract cannot execute the entire order in a single transaction, this function will split the order into smaller parts for trading until the original order amount is completed. Specifically, Loopring's on-chain transaction ring matching technology aggregates multiple separate orders into an order ring. After the smart contract verifies the order, each participant will exchange assets according to the rules of the order ring. The order sharing system will continue to run until all partial orders are fully executed. For example, if investor A wants to sell A tokens, investor B wants to buy A and sell B tokens, and investor C wants to buy B and sell C tokens, this trading cycle will continue until investor A gets the required currency. This trading cycle can guarantee the best price for all trading participants and obtain a higher level of liquidity.
In terms of security , Loopring uses ZKP technology to ensure that every off-chain match will generate a proof and submit it to the chain to prove that its results are correct. In addition, even in the extreme case of an exchange outage, users can still declare the legitimacy of their assets by providing valid Merkle proofs, which can be obtained from data on Ethereum. However, Loopring's current security level on L2Beat is still STAGE 0, mainly due to the lack of an exit window. The Loopring team also stated in a conference call that it is currently working to create a security committee and is committed to improving its security level on L2Beat. It plans to make some updates this year to provide users with more layers of security protection.
Compared with other DEXs, Loopring pays more attention to differentiation factors, so it has launched many new features and products to bring users a unique experience. For example, built-in support for the Loopring ZKRollup solution in smart wallet products; open up fiat currency channels so that users can easily recharge through credit cards and bank cards; launch block trading functions similar to those in traditional stock markets and provide a complete set of second-layer NFT solutions, including open casting, pending orders and transfers. In addition, it is worth noting that Loopring founder Wang Dong and former Loopring chief architect Brecht Devo also co-founded the EVM-equivalent ZK Rollup project Taiko in 2022, and completed a $15 million Series A financing in March this year, led by Lightspeed Faction, Hashed, Generative Ventures, and Token Bay Capital. At present, Taiko has completed a total of $37 million in financing through three rounds of financing.
dYdX: Focus on the derivatives market and strive to achieve full decentralization Another DEX that has switched to the second layer network in response to the throughput problem of the first layer network is dYdX. Unlike Loopring, dYdX focuses on the derivatives market and chooses to build on the StarkEX L2 solution provided by StarkWare. Initially, dYdX was deployed on the Ethereum mainnet and was just a margin trading protocol. However, as Ethereum gas fees soared, dYdX could not afford the gas fees of users, so it decided to migrate to Layer2 and built an order book-based trading system.
The reason for choosing StarkWare's StarkEX L2 solution is that it better meets the needs of dYdX. This solution is not only able to process transactions in batches, but also compatible with various smart contracts . Although developing applications on Starkware requires learning its unique language Cairo, the advantages it brings are more attractive than other advantages, including significantly reduced gas and transaction fees, traders can use a single margin account to trade multiple perpetual contracts, thereby improving capital efficiency when trading multiple token pairs, cross-margin and higher scalability, allowing real-time liquidation, etc.
With the help of StarkWare's infrastructure, dYdX has established its unique position in the decentralized exchange market. However, dYdX hopes to achieve a fully decentralized operating model, so it decided to launch a dedicated chain based on the Cosmos SDK to manage business such as order books in a fully decentralized manner . dYdX V4 is designed to be fully decentralized end-to-end, with the front end run by the dYdX Operations SubDAO, and the order book and matching engine managed by active validators around the world.
Currently, dYdX has open-sourced its V4 code and plans to focus on building a permissionless market in 2024, including allowing users to list any market at any time, providing instant liquidity through LP vaults, etc., to further improve core trading functions and user experience. In terms of security, dYdX V3 currently has a security level of STAGE 1 on L2Beat.
DeGate: Focus on security and create the ultimate user experience DeGate is a decentralized order book protocol based on ZK Rollup in the Ethereum ecosystem, positioned as Layer2 focusing on decentralized transactions. DeGate is the only ZK Rollup project on L2Beat that has achieved a STAGE 2 rating, which means that DeGate does not rely on manual intervention and social consensus, and there is a high degree of trust assumption. In DeGate's security architecture, by adopting ZK Rollup technology, its state validity verification and data availability are effectively guaranteed. And through mechanisms such as non-custodial storage of assets and "escape mode", the security of user assets and the accuracy of transactions are ensured.
As for privacy, DeGate's privacy design focuses on protecting users' personal information and asset security, rather than being used for privacy systems. Through various encryption technologies, such as digital signatures and public key encryption, DeGate provides full protection for users' original information. And every transaction of DeGate on Layer2 is settled on the chain, and the zero-knowledge proof generated by the circuit contains all user asset changes, and all transactions are open and transparent.
In addition, in DeGate, users have full control over funds because assets are hosted in smart contracts. The order signature is valid before the order is fully executed, and the circuit verifies the signature and validity period of the order to reduce the risk of manipulating the order. And DeGate also provides the option of on-chain cancellation, which guarantees 100% trustlessness. Once the DeGate node aggregates this cancellation request transaction to the chain, the order will be marked as closed and can never be matched again.
DeGate also has a built-in "escape mode" that allows users to withdraw their own funds when the DeGate off-chain node (Operator) cannot process transactions. The trigger condition for "escape mode" is that the forced withdrawal has not been processed for more than 15 days. Once triggered, users can directly call the DeGate smart contract to retrieve their assets. In "escape mode", the smart contract will reject new Rollups, which means that all DeGate accounts and asset states will remain the same as the final state of the Rollup before activating "escape mode". The smart contract will then process all assets according to the final state, and users can use third-party services to parse the latest account and asset status and retrieve their assets from the smart contract. This mode has been successfully tested. In November 2022, DeGate shut down its L2 node on the Rinkeby network, and the community and team tested the "escape mode" and successfully retrieved the assets.
On the premise of ensuring security and decentralization, DeGate has also introduced a series of innovative trading mechanisms to provide users with a more efficient and convenient trading experience:
Batch spot trading mechanism: Although ZK Rollup can significantly compress the data size, it is still inefficient. Data shows that it takes 72 bytes to complete a transaction match in the traditional ZK Rollup order book. To this end, DeGate has launched a batch spot trading mechanism, which can intelligently bundle and compress multiple transactions before adding them to the DeGate Layer2 block, and then generate a validity proof through encryption and submit it to the Ethereum mainnet. It is reported that this mechanism can bundle up to 9 or more transactions between different users, and only consumes 83 bytes before going on the chain.
Decentralized Grid Trading: The function of AMM is realized through limit orders, without the need for smart contracts as the underlying support. By bundling constants such as the number of levels of grid strategies and grid bias into each grid transaction signature, DeGate eliminates the need for users to sign multiple transactions and simplifies the complexity associated with users.
Decentralized Fixed Investment: DeGate's fixed investment function does not charge additional fees. For users who pursue stable returns, this function is an ideal choice, not only allowing users to have asset custody, but also low cost and high efficiency.
DeGate officially entered the mainnet stage on January 9 this year. At present, its TVL has exceeded US$61.82 million and its cumulative transaction volume has exceeded US$1.04 billion. With the development of infrastructure and ZK technology, DeGate is working hard to improve scalability and reduce transaction costs. These include measures such as improving ZK computing efficiency and deploying DeGate to other active Layer2s. At the same time, in order to be compatible with the Ethereum expansion roadmap and EIP-4844, DeGate plans to launch DeGate 2.0. This version will use the blob data solution introduced by EIP-4844 to increase DeGate throughput and further reduce user Gas fees.
Summary From BitShares to DeGate, we can clearly observe the evolution of order book DEX. Initially, the project simply migrated the traditional order book model to the chain. As time went on and the market developed, problems such as high Gas fees and insufficient user experience were gradually realized. Against this background, various projects began to explore new trading models to solve these pain points. For example, Loopring combines the order book and AMM models, and brings a unique experience to users through differentiated development; dYdX focuses on the derivatives market and launches a dedicated chain; DeGate chooses to provide users with a CEX-like experience while ensuring extreme security. We have reason to believe that with the introduction of measures such as EIP-4844, the user experience of order book DEX will be further improved.