Cross chain Batch DEX

by @Alphaist & tomoki adachi from Titania research

Introduction:

In our previous post, we proposed building Frequent Batch Auction on SUAVE.
The detailed implementation of the PoC for FBA on SUAVE can also be found in this post. We demonstrated the potential for this to contribute to solving two current problems faced by DEXs: Sandwich Attacks and Loss versus Rebalancing. However, simply building an FBA on SUAVE is not significantly different from building an FBA on a Privacy L2. Of course, SUAVE is a decentralized platform that enables more diverse block building by implementing auctions and other features. (It is important to note that it is neither a Layer 1 blockchain nor a Layer 2 solution.)

One of the notable aspects of SUAVE is its potential to serve as a mempool and Block Builder for all blockchains. This possibility suggests that it may contribute to solving issues that have not been a concern for single-chain DEXs until now. These issues are market fragmentation, specifically order flow fragmentation and liquidity fragmentation.

Taking Uniswap as an example, there are numerous Uniswap pools on Ethereum alone. There’s Uniswap V2, which uses CFMM, and Uniswap V3, which uses CLAMM. Additionally, for major currency pairs like WETH-USDC, there are four different Fee Tiers. This is a clear example of liquidity fragmentation. While fee tiers are useful in providing liquidity providers with a variety of spread options, the upcoming Uniswap V4 raises concerns about further liquidity fragmentation due to the introduction of Hooks. Order flow fragmentation is not currently a significant issue on a single chain, but considering the future emergence of more general and app-specific Layer 2s, order flow fragmentation is likely to become a problem soon.

The question of whether market fragmentation undermines market quality has been a long-standing debate in the field of finance. Market fragmentation is not necessarily limited to the negative impacts mentioned above. Fragmentation can promote competition between exchanges, leading to innovation, improved services, and reduced trading costs for investors. Additionally, market fragmentation can disperse risk by reducing dependence on a single exchange, enhancing the market’s overall resilience to disruption. In fact, reports by O’Hara(2011) and others suggest that market fragmentation does not necessarily harm market quality. However, the impact of the National Best Bid and Offer (NBBO) and Regulation NMS’s Trade-Through Rule (Rule 611) in the U.S. market should not be underestimated. They have created a single virtual market with many points of participation. This has allowed for the positive benefits of competition and specialization without the negative consequences of loss of integration. While a detailed examination of the pros and cons of market fragmentation is beyond the scope of this article, we plan to investigate this issue in the future.

Overview:

We propose a DEX that aggregates swap order flows from all opt-in chains using SUAVE and Based Sequencing or Shared Sequencing, and executes transactions through a Frequent Batch Auction. This is expected to reduce the problem of Market Fragmentation and the resulting Arbitrage, mainly Cross-chain MEV.

Implementation Example:

Actors:

Off-chain

  • Trader: The actor who wants to swap and sends their order (intents) to SUAVE.

  • Operator: The actor who periodically executes the FBA.

  • Executor: The actor with an L2 Full Node who simulates the execution of transactions.

  • Shared Sequencer: A network that sequences transactions from multiple Rollups.

On-chain

  • Auction Contract: A contract that aggregates Trader’s orders, executes FBA through the Operator, and optimally reorders orders according to specific rules.

Flow :

  1. Trader sends an Order to the Auction Contract.

  2. The Order is stored in the Confidential Data Store (CDS).

  3. After a certain period, the Operator requests the end of the auction by executing the Auction Contract.

  4. The Auction Contract retrieves the Order information from the CDS and reorders the Orders.

  5. It creates a transaction to execute the Orders and sends the transactions that should be executed Atomically as an Atomic bundle to the Shared Sequencer.

  6. The Shared Sequencer accesses an external Executor to simulate the transactions to be executed atomically.

  7. If the simulation is successful, it generates blocks for each Rollup and sends them to the DA.

Options:

The above example demonstrates the construction of a Cross-chain Batch DEX using SUAVE and Shared Sequencing, but there are several options. First, we will examine the pros and cons of whether to use SUAVE for Block Building.

Block Building

- Shared Sequencer

Pros :

It can guarantee the atomic inclusion of blocks from multiple Rollups, and Rollups connected to the Shared Sequencer can communicate seamlessly.

Cons :

However, the Shared Sequencer only guarantees atomic inclusion of blocks and does not guarantee atomic execution. To guarantee atomic execution, it is necessary to run a full node of the Rollup, which increases the requirements for the Sequencer.

- SUAVE

Pros :

In addition to having a Multichain mempool aspect spanning multiple chains, it can also perform block construction. In the case of FBA, handling Intents and ordering them is one of the requirements, which can be realized on-chain.

Cons :

On the other hand, there are two problems when delegating block construction to SUAVE. One is how to enforce commitments against the possibility of SUAVE generating malicious blocks. The other is that whether SUAVE’s blocks are accepted by the Sequencer depends on the Sequencer.

Sequencing

- Based Sequencing

Pros :

By having the Proposer handle Sequencing, it can inherit Ethereum’s Liveness. It also does not depend on external Shared Sequencers.

Cons :

However, there are issues with guaranteeing atomic execution. In the case of an external Shared Sequencer, external builders and the Shared Sequencer can execute and validate full nodes. However, trying to achieve this with Based Sequencing would result in losing the advantage of Based Sequencing, which is Ethereum’s Liveness.

- Shared Sequencing

Pros :

Since it has an external network, censorship resistance, trust, and speed in providing Preconf depend on the network’s consensus.

Cons :

With Based Sequencing, Proposers need to opt-in to participate as Preconfers, and not all Proposers participate. This may cause latency, as Preconf execution cannot be performed until a specific slot. Also, Based Sequencing relies on a single Proposer, while an external network relies on economic security.

Conclusion:

In this article, we have proposed a Cross-chain Batch DEX that leverages SUAVE and Shared Sequencing or Based Sequencing to aggregate swap order flows from multiple opt-in chains. The primary goal is to mitigate the issues arising from market fragmentation, such as arbitrage and cross-chain MEV.We have outlined an implementation example involving various actors, both off-chain and on-chain, and described the flow of the process. Additionally, we have explored the pros and cons of using SUAVE for block building and the choice between Shared Sequencing and Based Sequencing. Considering these pros and cons, it seems realistic to use SUAVE for aggregating Intents and Shared Sequencers for Block Building and Sequencing for the implementation of FBA with Multiple Rollups.

Reference

4 Likes