What is an AMM (Automated Market Maker), and how does it work in DeFi? A guide for newbies

by MadFish Team

For a long time, exchanges had to use order books, which had to be both filled and analyzed manually. As a result, there were serious limitations in terms of the speed and efficiency of exchanges. Nowadays, with the widespread utilization of computers, automated systems, and the Internet, this is no longer the situation – automated market makers, or AMMs, have replaced the traditional principles and approaches used by exchanges.
The interest of newbies in AMMs, liquidity pools and DeFi is growing from year to year, so we decided to gather the most important information on these topics and create a guide on how AMMs work.

The interest of newbies in AMMs, liquidity pools and DeFi is growing from year to year, so we decided to gather the most important information on these topics and create a guide on how AMMs work. 

What is Automated Market Maker (AMM)?

The first automatic market makers, or liquidity providers, appeared on the Forex market in the 90s as alternatives to manual liquidity providers (i.e. live traders) who, thanks to large reserves of liquidity, colluded to manipulate prices on the market.

Automatic liquidity providers, unlike live traders, provide liquidity to assets that lack liquidity at a point in time. Automatic liquidity delivery is necessary for the quick execution of deals and to eliminate situations where people need to wait for deals to be executed. Liquidity delivery is especially important for unattractive assets, which experience a lack of liquidity. By pooling the liquidities of manual providers, it is very easy to manipulate the prices of illiquid commodities, and thereby earn large sums of money.

Decentralized cryptocurrency exchanges (DEXs) faced major liquidity problems after their emergence. Due to the lack of liquidity and the shortage of traders on these exchanges, it was almost impossible to sell illiquid cryptocurrencies as there were either no buyers for them, or their prices were so low that it was not economically viable to sell them.

Due to liquidity and transaction speed problems, decentralized exchanges were considered to be inferior to centralized exchanges, even though they were better than centralized exchanges in terms of security and privacy issues.

Automated liquidity providers are automated market makers that remove the liquidity problems faced by decentralized exchanges. They are widely used on Defi exchanges. 

Direct liquidity providers are exchange users who supply liquidity (tokens) to the exchange’s Liquidity Pool and receive fees in return. This liquidity is distributed by automated systems (AMMs). Alongside commission, users can often receive other bonuses, for example, project tokens.

The automated market maker system proved so effective that it was even implemented by Binance, a centralized exchange. 

Automated market makers enable instantaneous transactions (even for illiquid assets), accelerate the turnover of assets on exchanges and allow both the exchange and the liquidity provider to earn commissions.

Difference between a liquidity pool and a traditional “buyers and sellers” exchange

Traditional exchanges need buyers and sellers to provide liquidity. It’s often the case that one side outnumbers the other, resulting in a lack of liquidity. This problem was solved by market makers – large players who are willing to buy or sell almost any amount of an asset, with the aim of making a profit by exploiting price differentials.

The question of liquidity becomes important when considering an exchange. This is why liquidity for centralized exchanges is provided by market makers – large and small players who have large and small holdings of assets in their exchange wallets and who can satisfy sufficiently large and small bids in both directions. Market makers continuously monitor assets’ current prices by creating and closing new orders on the stock market (order book). Even the exchange itself can act as a market maker, if it is large enough, by maintaining liquidity with its own earned funds.

The main problem with the order book model is that it relies too heavily on having a market maker (or several) for each asset. Without market makers, the exchange becomes illiquid and inconvenient for ordinary users. No one wants to wait several hours for an exchange transaction. In addition, market makers are constantly changing their exchange rates by creating and closing orders in the book. Supporting such activities would put a lot of strain on the blockchain, slow the process, and ultimately result in end users paying a higher fee. The Ethereum blockchain, at its current throughput of 12-15 transactions per second, simply would not pull such a model.

This problem has long been a concern for the cryptocurrency community. It has led to the development of alternative, faster, blockchains like EOS, and some projects are also planning to build an infrastructure of the 2-level for Ethereum.

Currently, the most popular solution is to abandon the order book altogether. This has resulted in the emergence of decentralized liquidity pools and is the reason why AMMs are so popular in the DeFi system.

A liquidity pool is a vault into which liquidity providers can place their assets and make them available to other market participants who want to exchange with them. If we draw an analogy between traditional finance and cryptocurrency exchanges, a liquidity pool can be seen as a bank. The bank disposes of depositors’ money and also prints new money.

