corner
BackBack
Mar 12, 2023

What is an Automated Market Maker (AMM) in Crypto?

    **Swaap is the first market neutral Automated Market Maker (AMM). It leverages a combination of oracles and dynamic spread to provide sustainable yields for liquidity providers and cheaper prices to traders. What exactly is an AMM though? We get back to basics with this guide to AMMs. What they are, how they work and why it’s important. **

    What is an AMM?

    An Automated Market Maker (AMM) is a decentralized exchange protocol that allows users to trade cryptocurrencies without the need for an intermediary, such as a centralized exchange. It uses a mathematical formula to determine the price of assets, which is then used to execute trades between buyers and sellers.

    In traditional exchanges, the price of an asset is determined by the order book, which is a list of buy and sell orders placed by users. The exchange matches the buy and sell orders and the trade is executed at the price agreed upon by both parties. However, this model has some drawbacks, such as the risk of market manipulation.

    AMMs, on the other hand, use a liquidity pool to determine the price of assets. Liquidity providers deposit two different tokens into the pool, which are used to create a trading pair. For example, a liquidity provider can deposit equal amounts of Ether (ETH) and a stablecoin like USDT to create an ETH/USDT trading pair. The liquidity provider earns a fee for each trade executed using their pool.

    When a user wants to trade, they simply submit their transaction to the blockchain, which executes the trade using the AMM's mathematical formula. The formula uses the balance of each token in the liquidity pool and the size of the user's trade to determine the price of the assets being traded.

    How AMMs work:

    AMMs use a mathematical formula to determine the price of assets in a liquidity pool. The most common formula used is the Constant Product Market Maker Formula, also known as the x*y=k formula. This formula ensures that the product of the amount of each token in the pool remains constant, which in turn ensures that the price of the asset remains constant. When a user makes a trade, the amount of each token in the pool changes, which adjusts the price of the asset based on the formula.

    The constant sum market maker (CSMM) is the second type of automated market maker (AMM) that is best suited for zero-price impact trades but is limited in providing infinite liquidity. Using the x+y=k formula, CSMMs produce a straight line when graphed. However, this design can result in the depletion of one reserve by arbitrageurs if the off-chain reference price between the tokens is not 1:1. In such a case, one side of the liquidity pool would be destroyed, and all liquidity would be concentrated in just one asset, leaving nothing for traders. Due to this limitation, the CSMM model is infrequently employed by AMMs.

    The constant mean market maker (CMMM) is the third type of automated market maker (AMM) that allows for the creation of liquidity pools containing more than two tokens and weighted in a non-standard 50/50 distribution. Under this model, the weighted geometric mean of each reserve is maintained at a constant level. To illustrate, in a three-asset liquidity pool, the equation would be (xyz)^(⅓)=k, enabling different levels of exposure to the assets in the pool and facilitating the swapping of any of the pool's assets.

    Liquidity Pools:

    A liquidity pool is a smart contract that holds two different tokens and provides liquidity for trading. When a user wants to trade a token, they swap it with another token in the pool. The price of the token is determined by the formula used by the AMM. Liquidity providers deposit tokens into the pool and earn a portion of the trading fees for providing liquidity. The size of the liquidity pool and the amount of trading fees earned by liquidity providers depend on the popularity of the token and the demand for trading.

    Liquidity providers:

    Liquidity providers deposit equal amounts (in $ value) of two different tokens into a liquidity pool, which are then used to create a trading pair. For example, a liquidity provider can deposit 1 ETH and 100 USDT to create an ETH/USDT trading pair. The liquidity provider earns a fee for each trade executed using their pool. The fee is usually a small percentage of the trade value, and it is distributed to the liquidity providers in proportion to their contribution to the pool.

    AMM vs. Order Book model:

    In traditional exchanges, the order book model is used to determine the price of assets. The order book lists all the buy and sell orders placed by users and the exchange matches the buy and sell orders based on price and time priority. In contrast, AMMs do not have an order book. Instead, they use a liquidity pool and a mathematical formula to determine the price of assets. This allows users to trade directly with the pool instead of having to match orders with other users.

    Benefits of AMMs:

    Automated Market Makers (AMMs) provide several benefits compared to traditional order book-based exchanges:

    1. Liquidity: AMMs provide greater liquidity for low cap tokens. In a traditional order book-based exchange, the liquidity of a token depends on the number of buyers and sellers willing to trade that token. In contrast, an AMM pools liquidity from users, creating a larger pool of available liquidity for trading.
    2. Accessibility: AMMs are open to anyone with an internet connection and a digital wallet, making them more accessible than traditional exchanges, which may require a higher level of technical expertise to use.
    3. No order book: AMMs eliminate the need for an order book and the potential for order manipulation that can occur on traditional exchanges. Instead, transactions are based on mathematical algorithms, which provide transparency and security.
    4. Decentralization: Many AMMs are built on decentralized blockchain networks, providing greater decentralization and reducing the risk of central point of failure or hacking.

    In addition to the above, liquidity providers have the potential to enhance their earnings through yield farming opportunities. By depositing the appropriate ratio of digital assets into a liquidity pool on an automated market maker (AMM) protocol, LPs can participate in these opportunities. After confirmation of the deposit, the AMM protocol will issue LP tokens to the provider. These tokens can then be staked in a separate lending protocol to earn additional interest, providing a way to maximize returns.

    Challenges of AMMs:

    1. Impermanent loss: AMMs expose liquidity providers to the risk of impermanent loss. Impermanent loss occurs when the price of tokens in a liquidity pool changes, resulting in losses for liquidity providers who may have been better off holding their tokens instead of providing liquidity. Swaap’s model for AMM significantly reduces impermanent loss. This is one of the key issues that affects the current AMM model and is one of the major contributing factors behind negative returns in the current crop of AMM offerings. 
    2. Limited functionality: AMMs may have limited functionality compared to traditional order book-based exchanges. For example, AMMs may not offer advanced trading features such as stop-loss orders, limit orders, or margin trading.
    3. Front-running: Front-running occurs when a trader uses their knowledge of an upcoming trade to execute a trade before the original trade, resulting in profits. AMMs are susceptible to front-running since their transactions are public, and traders can observe the transaction before it is confirmed.
    4. Security risks: AMMs are vulnerable to security risks such as smart contract bugs, hacks, and flash loan attacks. These risks could result in the loss of user funds or the manipulation of the liquidity pool.
    5. Gas fees: AMMs can be expensive to use due to high gas fees on the Ethereum network. This is because each trade executed using an AMM requires a transaction to be sent to the blockchain, which incurs a gas fee. To address this issue, some AMMs have launched on other blockchains that have lower fees, such as Binance Smart Chain or Polygon.

    Evolution of AMMs

    In response to the above challenges we are seeing new design patterns, including hybrid automated market makers, dynamic automated market makers, proactive market makers, and virtual automated market makers, are helping to overcome the limitations mentioned. These models can be broken down as follows:

    Virtual Automated Market Makers

    Virtual Automated Market Makers (vAMMs) offer several benefits, such as reducing price impact, minimizing impermanent loss, and enabling single token exposure for synthetic assets. Unlike Constant Product Market Makers (CPMMs), vAMMs do not rely on a liquidity pool. Instead, traders deposit collateral into a smart contract. By trading synthetic assets instead of the underlying asset, users can gain exposure to the price movements of multiple cryptocurrencies in a highly efficient manner. However, holding an open position in a synthetic asset also poses a risk of collateral liquidation if the asset's price moves against the user.

    **Proactive Market Market Maker **

    The Proactive Market Maker (PMM) model imitates the market-making actions of human traders in a traditional central limit order book. The PMM protocol relies on precise global market prices obtained from price feeds to move the price curve of each asset proactively, thereby enhancing liquidity close to the current market price. This results in more effective trading and lower impermanent loss for liquidity providers, making it easier for them to participate in the market.

    Dynamic Automated Market Maker (DAMM)

    The Dynamic Automated Market Maker (DAMM) model utilizes price feeds and implied volatility to effectively allocate liquidity across the price curve. By integrating several dynamic variables into its algorithm, DAMM can create a more resilient market maker that adjusts to the prevailing market conditions. This model concentrates liquidity close to the market price during low volatility periods, improving capital efficiency, and then expands it during high volatility periods to shield traders from impermanent  loss.

    Conclusion 

    AMMs have become popular because they offer several benefits over traditional exchanges. They provide high liquidity, which ensures that trades can be executed quickly and at a fair price. They are also decentralized, which means that users retain control of their funds and can trade without the need for a trusted third party. Additionally, AMMs are open to anyone with an internet connection, which makes it easy for users to access a global market of cryptocurrencies.

    There are several popular AMMs in the crypto space, including Uniswap, SushiSwap, and Swaap. These protocols have their own unique features and attract different types of users. For example, Uniswap is known for its simplicity and ease of use, while SushiSwap has developed a wider array of services, like staking?. Swaap utilizes more advanced algorithms to reduce impermanent loss and offer lower risk yield.

    Automated Market Makers have become an important part of the decentralized finance (DeFi) ecosystem, providing users with a way to trade cryptocurrencies without the need for a centralized exchange. They offer several benefits over traditional exchanges, including decentralization, and accessibility. However, they also have some challenges that need to be addressed, such as price slippage, impermanent loss and high gas fees. As the crypto market continues to evolve, it is likely that we will see more innovation in the AMM space. Swaap’s upcoming v2 being a prime example of this and will likely be the template for a new wave of second generation AMMs with superior yield. 

    About Swaap

    Swaap is the first market neutral Automated Market Maker (AMM). It leverages a combination of oracles and dynamic spread to provide sustainable yields for liquidity providers and cheaper prices to traders.

    Learn more:

    Twitter: https://twitter.com/SwaapFinance 

    Discord: http://discord.gg/hrC2wBUk8m 

    Website: https://www.swaap.finance/