Automated Market Makers (AMM) are a type of decentralized exchange (DEX) that use algorithms to make it easier for individual traders to buy and sell crypto assets. AMMs automate the process of setting prices and linking orders on the exchange, typically using an algorithm to determine the prices at which buyers and sellers can trade the assets. Let's see how they work, what types there are and what the most popular protocols are.
What is an Automated Market Maker?
Automated Market Makers (AMM) are a type of decentralized exchange (DEX) that use algorithms to make it easier for individual traders to buy and sell crypto assets. Translated into Spanish it means automated market makers. Instead of trading directly with other people, as in a traditional order book, users trade directly through the AMM. Market makers are entities in charge of providing liquidity to a tradable asset on an exchange which might otherwise lack liquidity. Market Makers Do It buying and selling assets from your own accounts with the aim of making a profit, often from the spread, that is, the difference between the highest bid to buy and the lowest bid to sell. Your commercial activity creates liquidity, reducing the price impact of larger trades. Although other types of decentralized exchange (DEX) designs exist, AMM-based DEXs have become extremely popular, providing high liquidity for a wide range of digital tokens.
Operation of a token exchange in a Uniswap pool. Source: Shrimpy Academy.
How does an Automated Market Maker work?
The AMMs automate the process of setting prices and linking orders on the exchange, typically using an algorithm to determine the prices at which buyers and sellers can trade the assets. This means that Users can buy and sell crypto assets reliably, peer-to-peer, without needing to rely on a custodian or other third party. Over time they have gained popularity for their simplicity, ease of use and low commissions. Traders can open and close positions quickly without having to worry about order types, order matching, or other complexities of traditional exchanges. Additionally, AMM exchanges are often faster and more secure than centralized counterparts, as they work with smart contracts and are protected by the underlying blockchain network.
Process of executing an order in an AMM. Source: Shrimpy Academy.
What types of AMM formulas are there?
We can differentiate different types of AMM formulas, which we will list below:
- Constant Product Market Maker (CPMM): The first type of CFMM to emerge was the constant product market maker (CPMM), popularized by the first AMM-based DEX, Bancor. The CPMMs are based on the function x*y=k, which sets a price range for two tokens based on the available quantities (liquidity) of each token. When the supply of token high, approaching infinity at both ends.
- Constant Function Market Maker (CFMM): This type is usually used for operations in secondary markets and usually accurately reflects, as a result of arbitrage, the price of individual assets in the reference markets. For example, if the CFMM price is lower than the reference market price, arbitrageurs will buy the asset on the CFMM and sell it on an order book-based exchange for a profit.
- Constant Sum Market Maker (CSMM): This type is ideal for zero price impact trading but does not provide infinite liquidity. The CSMMs follow the formula x+y=k, which creates a straight line when drawn. Unfortunately, this design allows arbitrageurs to drain one of the reserves if the off-chain reference price between the tokens is not 1:1. Such a situation would destroy one side of the liquidity pool, leaving all liquidity residing in just one of the assets and therefore leaving no more liquidity for traders. Because of this, CSMM is a model that is rarely used by AMMs.
-
Constant Middle Market Maker (CMMM): This type allows the creation of AMMs that can have more than two tokens and be weighted outside of the standard 50/50 distribution. In this model, the weighted geometric mean of each reserve remains constant. For a liquidity fund with three assets, the equation would be the following: (x*y*z)^(â…“)=k. This allows variable exposure to different assets in the group and allows swaps to be made between any of the assets in the group.
Different AMM formula curves. Source: Curve.fi.
What should be taken into account about AMMs?
- Impermanent loss: Impermanent loss (or impermanent loss in English) is a loss to which our cryptocurrencies are exposed when they are in a liquidity pool. This loss usually occurs when the proportion of tokens in the liquidity pool becomes unbalanced.
- Penalty for withdrawing liquidity: When an LP wishes to withdraw liquidity that it has contributed to the protocol, it may be penalized since such withdrawal may negatively affect the pool by increasing slippage.
- Slippage: This concept is the difference between the cash price and the realized price of an operation. We can relate these to the spreads present in centralized exchanges.
- Exchange and network fee: Every time we carry out a token exchange in a liquidity pool, we must pay the corresponding commission to the LPs for supplying us with the assets. In turn, each interaction that we carry out with the protocol will be subject to the commissions of each blockchain where the action is carried out.
Most popular AMM protocols
- uniswap: Uniswap was one of the first decentralized finance (or DeFi) applications to gain significant traction on Ethereum: it launched in November 2018. Since then, many other decentralized exchanges have launched (including Curve, SushiSwap, and Balancer), but Uniswap is currently the most popular by a significant margin. As of April 2021, Uniswap had processed more than $10 billion in weekly transaction volume.
- DAO Curve: Curve is a decentralized stablecoin exchange that uses an automated market maker (AMM) to manage liquidity. Launched in January 2020, Curve is now synonymous with the decentralized finance (DeFi) phenomenon and has seen significant growth in the second half of 2020. In August, Curve launched a decentralized autonomous organization (DAO), with CRV as its internal token . The DAO uses the Ethereum-based creation tool called Aragon to connect multiple smart contracts used for users' deposited liquidity. Issues such as governance, however, differ from Aragon in their weighting and other aspects.
- Pancakeswap: PancakeSwap is a decentralized exchange based on BNB Chain (formerly BSC and Binance Chain) instead of Ethereum. It allows its users to exchange BEP-20 standard tokens easily. The original idea of ​​DeFi and DEX was to decentralize global finance. Crypto experts envisioned a system where there would be no need for centralized exchanges either. Uniswap and SushiSwap emerged as market leaders. But there was a skewed trend with most of the DApps developed on the Ethereum blockchain. This over-reliance on the Ethereum network created challenges such as slow transaction speeds and high gas fees.
- osmosis: Osmosis is an advanced automated market making (AMM) protocol that allows developers to create custom AMMs with sovereign liquidity pools. Built with the Cosmos SDK, Osmosis uses Inter-Blockchain Communication (IBC) to enable cross-chain transactions. Osmosis allows users to launch liquidity pools with unique parameters such as bonding curves and multi-weighted asset pools. Osmosis' incentive structure is also adaptable. Governance implements liquidity rewards (LP) for specific groups, allowing for strategically targeted incentives.
- 1Inch: 1inch Network is a decentralized exchange (DEX) aggregator solution that seeks deals across multiple liquidity sources, offering users better commissions than any individual exchange. 1inch's aggregation protocol incorporates the Pathfinder algorithm to find the best routes across 300+ liquidity sources across 10 chains. The 1inch Liquidity Protocol is a next-generation automated market maker (AMM) that protects users from front-end attacks and offers attractive opportunities to liquidity providers.
- balancers: Balancer is an automated market maker (AMM) that was developed on the Ethereum blockchain and launched in March 2020. Placeholder and Accomplice were able to raise a seed round of $3 million. The Balancer protocol functions as a self-balancing weighted portfolio, price sensor, and liquidity provider. It allows users to earn through its newly introduced token ($BAL) by contributing to customizable liquidity pools.