A cryptocurrency liquidity pool contains tokens that are locked into a smart contract account. These tokens are used to enable trading on decentralized exchanges (DEX). Bancor was the first to apply this system, but it was Uniswap that popularized it.

Why are AMMs so popular in the DeFi system?

Firstly, it should be noted that DeFi is not any particular technology, but rather a whole array of software solutions. DeFi is a paradigm that is based on a service that provides financial services. It adheres to the following principles:

  • Decentralization
  • Censorship resistance
  • Code is a law – usage of the Smart contracts
  • Accessibility for every user 
  • Financial transparency

DeFi is based on decentralized applications that use blockchain and smart contracts. This is because blockchains, like Ethereum, allow developers to create sophisticated algorithms to store and manage digital assets, and all transactions are conducted without the involvement of intermediaries. The decentralization of financial services is closely linked to the concept of Web 3.0 —  the next evolution of the Internet. 

Liquidity pools in DeFi provide the following benefits to investors and users:

  • Lower Gas fees
  • Passive income
  • Reduced liquidity risks
  • Fast cross-border transactions with automated smart contracts
  • Added assurance for large investors
  • Insurance for token holders

Blockchain and smart contract technologies can compete against the traditional financial system. Over time, the development of financial technologies has become easier, which in turn has led to the explosive growth of DeFi platforms. Currently, the total value locked in DeFi is about $26.7B. This is a significant amount of money.

In fact, the AMM concept went to DeFi, but was changed. It became very popular because every user could become a liquidity provider, which led to the development of areas such as DEX, Yield, Farming, etc. In general, the creation of liquidity pools allowed everyone to earn tokens.

For example, Kyber Network was one of the first AMMs that started using automated liquidity pools back in 2018. Suppliers either became large market makers or project teams. The prices of the tokens in the pool are set either by external oracles or by the automatic settings of smart contracts. This is necessary to have better control over the situation in periods of high volatility.

Who is a liquidity provider and how they can earn money?

A liquidity provider is a company or firm that holds assets in its account for the purpose of arranging its sales. They are active on both the buyer’s side and the seller’s side. In other words, they create the market. The volume of trades depends on them and not on ordinary users. 

Providing liquidity and making money on spreads and swaps is not the only source of income, and not the only function, of well-known liquidity providers. They offer a large number of other services and a wide variety of investment activities.

Like market maker brokers, they lose money when the investor makes a profit. However, due to their large size and the fact that they offer their services to numerous companies and clients, small losses are always covered by good profits. The differences between a large liquidity provider, such as Deutsche Bank, and any broker is that they are of different sizes and they earn different profits from the services they offer. 

DeFi provides liquidity providers with good benefits. By becoming liquidity providers, they are offered economic incentives in the form of a % of each transaction and LP tokens, which guarantee that a person will receive income. LP tokens are also used as guarantees that liquidity providers will get their tokens back (LP tokens are exchanged for other tokens later). In DeFi, everyone can be a liquidity provider, all one needs to do is add themselves, and their tokens, to the liquidity pool. The most popular LPs can be found at DeFiPulse and CoinMarketCap. They contain lists of the most beneficial DeFi tokens.

Despite their advantages, there are risks in using LPs, both for liquidity providers and for common users. The most dangerous among them are cryptocurrency volatility, fake tokens, fraudulent developers, bugs, admin keys and systemic risks. These risks can do significant harm to liquidity providers, potentially leaving them without tokens.

  1. Cryptocurrency volatility: DeFi platforms and algorithmic stablecoins operate with excessive collateral. If the value of this collateral falls by 30-50%, the protocols will automatically start to liquidate the collateral at a loss to liquidity providers.

2. Fake tokens: On decentralized exchanges, anyone can create their own token and trade it. Fraudsters often create copies of tokens from popular projects and this can result in inattentive users buying worthless tokens for real cryptocurrencies.

3. Fraudulent developers: There are examples of DeFi projects that were originally created for fraud purposes. Users do not generally study the code of smart contracts and essentially “give” their cryptocurrencies to fraudsters themselves.

4. Bugs in smart contracts’ codes: Any software code can contain bugs, and decentralized applications are rarely audited properly. Hackers can cheat smart contracts and withdraw users’ tokens, manipulate token prices, or cause collateral liquidation in their favor.

