What are AMMs & How do they really work?

Automated Market Makers are rapidly replacing the standard order book model with a new, superior system. But, let’s take a step back: to understand the latest technology, we need to first comb the way the world once looked, before the appearance of AMMs.

Magic Square
Magic Square
4 min readJan 20, 2022

--

Traditional market-making is still used to trade most assets, such as securities and real estate. So, here’s what happens in a typical market-making scenario:

  • When a buyer puts in an order for stock ‘A’, he sets his buying price.
  • Then he sits and waits for a seller to match his price.
  • Professional market makers manage a large number of orders in order to ensure the liquidity of the market.
  • But even so, some buyers must sit and wait for a long time until their order is filled.
  • Traders and market makers have to do manual work to manage the market, which takes time.
  • The traditional market is only open during operating hours of the market, so you can’t trade at night for example.
  • The usual market-making process is part of the centralized financial industry.

The groundbreaking news is that an emerging alternative is sweeping the scene. When compared to other exchange options, AMMs are enormously efficient because they allow traders to exchange their crypto in a speedier, decentralized, and guaranteed manner.

Automated Market Makers is possibly the most talked-about DeFi term these days, but also one of the least understood, if not the scariest. Let’s check how these automated markets really work.

AMMS: A DEFI MARKET-MAKING ALTERNATIVE

Automated market makers (AMM) are a component of the decentralized finance (DeFi) ecosystem, allowing digital assets to be exchanged in a permissionless and automated manner, rather than through a traditional market of buyers and sellers, using liquidity pools. Practically, DeFi allows users to trade at any time.

The first distinguishing trait of an AMM is that it rejects the traditional buying and selling mechanism. There are no barriers to entry, and you aren’t required to register an account. The ability to change one asset into another without affecting its market price is known as liquidity and AMMs are designed to automatically manage liquidity.

Precisely, AMMs are smart contracts that generate a liquidity pool of tokens that are traded automatically by an algorithm rather than through an order book.

HOW IT REALLY WORKS? THE SUPPLY AND DEMAND MECHANISM

AMM users contribute crypto tokens to liquidity pools, whose prices are established by a mathematical formula. This formula resembles the standard exchange rate formula but has a different appearance:

A*B=k

A and B are the quantities or the amounts of the tokens that you have. Where k is the constant that always stays the same and does not change.

This formula governs token pricing, implying that as the number of available tokens ‘A’ decreases, the number of available tokens ‘B’ rises, and vice versa. Practically, an AMM behaves like a smart contract that calculates and predetermines the price, so the buyer and seller can determine whether they want to buy or sell.

Because of this structure, token prices are governed by the supply and demand principle, which means that strong demand for token ‘A’ raises its price, whereas a low demand would lower its price. The demand in the case of AMMs is determined by the activity involving the token, so more buys of token ‘A’, would mean that ‘A’ is in higher demand, and more sales of ‘A’ would mean that the token is in lower demand. And, instead of a traditional logic that relies on a person, an algorithm is employed.

There are two main types of automated market makers. The first is governed and set up by professional market makers, and the second is fully automated by a set algorithm, allowing any user in the market to participate by depositing liquidity into the smart contract.

Here is a short summary of what AMMs are and why they are beneficial:

  • AMMs are replacing the traditional exchange-listing process and limit-order books with a permissionless liquidity pool run by algorithms.
  • AMMs have no order book.
  • Instead, smart contracts calculate prices continuously, so the buyer and seller can determine whether they want to buy or sell at the predetermined price.
  • The price is calculated using a formula, by a ratio between the two tokens.
  • Since you get a precalculated price, you immediately know what the rate is.

FINAL THOUGHTS

Here we have explored the tip of the iceberg when it comes to AMMs and how they work, but there is a lot more to this story, and AMMs are still rapidly evolving as the DeFi space expands.

We will explore in-depth the ways in which users can benefit from AMMs in our next article.

In the meantime, be sure to stay tuned for AMM tips and tricks here on Medium and on our blog.

--

--