SPEEDEX: A Scalable, Parallelizable, and Economically Efficient Distributed EXchange

SPEEDEX is a decentralized exchange (DEX) that lets par-ticipants securely trade assets without giving any single party undue control over the market. SPEEDEX offers several ad-vantages over prior DEXes. It achieves high throughput—over 200,000 transactions per second on 48-core servers, even with tens of millions of open offers. SPEEDEX runs entirely within a Layer-1 blockchain, and thus achieves its scalability without fragmenting market liquidity between multiple blockchains or rollups. It eliminates internal arbitrage opportunities, so that a direct trade from asset A to B always receives as good a price as trading through some third asset such as USD. Finally, it prevents front-running attacks that would otherwise increase the effective bid-ask spread for small traders. SPEEDEX’s key design insight is its use of an Arrow-Debreu exchange market structure that fixes the valuation of assets for all trades in a given block of transactions. We construct an algorithm that is both asymptotically efficient and empirically practical that computes these valuations while exactly preserving a DEX’s financial correctness constraints. Not only does this market structure provide fairness across trades, but it also makes trade operations commutative and hence efficiently parallelizable. SPEEDEX is scheduled for deployment within one of the largest Layer-1 blockchains this year.

[1]  B. Ford,et al.  Flash Freezing Flash Boys: Countering Blockchain Front-Running , 2022, 2022 IEEE 42nd International Conference on Distributed Computing Systems Workshops (ICDCSW).

[2]  G. Danezis,et al.  Block-STM: Scaling Blockchain Execution by Turning Ordering Curse to a Performance Blessing , 2022, PPoPP.

[3]  Dong Zhou,et al.  Utilizing Parallelism in Smart Contracts on Decentralized Blockchains by Taming Application-Inherent Conflicts , 2022, 2022 IEEE/ACM 44th International Conference on Software Engineering (ICSE).

[4]  Lidong Zhou,et al.  Forerunner: Constraint-based Speculative Transaction Execution for Ethereum , 2021, SOSP.

[5]  A. Sonnino,et al.  Narwhal and Tusk: a DAG-based mempool and efficient BFT consensus , 2021, EuroSys.

[6]  Maher Alharby,et al.  The OpBench Ethereum opcode benchmark framework: Design, implementation, validation and experiments , 2021, Perform. Evaluation.

[7]  Idit Keidar,et al.  All You Need is DAG , 2021, PODC.

[8]  Arthur Gervais,et al.  Quantifying Blockchain Extractable Value: How dark is the forest? , 2021, 2022 IEEE Symposium on Security and Privacy (SP).

[9]  Srinath T. V. Setty,et al.  Byzantine Ordered Consensus without Byzantine Oligarchy , 2020, IACR Cryptol. ePrint Arch..

[10]  Ari Juels,et al.  Order-Fairness for Byzantine Consensus , 2020, IACR Cryptol. ePrint Arch..

[11]  Wuhui Chen,et al.  SkyChain: A Deep Reinforcement Learning-Empowered Dynamic Blockchain Sharding System , 2020, ICPP.

[12]  Eric Budish,et al.  Quantifying the High-Frequency Trading "Arms Race" , 2020, SSRN Electronic Journal.

[13]  Alvin Cheung,et al.  Handling Highly Contended OLTP Workloads Using Fast Dynamic Partitioning , 2020, SIGMOD Conference.

[14]  David Tse,et al.  Prism Removes Consensus Bottleneck for Smart Contracts , 2020, 2020 Crypto Valley Conference on Blockchain Technology (CVCBT).

[15]  Tien Tuan Anh Dinh,et al.  On Exploiting Transaction Concurrency To Speed Up Blockchains , 2020, 2020 IEEE 40th International Conference on Distributed Computing Systems (ICDCS).

[16]  Guillermo Angeris,et al.  An Analysis of Uniswap Markets , 2019, Cryptoeconomic Systems.

[17]  David Mazières,et al.  Fast and secure global payments with Stellar , 2019, SOSP.

