تسجيل الدخول
تسجيل حساب جديد
امسح رمز الاستجابة السريعة لتنزيل تطبيق الهاتف المحمول
المزيد من خيارات التنزيل
الإشعارات
الأسواق والأسعار
لا توجد إشعارات جديدة
المزيد
اختر اللغة والمنطقة
简体中文
English
Tiếng Việt
繁體中文
Español
Русский
Français (Afrique)
Português (Portugal)
ไทย
Indonesia
日本語
بالعربية
Українська
Português (Brasil)
لون الارتفاع / الهبوط
أحمر للارتفاع والأخضر للسقوط
أخضر للارتفاع والأحمر للسقوط
وقت بداية ونهاية التغيير٪
24 ساعة على مدار الساعة
UTC 00:00
UTC+8 00:00
Gate.io
BLOG
Lights and shadows on Automated Market M...
Lights and shadows on Automated Market Makers (AMM)
2023-03-02, 04:11
[//]:content-type-MARKDOWN-DONOT-DELETE ![](https://gimg2.gateimg.com/image/article/167773010511.png) Constant product automated market makers (AMMs) are a type of decentralized exchange (DEX) algorithm that allows users to trade cryptocurrencies without an order book. The algorithm sets the price of a particular cryptocurrency based on a mathematical formula that ensures the product of the quantities of two different cryptocurrencies in a liquidity pool remains constant. The constant product AMM uses a fixed mathematical equation to determine the price of a particular cryptocurrency based on the balance of tokens in a liquidity pool. The equation is: x * y = k where x and y are the quantities of two different tokens in the liquidity pool, and k is a constant value that represents the initial product of the two token balances in the pool. When a trader buys one token, they decrease the pool's supply of that token while increasing the supply of another token, and vice versa when they sell. AMMs have gained popularity due to their simplicity and low fees. They eliminate the need for order books, which can be complicated to maintain and can cause liquidity issues, especially for smaller markets. In addition, AMMs like <a href="/ar/price/uniswap-uni" target="_blank" class="blog_inner_link">Uniswap</a> and SushiSwap are permissionless, meaning anyone can participate in the liquidity pool by providing their own tokens and earning trading fees in return. Automated market makers were first introduced in a 2017 whitepaper by a team of researchers led by Dan Robinson and Vitalik Buterin. The paper proposed a new type of decentralized exchange that used a formulaic approach to pricing and liquidity provision, rather than the traditional order book model used by centralized exchanges. The first implementation of an automated market maker was Bancor, which launched in 2017. Bancor used a similar approach to the constant product formula used by modern AMMs, but with some key differences. Bancor's pricing algorithm used a "connector weight" parameter that could be adjusted to balance the supply and demand of the tokens in the liquidity pool. In 2018, <a href="/ar/price/uniswap-uni" target="_blank" class="blog_inner_link">Uniswap</a> was launched by Hayden Adams, which introduced the constant product formula as the pricing algorithm for its AMM. This innovation was significant because it eliminated the need for an adjustable parameter, making the pricing algorithm simpler and more transparent. Since then, a number of other AMMs have emerged, including SushiSwap, Curve, <a href="/ar/price/balancer-bal" target="_blank" class="blog_inner_link">Balancer</a>, and more. These AMMs have different features and design choices, but they all use some form of automated market-making algorithm to determine the price and liquidity of the tokens in their liquidity pools. One of the biggest criticisms of AMMs is their susceptibility to impermanent loss, which is the difference between the expected value and the actual value of an LP's tokens in the liquidity pool due to changes in the price ratio of the tokens. When the price ratio of the tokens in the pool changes significantly, the LP may experience a loss of value compared to simply holding the tokens outside of the pool. For example, suppose a liquidity pool has 10 ETH and 1000 DAI tokens. The value of the pool (k) is 10 ETH * 1000 DAI = 10,000 ETH-DAI. If a trader wants to buy 1 ETH, the algorithm will calculate the new price based on the constant product formula, so: 10 ETH * 1000 DAI = 10,000 ETH-DAI (10 + 1) ETH * y = 10,000 ETH-DAI y = 1000 / 11 = 90.9 DAI The trader will need to swap 90.9 DAI to receive 1 ETH. After the trade, the new pool balance will be 11 ETH and 909.1 DAI, keeping the constant product (k) the same. Impermanent loss is a risk that liquidity providers must consider when providing tokens to a constant product AMM. They may experience impermanent loss if the price of the tokens in the pool changes significantly, and they may not earn as much as they would have simply holding onto their tokens outside the pool. Slippage is another factor to consider when trading on a constant product automated market maker. It is the difference between the expected price and the actual execution price of a trade due to the change in the pool's token balance. As the pool's liquidity changes, the execution price may deviate from the expected price, resulting in slippage. For example, if a trader wants to buy a large amount of a token that has a small share of the liquidity pool, the execution price may be significantly higher than the current market price. This is because trade will cause a larger deviation in the pool's token balance, resulting in more slippage. Slippage can be mitigated by ensuring that the liquidity pool has sufficient depth and by using limit orders instead of market orders. Limit orders allow traders to set a maximum or minimum price they are willing to pay for a token, reducing the risk of significant slippage. Besides impermanent loss and slippage, there are a number of other risks associated with automated market makers. Most notably: 1.Flash loan attacks: Flash loans are a type of loan that can be taken out and repaid within the same transaction. This can be used to manipulate the token prices in an AMM, resulting in significant gains for the attacker. For example, a flash loan attack could be used to manipulate token prices in a liquidity pool and cause the AMM to buy the attacker's tokens at an artificially high price. 2.Smart contract vulnerabilities: Smart contract vulnerabilities can be exploited to steal user funds or manipulate token prices in an AMM. For example, if there is a vulnerability in the smart contract code, an attacker may be able to withdraw user funds from the liquidity pool. 3.Governance risks: Many AMMs are governed by decentralized autonomous organizations (DAOs), which may face governance risks if there is a lack of transparency or if a minority group of users hold a disproportionate amount of voting power. For example, if a small group of users hold a significant amount of voting power, they may be able to influence the governance decisions of the AMM to their advantage. 4.Regulatory risks: As the regulatory landscape for cryptocurrency continues to evolve, there is a risk that AMMs could face regulatory action or legal challenges. For example, if an AMM violates securities laws, it may face legal action from regulators. 5.Liquidity risks: While AMMs are designed to provide liquidity for smaller markets and assets, there is still a risk of low liquidity, which can lead to wider bid-ask spreads and higher slippage. For example, if there is low liquidity in a liquidity pool, a trader may not be able to execute a trade at the desired price. 6.Oracle risks: AMMs rely on price feeds from oracles, which are external sources of price data. If the oracle is manipulated or compromised, it could result in inaccurate pricing on the AMM. For example, if an attacker is able to manipulate the price data on the oracle, they may be able to profit from trades on the AMM. 7.Front-running risks: Front-running is a type of transaction that occurs when a trader places an order to buy or sell a token in front of another trader's order, taking advantage of the price movement caused by the original order. This can be a risk for AMMs, as the open and transparent nature of the order book makes it easier for front-runners to identify profitable trades. For example, a front-runner may be able to see that a large order is about to be executed on the AMM and place their own order in front of it, resulting in a profit for the front-runner. Overall, while AMMs have many benefits, there are still several risks associated with their use. Traders and liquidity providers should carefully consider these risks before engaging with an AMM, and take appropriate precautions to mitigate them. As with any decentralized application, it's important for users to be aware of the risks and take appropriate precautions to protect their funds. AMMs represented one of the largest innovative movements in crypto fueling the rise of decentralized trading, as well as providing traders with a simple and accessible way to swap between different cryptocurrencies without the need for a centralized exchange or order book. While DEXs and AMMs have their place in the cryptocurrency ecosystem, they are not yet a substitute for centralized exchanges for many market participants. ***Disclosure: This article was written in partnership with DWF Labs, a market maker and Gate.io institutional client. For more information on DWF Labs, visit [www.dwf-labs.com](www.dwf-labs.com "www.dwf-labs.com")*** <div class="blog-details-info"> <div>Author:** DWF Labs.** <div class="info-tips">\*This article represents only the views of the researcher and does not constitute any investment suggestions. <div class="info-tips">\*No content herein shall constitute investment advice and does not constitute any offer or solicitation to offer or recommendation of any investment product or project. <div class="info-tips">\*The inclusion of any third-party products, services, entities, or content does not constitute an endorsement, recommendation, or affiliation by Gate.io. Please conduct thorough research and seek professional advice before making any investment decisions. <div class="info-tips">\*Gate.io reserves all rights to this article. Reposting of the article will be permitted provided Gate.io is referenced. In all cases, legal action will be taken due to copyright infringement. </div>
مشاركة
Credit Ranking
Complete Gate Post tasks to upgrade your rank
Join Now
مقالات ذات صلة
Institutional
Crypto Funds 101: Fund Classification
As an introduction to crypto funds, this article covers categories of crypto funds in the crypto market nowadays.
2023-02-03, 06:31
Institutional
How does Market Making work?
Learn about the mechanism of market making and its crucial role in ensuring market stability.
2023-01-25, 06:31
Institutional
What is Market Making?
Learn about market makers and how they improve financial market stability and liquidity for investment decisions.
2023-01-19, 04:22