DeFi 101: What Is An Automated Market Maker (AMM)?

Automated market makers (AMMs) are foundational to decentralised finance (DeFi). They automate the trading of digital assets using liquidity pools containing token pairs, whereas centralised exchanges (CEX) match orders via a traditional order book.

— —

When you buy or sell cryptocurrencies on Coinbase, the exchange matches your order against other trades in its order book.

Suppose you want to buy one ether for $1,000. The exchange will look for one or more sellers looking to match your price. And when it does, it will execute part (or all) of the trade on your behalf. That’s how centralised exchanges work.

The market structure looks the same for stocks, gold, and many other assets. In contrast, automated market makers (AMMs) use something called liquidity pools that enable you to trade digital assets without relying on a centralised order book.

The first-ever AMM was Bancor, launched in 2017. But many AMMs have popped up since, with two of the most popular being Uniswap and Curve Finance. People like AMMs because they’re decentralised, avoiding the risks of an FTX-like moment.

And they operate around the clock and across borders, allowing anyone with an internet connection to trade digital assets as freely as they like.

But to fully understand AMMs, you need to know about liquidity pools.

So let’s dip into them first.

Liquidity pools (and liquidity providers)

Let’s return to the Coinbase example.

If you look at its ether-USD trading pair, you’ll see it’s highly liquid. There’s billions in daily trading volume, meaning you could buy or sell a sizable portion of ether without moving its price.

But when decentralised exchanges (DEXs) first launched, they struggled to attract users, leaving them with low liquidity. Even a small trade could move the market, but then arrived the first AMM, which stepped back from the traditional market structure in favour of liquidity pools.

Liquidity pools allow users to trade from a ‘communal pot’ of tokens, with AMMs incentivising other users to fill the pots by paying them a percentage of trading fees (and these depositors are called ‘liquidity providers’).

The more assets deposited in a pool, the higher its liquidity, creating a more fluid trading experience. But what determines the price of each asset?

A mathematical equation called the constant product formula.

What is the constant product formula?

Automated market makers are now the core of decentralised exchanges. But the concept didn’t exist until a blog post from the Ethereum founder Vitalik Buterin.

His 2017 article proposed a simple formula that could take many forms, known as the constant product formula. Vitalik stated the formula as {tokenA_balance(p) * tokenB_balance(p) = k}, and Uniswap popularised it with a more digestible version:

X * Y = K

 

In this formula, ‘K’ is the constant product.

Its presence shows how the constant balance of assets determines the price of each token in a liquidity pool; now let’s clarify that statement with an example. 

  1. Suppose a liquidity pool contains ether and bitcoin
  2. When someone buys ether, there will be less of it in the pool
  3. That means ether’s price must rise (and bitcoin’s price must fall) to maintain the constant product ‘K’

 

You can plot this dynamic along a curve determined by the formula, with purchases moving the price of the bought asset slightly up along the curve and a sale moving it downwards.

The model also keeps the AMM price consistent with the market price because if the AMM price diverges too far from those available elsewhere, traders will arbitrage the difference until the balance is restored.

That’s what makes this formula one of DeFi’s most significant innovations. And it dictates how most AMMs function. But which are the best AMMs to use?

We’ll bring this post to a close by answering that question.

What is the best automated market maker?

Vitalik’s original post stated that AMMs shouldn’t be the only decentralised trading option. He feared that if they were, AMM prices could become inaccurate.

But one aspect Vitalik didn’t consider was there are many ways to build an AMM. We’ve seen many groundbreaking creations in DeFi, none more so than among the formulas used to govern different automated market makers.

Three distinct models now dominate the space:

  • Uniswap lets users create liquidity pools with any pair of ERC20 tokens in a 50:50 ratio, the most enduring AMM model;
  • Curve Finance focuses on liquidity pools for similarly-behaving assets, such as stablecoins, allowing it to optimise for low fees and high efficiency;
  • Balancer expands on the Uniswap model, allowing users to create liquidity pools of up to eight different assets in any ratio.

 

Automated market makers are foundational to decentralised finance. They’re also a pivotal way to generate yield.

That said — AMM platforms aren’t always easy to use, while becoming a liquidity provider is far from risk-free. We’ll cover the challenges of depositing token pairs into AMM liquidity pools in a future post.

For now, if you want to put your assets to work: simply open an Elitium account.

Don't miss a beat

Get your 5-minute DeFi news fix every Thursday. Sign up for the DeFi Debrief today.


    I agree to receive newsletters and promotional emails from Elitium (you can unsubscribe at any time).