[18]  Daniel Perez,et al.  Broken Metre: Attacking Resource Metering in EVM , 2019, NDSS.

[19]  László A. Végh,et al.  Auction Algorithms for Market Equilibrium with Weak Gross Substitute Demands , 2019, STACS.

[20]  Niaz Chowdhury Stellar , 2019, Inside Blockchain, Bitcoin, and Cryptocurrencies.

[21]  Ittai Abraham,et al.  HotStuff: BFT Consensus with Linearity and Responsiveness , 2019, PODC.

[22]  Kuang-Ching Wang,et al.  The Design and Operation of CloudLab , 2019, USENIX ATC.

[23]  Massimo Bartoletti,et al.  A True Concurrent Model of Smart Contracts Executions , 2019, COORDINATION.

[24]  Ari Juels,et al.  Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges , 2019, ArXiv.

[25]  Srinivas Devadas,et al.  LiTM: A Lightweight Deterministic Software Transactional Memory System , 2019, PMAM@PPoPP.

[26]  Maurice Herlihy,et al.  An Empirical Study of Speculative Concurrency in Ethereum Smart Contracts , 2019, Tokenomics.

[27]  Wei Yu,et al.  A Parallel Smart Contract Model , 2018, ICML 2018.

[28]  László A. Végh,et al.  A strongly polynomial algorithm for linear exchange markets , 2018, STOC.

[29]  Sweta Kumari,et al.  An Efficient Framework for Optimistic Concurrent Execution of Smart Contracts , 2018, 2019 27th Euromicro International Conference on Parallel, Distributed and Network-Based Processing (PDP).

[30]  Angelo De Caro,et al.  Hyperledger fabric: a distributed operating system for permissioned blockchains , 2018, EuroSys.

[31]  Ying Wang,et al.  An Adaptive Gas Cost Mechanism for Ethereum to Defend Against Under-Priced DoS Attacks , 2017, ISPEC.

[32]  Silvio Micali,et al.  Algorand: Scaling Byzantine Agreements for Cryptocurrencies , 2017, IACR Cryptol. ePrint Arch..

[33]  Maurice Herlihy,et al.  Adding concurrency to smart contracts , 2017, Distributed Computing.

[34]  Stephen P. Boyd,et al.  CVXPY: A Python-Embedded Modeling Language for Convex Optimization , 2016, J. Mach. Learn. Res..

[35]  Jean-Philippe Aumasson,et al.  The BLAKE2 Cryptographic Hash and Message Authentication Code (MAC) , 2015, RFC.

[36]  Eric Budish,et al.  The High-Frequency Trading Arms Race: Frequent Batch Auctions as a Market Design Response , 2015 .

[37]  Eric Budish,et al.  Implementation Details for Frequent Batch Auctions: Slowing Down Markets to the Blink of an Eye † , 2014 .

[38]  Austin T. Clements,et al.  The scalable commutativity rule: designing scalable software for multicore processors , 2013, SOSP.

[39]  Eddie Kohler,et al.  Speedy transactions in multicore in-memory databases , 2013, SOSP.

[40]  Nikhil R. Devanur,et al.  A Rational Convex Program for Linear Arrow-Debreu Markets , 2013, ACM Trans. Economics and Comput..

[41]  Stephen P. Boyd,et al.  ECOS: An SOCP solver for embedded systems , 2013, 2013 European Control Conference (ECC).

[42]  Kurt Mehlhorn,et al.  A combinatorial polynomial algorithm for the linear Arrow-Debreu market , 2012, Inf. Comput..

[43]  M. Yannakakis,et al.  The complexity of non-monotone markets , 2012, STOC '13.

[44]  Nuno M. Preguiça,et al.  Making Geo-Replicated Systems Fast as Possible, Consistent when Necessary , 2012, OSDI.

[45]  Eiji Oki,et al.  GLPK (GNU Linear Programming Kit) , 2012 .

[46]  P. Kovács,et al.  Efficient implementations of minimum-cost flow algorithms , 2012, ArXiv.

