What Is An Automated Market Maker (AMM)? How Do They Work?

As the need for decentralized finance features continues to increase, people are craving for decentralized exchanges (DEX) to swap their tokens without worrying about the interference of a centralized authority.

When DEX was conceptualized, people worried that they would lack liquidity, and there would be issues in swapping tokens, as well as a higher risk of slippages occurring. This birthed the concept of Automated Market Makers. AMM offers people the opportunity to use their idle tokens to earn returns while yield farming.

AMM: What is it?

An automated market maker is part of a decentralized exchange free from custodial features and operates based on an algorithm that values different assets. They are different from custodial or centralized exchanges that use order books to fulfill buy and sell orders. AMM is seen as a peer-to-contract exchange system, where people swap tokens against a pool. They have to pay transaction fees, which are then shared with liquidity providers. Every AMM has a unique formula based on what they intend to achieve, and the price is determined based on the algorithm.

Automated Market Makers solve the liquidity issues that decentralized exchanges face by keeping its liquidity through the usage of pools.

They are permissionless, allowing crypto startups to list their projects on the platform without jumping through hoops. Usually, the crypto project has to create a liquidity pool on these decentralized exchanges to allow their token holders to seamlessly swap tokens whenever they want. The use cases of liquidity pools are more than being used to power AMMs, as decentralized lending protocols now incorporate this functionality.

How AMMs function

AMMs work based on formulas that determine the operation of a trading pair. This type of DEX is controlled by smart contracts, which is one reason that it is called a peer-to-contract trading platform. AMMs do not use order books but opt for liquidity pools to ensure that trading occurs smoothly. Formulas are the basis for the price determination of assets.

What are the benefits of AMMs?

AMMs offer benefits to different participants such as traders, crypto projects, and liquidity providers.

Wide range of tokens

Automated Market Makers have a wide array of tokens on their platforms. Anyone is allowed to create a pool, meaning that traders are most likely to find new tokens on these platforms. Some crypto enthusiasts seek native tokens of projects that they feel have high-profit potential on this type of DEX.

No KYC

Using an AMM is quite seamless. All the user needs to do is connect their wallet to the decentralized exchange and they can seamlessly swap tokens. No one requests for their personal details or identification documents. Users can enjoy trading activities in privacy.

Passive stream of income

Those with idle tokens can decide to inject liquidity into pools and earn rewards. This is a passive way of earning returns. The incentives are usually received from the fees paid by traders and may include the native token of the platform.

Permissionless listing

Crypto startups have access to a permissionless listing system, where they can easily list their tokens and create pools.

What is a Liquidity Pool?

A liquidity pool is a crucial element in the DeFi space, and is evident in the operations of AMMs. This type of pool injects liquidity into AMMs, allows users to easily convert one asset to the other. Liquidity pools in conjunction with AMMs solve the liquidity issues noticed on decentralized exchanges.

In the past, DEXs suffered from liquidity, as there were few people buying and selling tokens at the same time. To solve this issue, a new concept was born.

People were incentivized to offer liquidity into pools. Usually, the rewards given to LPs are new tokens, transaction fees, or both.

Traders, in an AMM, trade against a liquidity pool, which is a pool of tokens. Liquidity pools are funded by crypto enthusiasts that want to earn passive income.

Anyone can fund liquidity pools, as the process is permissionless. All that is needed is a wallet with the native token, which may be an ERC20 token and internet connection. The next thing is to decide on the pool that you want to fund. Different pools have varying steps to follow during the research process.

Usually, LPs are paid out of the fees earned from those that swap their tokens on the AMM. Sometimes, LPs are given the native tokens of the project, which is called yield farming.

What are the rewards for liquidity providers?

Different protocols that create pools on AMMs offer LPs different rewards for injecting liquidity in their pools, thereby motivating people to participate in the protocol.

Governance rights

Some protocols offer their users governance rights to make decisions concerning the development of the ecosystem. They can submit proposals and vote on changes. 

Transaction fees

LPs are given a share of the transaction fee as their income. When people use the DEX to swap tokens, they pay transaction fees, which are then given to liquidity providers.

