StarkWare's distributed AMM (dAMM): L1 liquidity for L2 trading
Thread571 words
Explains the dAMM design where liquidity stays on L1 while an off-chain operator processes L2 trade batches and settles the net difference, allowing several L2s to share one liquidity pool without fragmentation.
Key claims
Operator settles only the net difference per batch against the L1 AMM contract
Separating liquidity from pricing state lets multiple L2 states share one pool
More shared volume raises fee revenue per unit of liquidity
0/ Until today, L2 AMM designs entailed moving the AMM to L2 in its entirety including liquidity, resulting in undesirable fragmentation of base layer liquidity
@StarkWareLtd's concept of a distributed AMM (dAMM) fixes this
A 🧵 on what dAMM is and how it works (0/15) ✨👇
@StarkWareLtd 1/ The concept of the distributed AMM (dAMM), is an L2-powered AMM design that allows liquidity to remain on L1, while users trade on L2
@StarkWareLtd 2/ Beyond allowing L1-based Liquidity Providers (LPs) to participate in and profit from #L2 AMM activity, this design also allows for multiple L2 solutions to leverage the same L1 AMM infrastructure
@StarkWareLtd 3/ So how does it work? The #dAMM has an off-chain operator, which processes batches of L2 trades. The Operator is the sole entity trading against an L2 powered AMM contract on L1, settling all trades by executing the net difference against said contract at the end of each batch
@StarkWareLtd 4/ Towards the users on L2, the operator mimics the #AMM contract’s logic and offers trade quotes based on the state of the AMM at the beginning of the batch, also taking the subsequent L2 trades within the batch into consideration
@StarkWareLtd 5/ #dAMM functionality also enables cross-L2 trading, allowing the same liquidity pool to be used across multiple L2s asynchronously, thereby allowing scaling the AMM without liquidity fragmentation
@StarkWareLtd 6/ By "asynchronous access" to the liquidity pool, @StarkWareLtd refers to the ability for one L2 to process dAMM transactions without mandatory communication with other L2s using the same dAMM L1 liquidity pool
@StarkWareLtd 7/ The dAMM achieves this by separating the liquidity pool from the pricing state. In this design, the contract agrees to provide whatever price is offered by the state as long as it has enough liquidity to fulfill the quote
@StarkWareLtd 8/ Since funds are decoupled from state, multiple states can be put on top of the same liquidity pool. By subsequently assigning each #L2 its own dAMM state, an asynchronous cross-L2 AMM is born
@StarkWareLtd 9/ Uniquely, the design supports multiple independent markets; some on L2 and some on L1, which are all sharing the same #AMM infrastructure and liquidity
@StarkWareLtd 10/ Compared to traditional AMM designs suffering under fragmented liquidity, this boasts multiple advantages. Since the AMM is available on multiple markets, it benefits from more trades, which in turn means more fee revenue being generated
@StarkWareLtd 11/ If more fees for the same liquidity are earned, this means better capital efficiency, which is likely to attract more liquidity and more liquidity means a better price for traders, restarting this virtuous cycle
@StarkWareLtd 12/ Additionally, in $ETH 2.0's danksharding’s design, the beacon blockchain will contain all the data from shards. This is achieved by having both Beacon blockchain and shard (rollup) data validated by a “committee” composed of validators
@StarkWareLtd 13/ In this way, transactions from the same beacon blockchain can freely access sharding data and transactions can be synchronized between rollups and the Ethereum base layer, greatly improving on data availability
@StarkWareLtd 14/ This greatly simplifies rollup structure as problems such as confirmation delay will no longer exist and opens up new possibilities of cross-rollup composability
@StarkWareLtd 15/ One example are synchronous calls of various L2s with an #L2 powered but $ETH L1-based AMM contract, taking the dAMM design to the next level
@StarkWareLtd If you liked this thread please support with a a follow & retweet 🙏
1 image on X
What came next · since 11 Jun 2022
Since then
Zero has written 2 more pieces on StarkWare since this one.