[47]  Daniel J. Abadi,et al.  Calvin: fast distributed transactions for partitioned database systems , 2012, SIGMOD Conference.

[48]  Stephen P. Boyd,et al.  Convex Optimization , 2004, IEEE Transactions on Automatic Control.

[49]  吕一旭 Yixu Lu 引言 (Introduction) , 2009, Provincial China.

[50]  Yinyu Ye,et al.  A path to the Arrow–Debreu competitive market equilibrium , 2007, Math. Program..

[51]  Bruno Codenotti,et al.  Market equilibrium via the excess demand function , 2005, STOC '05.

[52]  Sriram V. Pemmaraju,et al.  On the polynomial time computation of equilibria for certain exchange economies , 2005, SODA '05.

[53]  Robbert van Renesse,et al.  Chain Replication for Supporting High Throughput and Availability , 2004, OSDI.

[54]  Kamal Jain,et al.  A polynomial time algorithm for computing an Arrow-Debreu market equilibrium for linear utilities , 2004, 45th Annual IEEE Symposium on Foundations of Computer Science.

[55]  Nikhil R. Devanur,et al.  An Improved Approximation Scheme for Computing Arrow-Debreu Prices for the Linear Case , 2003, FSTTCS.

[56]  Amin Saberi,et al.  Approximating Market Equilibria , 2003, RANDOM-APPROX.

[57]  M. Benzi Preconditioning techniques for large linear systems: a survey , 2002 .

[58]  Miguel Oom Temudo de Castro,et al.  Practical Byzantine fault tolerance , 1999, OSDI '99.

[59]  Wei Hu,et al.  Scalability in the XFS File System , 1996, USENIX Annual Technical Conference.

[60]  A. Schrijver Theory of linear and integer programming , 1986, Wiley-Interscience series in discrete mathematics and optimization.

[61]  L. Hurwicz,et al.  ON THE STABILITY OF THE COMPETITIVE EQUILIBRIUM, I1 , 1958 .

[62]  K. Arrow,et al.  EXISTENCE OF AN EQUILIBRIUM FOR A COMPETITIVE ECONOMY , 1954 .

[63]  A. Smithies The Stability of Competitive Equilibrium , 1942 .

[64]  David Mazières,et al.  Batch Exchanges with Constant Function Market Makers: Axioms, Equilibria, and Computation , 2022, ArXiv.

[65]  M. Virza,et al.  A High Performance Payment Processing System Designed for Central Bank Digital Currencies , 2022, IACR Cryptol. ePrint Arch..

[66]  Christopher Goes,et al.  Anoma: Undefining Money , 2021 .

[67]  C. Cachin,et al.  Secure Causal Atomic Broadcast , 2021 .

[68]  H. Adams,et al.  Uniswap v2 Core , 2020 .

[69]  Neha Narula,et al.  ClockWork: An Exchange Protocol for Proofs of Non Front-Running , 2020 .

[70]  Eli Ben-Sasson,et al.  Scalable, transparent, and post-quantum secure computational integrity , 2018, IACR Cryptol. ePrint Arch..

[71]  D. Wang,et al.  Loopring: A Decentralized Token Exchange Protocol , 2018 .

[72]  S. Matthew Weinberg,et al.  Arbitrum: Scalable, private smart contracts , 2018, USENIX Security Symposium.

[73]  A. Yakovenko Solana : A new architecture for a high performance blockchain v 0 . 8 , 2018 .

[74]  Joseph Poon,et al.  Plasma : Scalable Autonomous Smart Contracts , 2017 .

[75]  DR. Gavin Wood POLKADOT: VISION FOR A HETEROGENEOUS MULTI-CHAIN FRAMEWORK , 2016 .

[76]  S. Nakamoto,et al.  Bitcoin: A Peer-to-Peer Electronic Cash System , 2008 .

[77]  L. Armijo Minimization of functions having Lipschitz continuous first partial derivatives. , 1966 .