What is an Automated Marketer (AMM) ? The heart of decentralized exchanges

You must have heard the name ” decentralized exchange ” by now, and you may be wondering exactly how decentralized exchanges work and how they differ from regular exchanges. It is clear that digital currencies, like any other asset, need an environment for transactions. In other words, these currencies need a “market” in which to buy and sell. In the first generation of digital currency exchanges, the “centralized exchanges”, the method of exchanges is very simple and understandable. Exchange offices register users’ purchase orders and sales orders in a section called the order book and match them with each other. In this way, transactions between buyers and sellers are done through the brokerage of exchange offices. However, in decentralized exchanges that do not have access to users’ assets, how can orders be completed? This is where the Automated Market Maker, or AMM for short, comes into play.
Centralized digital currency exchanges operate under the supervision of one person or group of individuals. These exchanges have direct control over users’ assets, and users are required to deposit their assets into the exchange wallet to make transactions. At the same time, centralism and institutions’ access to individual assets are contrary to the inherent nature of cryptocurrencies.
Due to these problems, decentralized digital currency exchanges or DEXs came into being to allow the direct exchange of digital currencies without requiring users to authenticate and without keeping users’ assets in safe deposit boxes. Of course, in this article from CoinMarketSIG.com we do not intend to talk about all aspects of decentralized exchanges. Rather, our focus is on one aspect: how to price and liquidate digital currencies in decentralized exchanges.
Automated Market Maker at a glance
The automated marketing algorithm is, in fact, an alternative to traditional buying and selling offices. Prior to the advent of decentralized exchanges based on automated marketers, buying and selling orders were stored in centralized exchanges’ databases, and a mechanism called a matching engine linked similar buying and selling orders.
For instance, if you want to buy 1 bitcoin for $10,000, you register your purchase order at an exchange. Bitcoin sellers, on the other hand, place their sales orders at the prices they want, and then the exchange-matching engine comes into play. The matching engine compares the buy and sell orders, and when two orders (buy and sell) are registered for the same amount (for example, $10,000), it trades between them. That is, it transfers the seller’s bitcoins to the buyer and the buyer’s dollars to the seller.
Nevertheless, the new generation of decentralized exchanges has generally removed the book of orders from its platform and replaced it with the concept of automated marketing. An automated market maker is a collection of several blockchain smart contracts that provide the necessary liquidity for each trading pair and determine the price of currencies based on the supply and demand mechanism.
The automated marketing algorithm creates space for different trading pairs as a pool of liquidity. Each liquidity pool is set up by depositing an equivalent amount of trading currency. Now, in order to make an exchange, people can attach their wallet to the smart contract of the desired liquidity pool and receive the equivalent amount of the other token by depositing one of the tokens. In fact, in this method, instead of exchanging tokens with each other, people exchange tokens with a smart cash pool contract.
The ratio of tokens in the pool indicates their supply and demand rates. Therefore, the automaker uses this ratio to calculate changes in currency prices over time. The people who provide liquidity for the pairs of values in the pools are called “liquidity providers”. By locking their assets in the pool, these people can earn a portion of the commissions paid by the traders. They can also release their assets and withdraw from the liquidity pool whenever they want.
What is an Automated Market Maker (AMM)?
Automated marketer, as its name implies (marketer + automaker), is a mathematical algorithm that creates a market for direct trades in decentralized exchanges. By market, we mean the conditions that must be met in order for a trade to take place. This algorithm automatically determines the price of assets using the supply and demand mechanism and allows users to trade without registering a buy and sell order, and even without the need for the other party (seller or buyer).
In order to better understand the performance of automated market makers, we remind you once again that the performance of decentralized exchanges does not depend on a particular organization. These platforms are in fact smart contracts that are registered and executed on the blockchain. Therefore, they must have a specific protocol for pricing assets, providing liquidity and adjusting it. This task is the responsibility of the automated market maker.
If we know how to trade in the first generations of decentralized exchanges (such as BitShears and Bainance Dex) person-to-person or peer-to-peer, trading in market-based decentralized exchanges, as a person-to-contract (Peer-to -contract) is done. Because users can connect their personal wallet to the exchange platform (while retaining full control over their assets), they can buy or sell their assets directly from a smart contract.
An automated marketer is like a robot that has the task of calculating the price of a currency against the currency now and offering it to you. In other words, when you want to buy or sell a digital currency in exchange for another digital currency, it sets the equivalent for you. The formula of automated market makers of different exchanges is different from each other. Some, like Uniswap and Pancakeswap, use simpler formulas, while others, like Curve and Balancer, have formulas that are more complex.
The Uniswap exchange formula for determining the price is x * y = K. In this formula, x is the inventory (number of units) of a digital currency in the liquidity pool and y is the inventory of another digital currency that is to be traded. K In this formula is a fixed number and indicates the amount of liquidity of the entire pool.
How Do Automated Marketers Work?
Imagine that you have chosen the ETH/UNI currency pair and you want to buy ion tokens in exchange for selling some of your ethers. To do this, you must deposit ether tokens into the pool and receive the equivalent ion tokens. In this case, the volume of ether in the liquidity pool is high and the ionic volume in this pool is reduced. Therefore, it is natural that the ionic price goes up for a while and instead, the ether price goes down. This goes on until others do the opposite of what you do and the price rebalances. Of course, this happens sooner than you think. Because when the price of a digital currency (or a token) goes down in an exchange, many people will want to buy it and the price will return to equilibrium.
The automated marketer determines their value (or price) relative to each other based on the weight ratio of the assets in the pool. In more complex protocols, such as the Balancer, whose pools contain a basket of currencies instead of one currency, the calculation of this weight ratio is somewhat more complicated. However, in protocols such as UniSwap, SushiSwap, and PancakeSwap, which use the simplest form of marketing, the weight ratio of currencies is calculated from the relation x * y = K.
Another concept you need to understand the performance of automated marketers is “liquidity pool” and “liquidity provider”. The question may arise in your mind that when decentralized exchanges do not use the order book and do the transactions themselves, where they get this amount of liquidity. In other words, how do they have so many high-volume tokens that they provide to users whenever they need them?
The point is that in automated marketers, there is a section called the liquidity pool that some exchange users, whom we call liquidity providers, charge. Join us in the next section of the article to better understand the role of the liquidity pool and the responsibilities of liquidity providers.
What is a liquidity pool?
That being said, in an automated market there is no need for two parties to trade and only one seller or one buyer is enough to trade; yet we still need someone to create this market. For instance, when you want to sell your ether in exchange for a Dai Token (DAI), the smart contract your trading partner must have has enough Dai to deposit in your wallet. This is where liquidity comes in. Users, so-called “Liquidity Providers” (LPs), provide liquidity of automated marketers.
Each user can contribute to the liquidity of the pools as much as they want. Market-based exchanges allocate all or part of their exchange fees to liquidity providers to encourage more liquidity.
The general process of providing liquidity in automated pools is as follows:
- People who intend to deposit their assets, according to the interest rates of different pools, choose the pool they want to provide liquidity.
- Liquidity suppliers attach their wallets to the smart contract of the pool in question. In this way, the smart contract is allowed to access a specified amount of tokens and use it to make exchanges with other users.
- Then determine the amount to provide liquidity and provide the same amount of liquidity from each pair of tokens in the pool. For example, if you want to provide cash for 1 ether in an ETH/DAI pool, you must deposit the equivalent of 1 ether of DAI tokens.
- After depositing the assets in the pool in question, the smart contract transfers the LP tokens of the same pool to their wallets as much as the individual’s share of the cash in each pool. For example, if you have cash in your ETH / DAI pool, you will receive an ETH-DAI LP token.
- Token exchange fees are automatically paid to the respective pools, and users earn the same amount of their pool liquidity as the accumulated fees. Finally, liquidity providers can deposit LP tokens into a smart contract at any time and receive deposit tokens deposited in the pool along with commission profits.
The amount and manner of distribution of commission profits among liquidity providers varies depending on the economic model designed for each protocol. UniSwap, for example, receives 0.3% of the value of each transaction as a commission and transfers it directly to liquidity providers. Sushi Swap Exchange also charges 0.3% of each transaction; yet it devotes part of it to its profit-making platform. On the other hand, other platforms may charge less to attract more users. For instance, the PancakeSwap exchange receives 0.2% of the transaction value as a fee from traders and allocates it to liquidity suppliers.
That is not the whole story of automated marketers and liquidity pools. One of the potential risks for liquidity suppliers in automated market makers is impermanent loss.
In conclusion
Automated Marketing is one of the most important achievements of Decentralized Finance. Although automated marketers have, their own limitations compared to exchange offices, and although they are not as easy to use as traditional exchanges, their innovation in the world of cryptocurrencies is invaluable.
We must not forget that automated marketers are still in the early stages of development. The types of marketers such as UniSwap, SushiSwap, and PancakeSwap that we know and use today usually have nice, user-friendly interfaces, but are still limited in functionality.
These exchanges, like any other innovation, need time to show all their capabilities and reach their maximum potential. In the not-too-distant future, with the further advancement of this technology, automated marketers will be designed to provide not only user-friendliness, lower fees, and ultimately more liquidity for DeFi users.
Comments
Post a Comment