HIGH DIVE INTO AMMs PART 1

Tyrone Okeke
5 min readJul 31, 2021

One might be wondering, why AMMs? What’s the motivation behind this choice of topic? In one of my recent articles, Comdex was the topic of discussion and AMMs briefly took the stage. So in this article, I’ll be discussing AMMs in detail. That being said, let’s talk about it…….

Due to the potential to build markets using smart contracts, Automated Market Makers (AMMs) have made quite a stir in the bitcoin business. AMMs have cemented their position in the decentralised finance (DeFi) market because to their simplicity and efficiency. On smart contract networks like Ethereum and Binance Smart Chain, DeFi, which attempts to decentralise financial services, has blossomed. As a result, AMM protocols like Uniswap, Curve Finance, and Balancer are becoming increasingly popular.

Automated Market Makers: What are they?

An AMM is a type of algorithm that identifies liquidity for those looking to purchase or sell a digital asset quickly. Liquidity pools, which are made up of cryptocurrencies lent to the protocol by liquidity providers, are used by the algorithm to execute deals. This eliminates the need for a “middleman” trade, such as those used in traditional market-making procedures. It's helpful to look at Traditional Market Makers first to comprehend Automated Market Makers.

Market Makers in the Traditional sense:

Market makers provide liquidity in traditional markets like gold, stocks, and oil, allowing investors to purchase or sell an item close to the publicly quoted price. This essentially means that they will pair a buyer and a seller together. A trade can only take place if the purchase and sell orders are identical. These orders are kept in a book called an order book. The order book exchange is a highly elegant mechanism in global finance, with several market makers and millions of investors.

When it comes to cryptocurrencies, if an investor wants to sell a token, the traditional market maker finds a buyer. If an investor wishes to acquire a token, the market maker locates a seller to complete the transaction. Market makers have always been significant financial organizations or institutions that quote purchase and sell prices for each asset in the financial business. These companies assume the risks of purchasing and selling assets from investors. Traditional market makers charge a “spread” on each asset covered to cover these risks.

A 'bid' price is given to a seller that is slightly lower than the market price. A buyer, on the other hand, will be given an “asking” price that is slightly higher than the market price. Returning to cryptocurrencies, a market maker who purchases a token from a seller for $50 and sells it to a buyer for $55 has made a profit of $5. Millions of transactions like these can be completed every day thanks to powerful computing. This ensures that the financial markets are able to function.

The execution time of smart contracts under the traditional market maker process is exceedingly long. It can also be quite costly. This is where market makers who are automated come in.

Automated Market Makers (proper)

Automated Market Makers are smart contracts that, rather than using the traditional order book mechanism, supply liquidity in the DeFi ecosystem via liquidity pools.

Digital assets are traded by an automated algorithm against liquidity maintained in liquidity pools on an AMM protocol, such as Uniswap or Curve Finance. As a result, digital assets can be traded at any time. The AMM determines the exchange price of a token. Unlike traditional financial services, AMM protocols maintain no capital, are open 24 hours a day, and most provide investors a level of trustlessness and decentralisation.

What is the function of an automated market maker?

Liquidity is provided by buy and sell orders in a typical order book. Those who provide liquidity through orders are known as 'Makers.' Makers are waiting for a market "taker" to accept their order. The transaction can then be completed.

There are no makers in AMM protocols. In the system, there are no previous orders. Only those interested in exchanging a specific cryptocurrency pair are interested.

Consider the following scenario:

A trader visits an exchange like Uniswap to exchange 1 ETH for AAVE.

The Uniswap AMM determines an exchange rate of 1 ETH to 6.005 AAVE based on the current balance of ETH and AAVE in the liquidity pool.

The trader accepts the price, completes the transaction, and is paid their 6.005 AAVE minus fees.

The AMM leverages liquidity pools to complete the bitcoin exchange automatically, eliminating the need for a second trader.

When an exchange has enough token pairs available, the AMM can trade between any two of the tokens listed, even if they are not in the same liquidity pool.

The AMM could trade DAI for ETH and then ETH for AAVE in a single transaction if a trader desired to exchange AAVE for DAI.

Liquidity pools are what they sound like. Liquidity pools are pools of cryptocurrency assets that liquidity providers lend to the system.

When liquidity is strong, AMMs perform better. If more DAI is deposited, for example, the token becomes more liquid and easier to swap. Liquidity is aided by paying interest on deposits made to liquidity providers, with interest rates rising as liquidity declines. As a result, lenders have a financial incentive to participate.

Historically, a portion of the transaction fees was used as an incentive to lend cryptocurrency. DeFi protocols have recently offered token payouts in exchange for lending bitcoins. Yield farming is a term used to describe this type of farming.

One of the most appealing aspects of DeFi is that anyone with Ethereum blockchain tokens (ERC-20 tokens) can become a liquidity provider on various AMM protocols and earn a profit.

What is the meaning of impermanent loss?

Liquidity pools can be a good method to get a return on your bitcoin investments, but storing them comes with the danger of losing them.

Impermanent loss is a loss that can occur when tokens are stored in an AMM rather than in your wallet.

Because the pool relies on the value of both tokens to stay balanced, any change in the price of one will affect the pool's balance. As a result, because the value of the two coins must remain balanced, your liquidity provider token now rights you to a different amount of coins than when you first deposited.

So, if the price of ETH rises in an ETH-DAI pool, you may end up with less ETH than you deposited, because the amount (not value) of ETH coins in the pool must decrease to keep the value of ETH in the pool level with DAI.

In our next discussion, we’ll discuss the list of Automated Market Makers.

--

--