Automated Market Makers: What They Are and How They Work

Josiah Makori
By Josiah Makori
Joel Taylor
Edited by Joel Taylor

Published March 25, 2022.

Young man making coffee with his tablet  and AAM in action

Automated Market Makers in crypto (AMMs) are the underlying smart contracts powering DeFi applications (dApps), like decentralized exchanges (DEXs). In simple terms, AMMs are self-governing trading techniques that eradicate the need for centralized marketplaces and related market-making methods.

Basically, market makers are liquidity providers. In business, liquidity denotes how fast and efficient a given asset can be purchased or sold.

Now that you know what AMMs are let’s discuss their role in detail.

What Do Automated Market Makers Do?

AMMs perform the same function as exchange order books – they are simply trading pairs. Nevertheless, you do not need another trader on the buyer side to fill your sell order. Rather, you interact with a computer program that performs the trade for you.

On a DEX like Uniswap, trades occur directly between peer wallets. Suppose you sell BTC for USDT on a CEX like Coinbase, another person on the other side of the trade purchases BTC with USDT. This process literally resembles a Peer-to-Peer (P2P) transaction.

Contrary, an AMM assumes a Peer-to-Contract (P2C) process. Here, there are no counterparties like in a CEX since trades occur between peers and smart contracts. Apart from lacking order books, AMMs also lack order types. The price you find for the token you plan to trade is established by formula instead. However, it’s good to note that some future AMM setups may offset the above statement.

Though there are no counterparties in AMMs, someone needs to create a market by offering liquidity. This liquidity is held in protocols and is offered by liquidity providers (LPs).

How Do Users Trade on Automated Market Makers?

Here are two important points you should know before we proceed further:

Trading pairs found on CEXs exist as exclusive liquidity pools in AMMs.

Instead of applying dedicated market makers, individuals can offer liquidity to liquidity pools by locking tokens accepted in the pool.

To maintain a 1:1 ratio of tokens in liquidity pools and avoid differences in the pricing of locked tokens, AMMs leverage predetermined algorithms. For instance, Uniswap and most DEXs apply a simply x*y = k formula for constant products and fair pricing.

X is the value of token A, Y represents the value of token B, and K is the constant.

Generally, Uniswap liquidity pools uphold a condition where the multiplication of the price of tokens A and B are equal or constant.

To illustrate how AMMs work, let’s consider a BNB/BUSB liquidity pool as our example. When traders buy BNB, they add BUSD to the pool and extract BNB. Obviously, this reduces the amount of BNB in the pool, increasing the price of BNB and offsetting the balancing impact of the x*y = k equation.

Contrary, since more BUSD has been injected into the pool, its price drops. When BUSD is bought, the reverse is true – the price of BNB drops in the pool while the price of BUSD increases.

The Role of Liquidity Providers in AMMs

As mentioned earlier, AMMs need liquidity to work effectively. Inadequately funded pools are vulnerable to price slippages. AMMs incentivize users to lock tokens in pools for other people to trade against these pooled funds to prevent slippages.

Usually, the AMMs reward LPs with a portion of the transaction charges perfumed on the pool. For instance, if your deposit is equal to 20% of the pooled funds, you will be rewarded a liquidity pool token equivalent to 20% of the generated transaction charges of that pool. If you wish to leave the pool, you simply redeem your liquidity pool token and get your fair share of gas fees.

Besides, most AMMs issue governance tokens to LPs and traders. As the name suggests, a governance token gives holders voting rights on matters relating to the governance and development of the AMM protocol.

How Can You Become a Liquidity Provider?

Any individual can become an LP by locking assets in a protocol and earning pool tokens. The pool tokens monitor the LP’s portion of pooled funds and can be exchanged for the underlying token any day.

Apart from earning a portion of the transaction fees, LPs can earn bonuses through yield farming. Here, AMMs incentivize liquidity provision by offering coin rewards. To be eligible for yield farming, you must lock a certain amount of tokens into the pool. After confirming your contribution, the AMM protocol will automatically accumulate reward tokens, claimable regularly. The longer you offer liquidity, the more rewards you generate.

However, this discussion about Automated Market Makers and Liquidity pools can’t be complete without mentioning the risks involved with liquidity pools. Let’s briefly look at an impermanent loss since it’s the major risk associated with liquidity pools.

Impermanent Loss

Impermanent loss occurs when the price ratio of the pooled assets drops after locking them in a protocol. The bigger the drop, the more significant the impermanent loss. For this reason, AMMs function well with coin pairs with similar values, like stablecoins and wrapped coins.

Nevertheless, this phenomenon is impermanent since the price ratio is also likely to revert. It can only be termed permanent when you withdraw your tokens before the price ratio returns. Additionally, it is worth noting that the potential earnings from gas fees and yield farming can sometimes offset these losses.

Bottom Line

AMMs exploit the drawbacks of CEXs market making. The centralized approach is manual, making it a time-consuming activity for traders and makers alike. This new form of liquidity provision empowers the DeFi industry to be more effective and realize its full potential.

As the DeFi landscape continues to grow, AMMs will undoubtedly play a significant role in its development. Currently, only a few businesses are offering new solutions using AMMs. However, the future is bright for AMMs protocols as they will find more applications across the DeFi industry.