Blockchain-Based Automated Market Makers for a Decentralized Stock Exchange
Abstract
:1. Introduction
- Liquidity: This means the availability of buyers and sellers at a given time. An asset being sold in the market is said to be liquid if it can be bought and sold easily without any time delay. Market makers may be appointed to provide liquidity for one or multiple assets depending on the market [3].
- Price discovery: When an asset is being listed in a market, the price of the asset must be decided by someone based on the supply and demand; this responsibility is also taken up by market makers.
- Price continuity: The prices, once discovered, must change continuously in a positive or negative direction based on supply and demand. The prices should not jump from one point to another in a random order. The market makers make sure that the starting price in a given day is not very far off from the previous day’s closing price, thus providing price continuity.
- Order flow.
- Supply and demand data of a given asset or stock.
- Origin of trade (information about traders themselves).
- Anonymity of the trader (optional).
- Transparency of market orders.
- Equal access to all market information.
- Speed of information access and speed of execution should be the same for every participant in the market.
- To give the reader an understanding of how automated market makers work.
- To explore how the technology can be used to build a decentralized stock exchange.
- To discuss the proposed consensus mechanism and decentralized stock exchange.
- To compare different automated market-making formulas.
- To compare centralized exchanges (CEXs) and decentralized exchanges (DEXs).
2. Literature Survey
2.1. Distributed Ledger (Blockchain) Technology [6]
Properties of Distributed Ledger
2.2. Decentralized Exchanges
2.3. Automated Market Makers [13]
3. Working of Automated Market Makers (AMMs)
- Liquidity pools: An AMM operates through liquidity pools, which are pools of tokens that are locked in smart contracts. These pools are created by users who contribute an equal value to two different tokens. The ratio of tokens in the pool determines the price of the assets in the pool.
- Mathematical algorithms: AMMs use mathematical algorithms to determine the price of assets in the pool. The most common algorithm used in AMMs is the constant product market-maker algorithm, which is also known as the X × Y = K formula.
- Trading interface: AMMs provide a simple trading interface for users to buy and sell tokens in the pool. Users do not need to specify a price or a counterparty for their trades, as the price is determined automatically by the algorithm.
- Incentives: To encourage users to contribute liquidity to the pool, AMMs offer incentives in the form of transaction fees and liquidity provider (LP) tokens. LP tokens are given to users who contribute liquidity to the pool, and they represent a share of the pool’s total value. LP token holders earn a portion of the transaction fees paid by traders using the AMM.
- Smart contracts: All operations on AMMs are executed through smart contracts on a blockchain network. These smart contracts automatically execute trades, adjust prices, and distribute transaction fees and LP tokens to users.
3.1. Constant Product Market Makers
3.2. Constant Sum Market Makers
3.3. Constant Mean Market Makers
3.4. Hybrid Constant Function Market Maker
4. The Proposed Consensus Mechanism and Decentralized Stock Exchange
4.1. Highway Consenses Protocol
- Single validator attack: A single validator must deliberately violate the protocol to invert the block. This is the minimum number of misbehaving validators required to invert a block [20].
- Sudden power loss: In case of sudden power loss or system failure, a certain number of validators must be offline or unable to participate in the consensus process to invert the block [20].
- Byzantine attack: In case of a Byzantine attack, where validators intentionally act maliciously, a certain number of validators must collude to invert the block [20].
Algorithm 1: Fork Selection Process Based on GHOST Rule |
|
4.2. Proposed Decentralized Stock Exchange
Exchange Model
5. Results and Performance Analysis
5.1. Performance Analysis of the Consenses Protocol
5.2. Performance Analysis Protocol of Centralized (CEXs) and Decentralized (DEXs) Market Makers
6. Discussion
- Faster exchange: In regular exchanges, the traders must wait until their offers are accepted by a counterpart for their trade to be executed. If a counter offer is not available, then the trade may not go through. AMMs allow for an exchange to occur immediately as the pools with reserves are readily available for trade, and there is no need to wait for order matching, which makes it perfect for markets with both high and low liquidity.
- AMMs for price discovery: AMMs can act as source of price discovery, as the prices shown by AMMs are usually a reflection of the original prices of the asset outside the exchange because of the action of arbitrageurs.
- Path independence: In regular exchanges, the path taken while placing the order heavily affects the price at which the asset is bought or sold. This is because some participants who have access to the order sequence use the information against uninformed participants to trade against them.
- The first major drawback is slippage. This refers to the property of prices to move against a trader’s actions as the trader consumes the reserve: the larger the consumption, the greater the slippage. AMM trades sometimes face huge slippage costs, which must be incurred by the traders.
- Another major issue faced by AMMs is impermanent loss. This loss refers to the opportunity cost faced by the LPs when they have their assets locked in the reserves.
- The third biggest hurdle in the adoption of AMMs is the high gas prices charged for transaction settlement by the underlying blockchain consensus mechanisms. Most blockchains use proof-of-work algorithms, which are resource-intensive consensus mechanisms; hence, the higher the number of transactions, the higher the gas fees the participants end up paying.
7. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Jiang, C.; Liang, K.; Chen, H.; Ding, Y. Analyzing market performance via 835 social media: A case study of a banking industry crisis. Sci. China Inf. Sci. 2014, 57, 1–18. [Google Scholar]
- Li, Q.; Chen, Y.; Wang, J.; Chen, Y.; Chen, H. Web Media and Stock Markets: A Survey and Future Directions from a Big Data Perspective. IEEE Trans. Knowl. Data Eng. 2018, 30, 381–399. [Google Scholar] [CrossRef]
- Yang, Y. The Measure of Liquidity in Futures Market. In Proceedings of the 2006 IEEE International Conference on Management of Innovation and Technology, Singapore, 21–23 June 2006; pp. 320–324. [Google Scholar] [CrossRef]
- Kajtazi, M. Information asymmetry in the digital economy. In Proceedings of the 2010 International Conference on Information Society, London, UK, 28–30 June 2010; pp. 135–142. [Google Scholar] [CrossRef]
- Dhillon, V.; Metcalf, D.; Hooper, M. Blockchain Enabled Applications: Understand the Blockchain Ecosystem and How to Make It Work for You, 1st ed.; Apress: New York, NY, USA, 2017. [Google Scholar]
- Soltani, R.; Zaman, M.; Joshi, R.; Sampalli, S. Distributed Ledger Technologies and Their Applications: A Review. Appl. Sci. 2022, 12, 7898. [Google Scholar] [CrossRef]
- Alkafaji, B.K.A.; Dashtbayaz, M.L.; Salehi, M. The Impact of Blockchain on the Quality of Accounting Information: An Iraqi Case Study. Risks 2023, 11, 58. [Google Scholar] [CrossRef]
- Buterin, V. A Next Generation Smart Contract and Decentralized Application Platform. 2013. Available online: www.theblockchain.com/docs/Ethereum-white-paper-a-nextgeneration-smartcontract-anddecentralized-application-platform-vitalik-buterin.pdf (accessed on 1 September 2022).
- Conte de Leon, D.; Stalick, A.Q.; Jillepalli, A.A.; Haney, M.A.; Sheldon, F.T. Blockchain: Properties and misconceptions. Asia Pac. J. Innov. Entrep. 2017, 11, 286–300. [Google Scholar] [CrossRef]
- Mahdi, S.; Mehdi, B.; Mohammad, A. Structural shocks in monetary policy, exchange rates, and stock prices using SVAR in Iran. Int. J. Islam. Middle East. Financ. Manag. 2021; ahead-of-print. [Google Scholar] [CrossRef]
- Zheng, G.; Gao, L.; Huang, L.; Guan, J. Ethereum Smart Contract Development in Solidity; Springer: Berlin/Heidelberg, Germany, 2021. [Google Scholar]
- Lin, L.X. Deconstructing Decentralized Exchanges. Stanf. J. Blockchain Law Policy 2019, 2, 58–77. [Google Scholar]
- Mohan, V. Automated market makers and decentralized exchanges: A DeFi primer. Financ. Innov. 2022, 8, 20. [Google Scholar] [CrossRef]
- Adams, H.; Zinsmeister, N.; Robinson, D. Uniswap V2 Core; Uniswap: New York, NY, USA, 2020. [Google Scholar]
- Alex, P.; Tiruviluamala, N. Mixing Constant Sum and Constant Product Market Makers. arXiv 2022, arXiv:2203.12123. [Google Scholar]
- Yuliya, G. A Conceptual Framework for Digital-Asset Securities: Tokens and Coins as Debt and Equity. Md. Law Rev. 2020, 80, 166. [Google Scholar]
- Dossa, A.; Ruiz, P.; Vogelsteller, F.; Gosselin, S. Security Token Standard. Available online: https://github.com/ethereum/eips/issues/1411 (accessed on 23 September 2022).
- Bahga, A.; Madisetti, V.K. Blockchain Platform for Industrial Internet of Things. J. Softw. Eng. Appl. 2016, 9, 533–546. [Google Scholar] [CrossRef]
- Christian, S.; Bernd, S.; Martin, S. Prediction Market Performance and Market Liquidity: A Comparison of Automated Market Makers. IEEE Trans. Eng. Manag. 2013, 60, 169–185. Available online: https://ssrn.com/abstract=2476333 (accessed on 16 January 2023).
- Abhishek, G.; Mohanta, B.K.; Mohapatra, H.; Al-Turjman, F.; Altrjman, C.; Yadav, A. A Survey on Consensus Protocols and Attacks on Blockchain Technology. Appl. Sci. 2023, 13, 2604. [Google Scholar] [CrossRef]
- Schwarz-Schilling, C.; Neu, J.; Monnot, B.; Asgaonkar, A.; Tas, E.N.; Tse, D. Three Attacks on Proof-of-Stake Ethereum. In Financial Cryptography and Data Security FC 2022; Eyal, I., Garay, J., Eds.; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2022; Volume 13411. [Google Scholar] [CrossRef]
- Jiao, J.; Lin, S.W.; Sun, J. A Generalized Formal Semantic Framework for Smart Contracts. In Fundamental Approaches to Software Engineering FASE 2020; Wehrheim, H., Cabot, J., Eds.; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2020; Volume 12076. [Google Scholar] [CrossRef]
- Zinsmeister, N.; Robinson, D.; Adams, H.; Salem, M.; Chriseth; Jepsen, W. Uniswap v2 Core Contracts. Available online: https://github.com/Uniswap/v2-core (accessed on 13 October 2022).
- Zinsmeister, N.; Salem, M.; Bukov, A.; Adams, H. Uniswap v2 Periphery Contracts. Available online: https://github.com/Uniswap/v2-periphery (accessed on 13 October 2022).
- Sedlmeir, J.; Lautenschlager, J.; Fridgen, G.; Urbach, N. The transparency challenge of blockchain in organizations. Electron. Mark. 2022, 32, 1779–1794. [Google Scholar] [CrossRef] [PubMed]
Type | Trade Execution Speed | Availability during High Liquidity | Availability during Low Liquidity | Types of Orders | Scope for Market Manipulation | Scope for Market Failure |
---|---|---|---|---|---|---|
Centralized exchanges using regular market makers | Depends on the Liquidity | Yes | No | Multiple | High | High |
Decentralized exchanges using AMM | Immediate | Yes | Yes | Limited | Low | Low |
Type | Balancing | Slippage | Useful in Exchanging Stocks | Dynamic AMM | Flexibility in Asset Class |
---|---|---|---|---|---|
Constant product AMM | Yes | Yes | Yes | Yes (newer versions) | High |
Constant Sum AMM | No | No | Yes | No | High |
Stable swap AMM | Yes | Minimal | No | Yes | Only assets that are equally priced |
Constant sum with varying weights AMM | Yes | Yes | Yes (as a portfolio manager) | No | High |
Consensus Algorithm | PoW | PoS | Highway Protocol |
---|---|---|---|
Block creation | Block creation | Block creation | Block creation |
Security issues | Security issues | Security issues | Security issues |
Energy consumption | Very high | High | Low |
Transaction per second | 7–30 | 30–175 | 100–2500 |
Reliability | High | Low | Low |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Dodmane, R.; K. R., R.; N. S., K.R.; Kallapu., B.; Shetty, S.; Aslam, M.; Jilani, S.F. Blockchain-Based Automated Market Makers for a Decentralized Stock Exchange. Information 2023, 14, 280. https://doi.org/10.3390/info14050280
Dodmane R, K. R. R, N. S. KR, Kallapu. B, Shetty S, Aslam M, Jilani SF. Blockchain-Based Automated Market Makers for a Decentralized Stock Exchange. Information. 2023; 14(5):280. https://doi.org/10.3390/info14050280
Chicago/Turabian StyleDodmane, Radhakrishna, Raghunandan K. R., Krishnaraj Rao N. S., Bhavya Kallapu., Surendra Shetty, Muhammad Aslam, and Syeda Fizzah Jilani. 2023. "Blockchain-Based Automated Market Makers for a Decentralized Stock Exchange" Information 14, no. 5: 280. https://doi.org/10.3390/info14050280
APA StyleDodmane, R., K. R., R., N. S., K. R., Kallapu., B., Shetty, S., Aslam, M., & Jilani, S. F. (2023). Blockchain-Based Automated Market Makers for a Decentralized Stock Exchange. Information, 14(5), 280. https://doi.org/10.3390/info14050280