The world of cryptocurrency is fairly complex and vast. There are many aspects to it, like smart contracts, dapps, DeFi ecosystem, and much more. Although each sector has found its place, the DeFi ecosystem is the one that would excite people the most.
DeFi ecosystem makes the finance system truly decentralized as it is supposed to be. In the same way, the heart of all the decentralized systems is the Automated Market Maker (AMM). AMMs can completely eliminate the need for having centralized bodies for trading assets and that’s the point of using cryptocurrencies, right?
So let’s dive deep and try to understand what is an Automated Market Maker, how it works, and how it is different from the traditional market makers. We will use simple analogies and examples to make this concept easy to wrap your heads around.
But first, let’s quickly go through how the market works traditionally.
The way Traditional Market works
A traditional market is the one we use on centralized exchanges. The trade begins with a buy order placed by a trader. The exchange platform then finds a suitable seller who is willing to complete the trade at a price proposed by the buyer.
Basically, this model requires an active buyer, seller, and a middleman to execute the trade. But what if one of the three elements is unavailable? Well, in that case, the asset is said to have low liquidity as there is less trading activity for that particular asset.
To solve this issue, centralized exchanges rely on financial institutes and professional traders who provide liquidity to the market. Although this model works fine for centralized exchanges, we cannot use the same for DEX or decentralized exchanges.
Market Maker vs Automated Market Maker
This is where the automated market maker comes into the picture. The difference between a traditional market maker and an automated market maker is that it eliminates the need of having an active buyer and seller pair to execute a trade.
This dependency is overcome with the help of liquidity pools. The order book showing the current exchange rates in CEX is replaced by a liquidity pool that uses AMMs’ protocol to discover the price of tokens.
Furthermore, as it is based on a decentralized exchange, it eliminates the involvement of any third party in any transaction. This would give you an idea of how AMMs are different from their traditional counterparts but what exactly are the automated market makers?
What is an Automated Market Maker?
An automated market maker as the name suggests is a protocol used by decentralized exchanges that automate the process of providing liquidity for the trades. It is a smart contract code that controls the price of tokens placed in a liquidity pool to create a market on DEXs.
To simplify it further, an AMM is an algorithm that increases or decreases the price of tokens locked in a liquidity pool. It allows traders to exchange tokens based on a price that is driven by supply and demand.
AMM establishes a peer-to-contract connection, i.e. a trader can execute a transaction by exchanging tokens with the smart contract which is more secured and is available 24/7 as compared to a transaction using a peer-to-peer connection.
How Does Automated Market Maker Work?
The automated market makers were brought to solve the issues DEXs were facing. The first issue was low liquidity. Decentralized exchanges like Uniswap are often more complicated to use than centralized exchanges like Coinbase and Binance.
Due to their complicated interface, many users found themselves comfortable using CEX. So the number of buyers and sellers available on decentralized exchanges is often less making it difficult to exchange tokens with each other.
AMM solves this issue by using a liquidity pool that facilitates these exchanges. A number of liquidity providers can join the pool by contributing a pair of assets in a 50:50 ratio. For example, if a liquidity provider wants to provide liquidity worth $2000, he can lock his ETH worth $1000 and BTC worth $1000 in the liquidity pool.
Another issue with traditional market makers was price discovery. More often there is latency in price discovery or even the possibility of market price manipulation as it is dependent on human market makers.
As AMM is a code-driven algorithm, it uses a mathematical equation to control the prices of assets locked into the pool. The equation is called a constant product formula which goes like this:
X * Y = K
Here, X represents the amount of token A and Y represents the amount of token B and they are variables. K is the constant that indicates the total price of tokens in a liquidity pool.
As the liquidity pool is being used, the amount of tokens A and B will continue to vary. But the AMM algorithm will make sure that “K” remains constant. To achieve that, the algorithm takes into account the chain of supply and demand.
For example, consider an ETH/BTC pool that is worth $1000. Now if you want to trade $200 worth of ETH with BTC from the pool, you will be adding more ETH to the pool and increasing its supply. Thus, the algorithm will decrease the value of ETH to keep the K constant.
The automated market maker is a sophisticated algorithm that has held the DeFi ecosystem together. Today, we have some popular AMM platforms like Uniswap, Curve, PancakeSwap, and Balancer. Although the technology seems new and way ahead of its time, it has proved to be reliable.