Automated market makers (AMMs) make it easier for decentralized exchanges to provide liquidity in a secure, decentralized manner. Read on to learn what automated market makers are, how they work, and what different types of AMMs you can use.
What Is an Automated Market Maker (AMM)?
An automated market maker (AMM) is a protocol that facilitates decentralized trading through the use of smart contracts and liquidity pools that replace the centralized crypto exchange’s orderbook. They are the brainchild of Ethereum cofounder Vitalik Buterin.
AMMs enable crypto traders to trade with one another without the need for a central authority operating an orderbook to match buyers and sellers. Instead, AMMs use mathematical formulas to price digital assets based on liquidity pool balances while offering liquidity providers (LPs) a share of the trading fees as an incentive to provide liquidity to a trading pool.
How Does an Automated Market Maker Work?
An AMM involves a smart contract responsible for adjusting the prices of trading pairs in a liquidity pool depending on their current supply and demand on the decentralized trading platform.
Since there is no order book, the smart contract is programmed with a specific formula that determines the price for an asset based on trading activities within the pool. Traders trade with the smart contract as opposed to another trader directly. That is possible thanks to the liquidity held in the smart contract.
Here’s how it generally works.
- A trader deposits (typically two) assets into a liquidity pool on a decentralized reading protocol.
- The AMM uses an algorithmic pricing formula to ensure that there is enough liquidity to fulfill trades.
- Traders can swap one crypto asset for another in a matter of seconds by trading directly with the liquidity pool.
- The asset ratios in the liquidity pool adjust as more trading occurs, especially during volatile market movements, ensuring that prices continue to move in line with supply and demand.
- Liquidity providers earn fees on each transaction in proportion to the amount of liquidity they are providing on the pool.
In cases where the price ratio of the assets changes after the liquidity provider deposits them in a pool, we have a phenomenon known as impermanent loss. The impermanent loss’s size increases with the size of the changes. With price ratios that change a lot, liquidity providers have little incentive to add their assets to the pool. The trading fees serve to mitigate the exposure to impermanent loss.
Types of Automated Market Makers
Now, let’s take a look at the different types of AMMs you will find in the DeFi landscape.
- Constant Product Market Makers (CPMM): The first AMM, decentralized exchange Bancor, popularized the Constant Product Market Maker, which utilizes the function x*y=k, where k is a fixed constant and x and y are the liquidity pool assets amounts. With the equation, the liquidity available establishes the price range for the two crypto assets. An example of a platform using this model is Uniswap.
- Constant Sum Market Maker (CSMM): While ideal for zero-price impact trades, CSMMs don’t provide infinite liquidity. They use the x+y=k formula, which allows liquidity providers to withdraw their assets if the off-chain price between the assets in the pair is not 1:1.
- Constant Mean Market Maker (CMMM): The pool can contain more than two cryptocurrencies under this model. The formula for a liquidity pool of three crypto assets is (x*y*z) = k.
- Hybrid CFMMs: They combine multiple functions to achieve specific results. The advanced AMMs aim to address impermanent loss and low capital efficiency problems. An example is Curve’s AMM, which combines both CPMM and CSMM to minimize the price impact and improve efficiency in the use of capital.
- Proactive Market Maker (PMM): The model mimics the market-making behaviors of a traditional central limit order book. The price curve of each asset moves proactively in response to market changes. An example of a platform using this model is DODO.
- Dynamic Automated Market Maker (DAMM): This model incorporates multiple dynamic variables into its algorithm to ensure adaptability to changing market conditions. Low volatility periods see liquidity concentrated near the market price to increase capital efficiency. In contrast, high volatility periods see the liquidity spread out to ensure traders don’t suffer impermanent loss. One platform that uses this model is Sigmadex.
- Virtual Automated Market Makers (vAMM): The model uses the same formula as CPMMs. However, traders deposit collateral to a smart contract and do not rely on a liquidity pool. Perpetual Protocol utilizes this model.
Benefits and Drawbacks of Automated Market Makers
Like any other innovation in the DeFi ecosystem, AMMs have their benefits and drawbacks. Let’s take a look at them.
- The trading process is more efficient due to the absence of an intermediary.
- Easy access for anyone with an internet connection and a crypto wallet.
- Users can earn fees as liquidity providers.
- Minimal system costs lead to lower trading fees.
- Price slippage and impermanent loss can cause significant losses.
- The smart contract-based automation leaves AMMs open to potential exploitation by hackers.
- AMMs don’t have access to the full range of markets, as is the case in centralized exchanges.
- Often offer less liquidity than centralized exchanges, especially for smaller trading pairs.
- The complexity may shut out users with limited technical knowledge.
- High gas fees can eat into returns.
AMMs are highly appealing due to the democratization and the ease they bring to the trading process on decentralized exchanges. With more time and innovation, AMMs are bound to evolve to improve the trading experience in the global crypto markets.