5. Admin keys: If fraudsters gain access to admin keys, they can easily steal funds. There are many cases where decentralized platforms have lost the funds of liquidity providers. The less the decentralized platform cares about its security, the more serious the admin keys risk is.

6. Systemic risk: This risk has the biggest impact on the ecosystem. Most DeFi apps or protocols rely on the price of Ethereum. If the ETH price drops to an unexpected level, it could have a domino effect on the entire ecosystem.

A liquidity provider needs to consider the following points when choosing a LP in DeFi:

  1. Pool pair (which tokens go into the stake?)
  2. Pool TLV (how much money is locked?)
  3. Possibility of impermanent loss (different pool models – different % of price slippage)
  4. Reward currency + price (look at the dynamics – will it grow?) 
  5. Reward market cup
  6. APY (Annual Percentage Yield)
  7. Audits (were audits conducted?)

The most popular models of AMM pools on the market (Uniswap, Curve, Balancer)

UniSwap

The first decentralized AMM was released in November 2019. Anyone can participate in the creation and formation of a liquidity pool and be rewarded in return. The price of a token is only regulated by the pool’s internal mechanisms (the ratio between the number of tokens).

Uniswap is a fully decentralized protocol based on the Ethereum blockchain. It provides automatic liquidity and is currently one of the largest decentralized exchanges by trading volume. A Uniswap pool is formed with only one pair of tokens. 

The main features of the UniSwap AMM model include:

  • Users can trade tokens and provide liquidity to a large number of liquidity pools (LPs). Since the project does not have a decentralized oracle to maintain accurate prices, arbitrageurs are interested in keeping the price differential as low as possible.
  • In addition to LPs and token exchanges, users also have the opportunity to participate in the management of the project. The model is supported by the UNI UniSwap token, one of the most decentralized tokens in all of DeFi.
  • Most tokens are distributed to existing supporters, leaving no room for centralization and big players who wish to take full control of management. The UniSwap community is free to change anything, from the design of the exchange to the introduction of new LPs.

Balancer

In essence, Balancer is similar to Uniswap, but it is different in that it offers new dynamic features that go beyond just a pool for two different tokens.

The Balancer protocol is designed to help users trade their ERC-20 tokens without trust in the platform’s liquidity pools. In terms of operability, Balancer is also designed to work similarly to Curve. However, its overall user interface is perhaps more sophisticated and aesthetically pleasing. 

The main features of the Balancer AMM model are:

  • Balancer supports up to eight different assets in one liquidity pool. Thus, LPs can provide more liquidity and different types of assets to increase profitability for their users.
  • All trading commissions are set by the LP creator. This results in greater competition as users will look for the most profitable LP to farm.
  • The weighting of LP assets on Balancer is arbitrary. Thus, users are not required to provide equal amounts of liquidity when farming on the pool. For example, to farm on Uniswap, a farmer would be forced to provide 2 ETH and 740 USDT. 
  • Farmers can create private LPs on Balancer. The creator of a private LP can specify who can join the pool and who cannot. There are also smart LPs that allow all users to vote on LP fees.

Curve

This is one of the latest AMM projects and was launched in early 2020. Pools can be created by administrators only, but anyone can contribute assets to them. However, there’s one “but” – only stablecoins can be in a pool. This allows large transactions with minimal slippage and attracts large investors.

It is a newcomer to the DeFi space. The Curve is essentially an exchange liquidity pool, built on the Ethereum blockchain, and designed to trade stablecoins quickly and seamlessly. The main features of the Curve AMM model are:

  • Interest rates can be both high and low, depending on the current market conditions. Current rates are always listed on the website.
  • Curve works with 7 liquidity pools, some of which have a lending protocol and some of which do not.
  • The platform uses an algorithm to trade that is specifically designed for stablecoins. It features low commissions and minimal price slippage.
  • The yToken is a special yield aggregator token that allows you to find the pools with the best interest rates. The disadvantage of this method is that several protocols are used at once, which means a higher risk of vulnerability.
  • The CRV token is a functional control token for Curve. All those who participate in Curve pools are rewarded with CRV tokens.

We hope this article was helpful and you have gotten a better understanding of what AMM is. Subscribe our updates to get new educational publications about Tezos and DeFi ecosystems.

You may also like

Leave a Comment