Native tokens

DeFi protocols that run pools on an AMM may offer their native tokens as a reward to those that inject liquidity in those pools. These tokens can be traded, swapped, staked, or even used in governance processes in the platform.

What are the costs attached to liquidity pools?

By interacting with a liquidity pool either by providing liquidity or trading against a pool, users and LPs face different costs.

Transaction fee

Every transaction that occurs has a cost for the user. If a trader swaps their tokens, they have to pay a commission. When an LP wants to move rewards to their wallet, they have to pay fees. Sometimes, the fees may be too high, eroding the profits made by the LP. This case occurs in Ethereum 1.0.

Liquidity withdrawal penalty

When an LP has decided to withdraw liquidity from the pool, it may have to pay a penalty because it could negatively affect the functioning of the pool.

Slippage

This is a cost that people tend to face in AMMs, and it is seen as the difference between the spot price and the actual price that was realized from the trade. People tend to avoid those with high slippage. Traders are plagued with this issue.

Impermanent loss

This loss is faced by LPs that inject their tokens into pools. With the volatility of cryptocurrencies, the tokens that are locked up may face a temporary loss in value. Their value may swing low or high depending on the market conditions. This is seen as temporary as long as the tokens are still locked. Once they are withdrawn, they become permanent.

What are the types of AMMs?

AMM works with different mathematical formulations based on what they intend to achieve. Below are some of them.

Constant Function Market Makers (CFMM)

Constant Function Market Makers (CFMM) is a type of AMM that is commonly used, and prices depend on the available number of multiple assets.

In this AMM, users trade against a pool, and not another party. Its algorithm is designed in such a way that any activity should alter the reserves in a manner that the product is still equal to a constant.

Usually, Constant Function Market Makers operate because of three parties, and they are merchants, liquidity providers, and arbitrators.

Merchants are those that swap tokens, liquidity providers inject funds or liquidity into a pool, and arbitrators ensure that the price of the tokens in the pool is maintained. Arbitrators and LPs are paid commissions, while merchants have to pay transaction fees.

Constant Sum Market Makers (CSMM)

This is an adaptation of CFMMs, but is designed to be a simpler model. Constant Sum Market Makers are not an ideal independent implementation for AMMs. Though they are known to offer zero slippage, they do not offer infinite liquidity.

Constant Product Market Maker

This was created by UniSwap, and it creates a hyperbola regarding two assets because as prices reach infinity, they possess liquidity.

Constant Mean Market Maker (CMMM)

This type of AMM formulation was created by Balancer, and it is designed to maintain the constant nature of weighted geometric mean of reserves without fees. Constant Mean Market Maker is an adaptation of the constant product market maker.

What are examples of AMMs?

UniSwap

UniSwap is one of the forerunners of the AMM concept that attracted a large volume of liquidity into the decentralized exchange space. Many new generation AMMs are designed to clone features that UniSwap offers and this is made easy because it is an open source project. On UniSwap, anyone can create a liquidity pool with a pair of any ERC20 tokens that they want in an equal manner. 

SushiSwap

Sushiswap is a fork of UniSwap and designed to offer similar features to the former. When it was launched, the developments team started a vampire attack to convince liquidity providers to leave UniSwap and inject liquidity on the pools based on Sushiswap. They did this by offering a more lucrative reward system. Sushiswap has encountered earlier days that are filled with controversies. 

Balancer

Balancer created the Constant Mean Market Maker (CMMM) model that stopped restricting liquidity pools from holding only two assets. With this feature, liquidity pools can store up to eight different tokens. 

In Balancer, users can create a private pool that allows only one person to provide liquidity. It can be a shared pool, where anyone is allowed to offer liquidity, and utilize the BPT or Balancer Pool Token to monitor the ownership of tokens in pools. 

Thirdly, it could be a Smart Pool that allows people to provide liquidity if they want and use BPT in tracking, but the difference is that this pool automatically adjusts the trading fees, as well as the balances and weighting of assets.

 

If you want to learn how to trade the momentum of cryptos and et better familiar with DEX’s, check out our Cryptostreet Trading Bootcamp.