Together with…

Introduction
Those interested in cryptocurrency have certainly read of or heard mention the acronyms CEX (centralised exchange) and DEX (decentralised exchange), they represent two fundamental elements of this industry, two technologies that have and are completely revolutionising the way of trading and that therefore it is good to know and understand thoroughly.
A CEX is a cryptocurrency and crypto token exchange, whose main feature is to process transactions through an order book, which guarantees data security and the success of exchanges. A CEX allows its users to operate following a registration process in which it is necessary to complete a procedure defined as KYC (Know-Your-Customer). These types of exchanges, while using blockchain technology that guarantees the certainty and incorruptibility of transactions, are owned by private corporations whose profits derive mainly from the application of transaction fees (transaction fees) for the use of exchange services.
On the contrary, a DEX is an exchange able to offer the same functionalities of a CEX, using a logic of total decentralisation based on the presence of algorithms and smart contracts able to govern and manage the transactions requested by users. In the use of a DEX there is no need for users to provide their personal data: this condition of total freedom and lack of control, although it represents the pure philosophy behind the concept of decentralised finance, could represent a strong limitation to the development and adoption of these innovative technologies.
In a nutshell, the main difference between the two types of exchanges lies in the fact that while in the CEX the private keys of a user’s wallet are kept, albeit in full safety, within the platform, in the DEXs the user simply needs to connect their public key to the platform to start operating without any type of registration, remaining in complete anonymity.
Let’s focus now on the primary services offered by cryptographic exchanges (both CEX and DEX) i.e., the exchange of goods / assets between two or more parties. The logic behind the exchanges is the same as the one used in a traditional (non-crypto) financial market. The price of the exchange of two or more assets is regulated by the law of “supply and demand” through the market maker, an institutional operator who is responsible for guaranteeing, on an ongoing basis, the marketability of certain securities. The presence of significant liquidity on the markets guarantees the successful outcome of the transactions and at the same time avoids excessive disparities between the asking price defined as Bid or Money and the offer price defined as Ask or Letter.
The huge explosion, in an incredibly short time, of decentralised finance services has highlighted some limitations and criticalities typical of order book-based exchanges and this has led to the research and development of a technology capable of replacing and making the activity of “market making” more efficient, defined as Automated Market Maker (AMM). In order to fully understand the functioning of the AMM, it is necessary to have a clear understanding of the activity of a traditional market maker.
What is a Market Maker?
The market maker, traditionally a qualified and regulated intermediary, has a fundamental role in coordinating the financial markets, as it makes public both the purchase (Bid) and the selling (Ask) prices referring to the assets traded on such markets, allowing all investors involved in trading to buy or sell. To carry out these transactions it is therefore essential that the markets have the correct liquidity, thanks to which the different requests for demand and offer proposals can cross each other and allow a correct conclusion of the exchange at prices that are satisfactory for both parties involved.
In a centralised CEX cryptographic platform, this important role is entrusted to the company that manages and operates the exchange through the presence of an order book. In short, the purchase (Bid) and sale (Ask) proposals of crypto assets are entered in the trading book in order of increasing price the former, and in order of decreasing price the latter, according to a criterion defined BBO (Best Bid and Offer). When there is a correspondence between the two prices, an exchange is concluded, and the transaction is executed. However, the prices offered for sale do not always correspond exactly to those present in the purchase. In this case the price differential is called the spread, and represents one of the market maker’s earning items. Due to the presence of these spreads, the liquidity of the market plays a fundamental role. In highly liquid markets, there are very small spreads and transactions match more efficiently. In these cases, the gain of the market maker on the single trade is certainly lower, but it is compensated by the presence of higher volumes.
The process described above has some important inefficiencies deriving from the slow execution of trades through order books, especially in conditions of very high volumes, generating a paradox: “the markets need a lot of liquidity to guarantee large volumes and reduce spreads but high trading volumes generate inefficiencies and latencies. “
Due to this paradox, as previously mentioned, with the development of DeFi it was necessary to implement a new technology capable of making exchanges more efficient and defined, Automated Market Maker (AMM).
AMM: what are they?
An Automated Market Maker (AMM) is the main element on which a decentralised exchange (DEX) is based, the infrastructure behind DeFi services. It has the role of automating exchanges between crypto assets by defining their price through automated valuation algorithms and is responsible for the formation of Bid / Ask spreads.
The aim of the AMMs is to eliminate the inefficiencies of the order books even in the presence of very high volumes, proceeding to settle any transaction immediately and exploiting the presence of a liquidity pool in the DEX powered by users called liquidity providers through smart contracts.

It is interesting to examine the growth phenomenon of decentralised exchanges based on AMM: the incredible growth that started in the year 2020, allowed in a few months, to reach volumes of $ 163.28 billion and then stabilise between 50 and 75 USD billion.
Focus on… Smart Contract
Smart Contracts, are applications resident on blockchains that regulate and allow the execution in a certain and unambiguous manner of specific rules defined a priori. They allow the creation of trustless protocols, able to guarantee compliance with certain commitments between several parties, without the need to know each other.
The concept of smart contract was born with the Ethereum network, the first blockchain defined as “programmable” that is capable of allowing the execution of activities other than the simple exchange of two assets. Smart Contracts have defined the concept of “code is law” since these contracts perform certain operations only if all the conditions set out in them and at a certain time are met.
AMM: How do they work?
When a user A decides to set up an exchange operation of a cryptographic asset (a trade) on an AMM, the presence of a physical counterparty (user B) who is willing to accept and execute the requested exchange is not required.
The trade is executed having as a counterpart a smart contract, which thanks to the presence of a liquidity pool creates the necessary market so that the pairs of cryptographic assets, object of the trade, can be immediately exchanged with each other.
However, the exchange of these assets must take place at a certain price, which in this case is completely managed through dedicated algorithms, unlike what happens in the CEX, where it is the presence of two physical counterparties, seller and buyer to define the exchange prices and relative supply / demand spreads.
Although counterparties directly involved in exchanges are not necessary, the presence of a market is still necessary (intended as the quantity of liquid assets to be exchanged between them), to which smart contracts can turn to complete the transactions. These markets are generated through the contribution of tokens or pairs of tokens to the liquidity pools connected to the AMMs by users who choose to play the role of liquidity providers (LP).
Basically, in transactions governed by AMM, human presence is no longer necessary at the transaction level, which takes place in an automated and efficient manner through algorithms, but is necessary at the level of capital injection. The capital contributed by users is remunerated through the recognition of APY defined interests, as explained in the previous analysis, since their presence guarantees the formation and balance of the market necessary for the proper functioning of the Automated Market Makers.
Comparison of monthly decentralised trading volumes and AMM

The chart compares the monthly volumes of decentralised trading that occur through AMM versus those that occur with traditional market makers. Hence the importance of Automated Market Makers, as their use has increased significantly since January 2020, managing to exceed the number of exchanges managed in a “classic” manner by June 2020.
AMM: Pros and Cons.
Automated Market Makers have 3 main characteristics:
- Decentralisation: in fact, they eliminate the need to find a correspondence between buyer and seller, thus not having to rely on centralised entities.
- 24/7 operations and ample liquidity: since the protocols are controlled by smart contracts and algorithms, the operations can be carried out every day and at any time without drops in liquidity deriving from the reduced presence of operators;
- Anonymity: it is not necessary to provide any personal information to operate with AMM protocols;
At the present time, where the development of these markets is still in its infancy, however, they present some important critical elements:
- Slippage: term used to indicate the percentage difference between the actual execution price of an order and the execution price entered by the trader. Slippage occurs when the market moves in the opposite direction to that set in the trade while the order is being executed, and therefore the original price liked by the trader is no longer available on the market. Slippage is highly correlated with market volatility – with tens of thousands of transactions per hour as cryptocurrencies fluctuate almost constantly, this can create situations where the actual execution price of an order is significantly slippery. Furthermore, since in the AMM platforms the price of the assets is determined in an algorithmic way and varies according to the ratio between the tokens present in the liquidity pools, the slippage can increase especially for orders of great value, since it is able to modify the ratio between the currency pairs present in the pool significantly. To overcome this problem, some platforms such as Curve allow you to establish a maximum slippage level, beyond which the order is not executed. It is important to consider that slippage can also be positive for the trader: this occurs when an order is executed at a better price than the one set during the entry phase.
- Impermanent loss: although AMMs offer significant returns to users who decide to provide liquidity necessary for the proper functioning of exchanges, there is a risk of “impermanent loss” such that, due to fluctuations in the prices of deposited assets it is possible to record temporary decreases in value of one’s own resources deposited in the pool. An in-depth analysis of the impermanent loss was dealt with in the analysis on the liquidity pool.
- Arbitrage and inefficiencies: the presence on these markets of even slight inefficiencies could allow particularly careful and gifted traders to implement arbitrage. However, arbitrage is a very important stabilisation mechanism. The liquidity pools, or the pairs of tokens deposited and made available to the AMM mechanisms, need to be in numerical equilibrium with each other. In the event that an imbalance occurs within a pool of liquidity, for example due to an order of great value or high volatility on one of the assets that make up the pairs, concrete arbitrage opportunities would immediately be generated. At this point, the intervention of arbitrage traders, ready to take advantage of these inefficiencies, would bring the price ratios of the entire pool back into equilibrium, restoring the proper functioning of the protocol.
- Increase in the price of the “gas fees” necessary for transactions: each transaction on decentralised protocol is subject to the payment of a transaction fee, which is the basis of the remuneration of liquidity providers and therefore of the entire decentralised trading system. The possibility present in some protocols of being able to speed up the transaction by paying a greater amount of gas fee, added to the congestion of the protocols due to the exponential increase in transactions, has made, in some cases, extremely onerous to trade on DEX, to the point of forcing the developers of some protocols to propose structural changes in order to bring operating costs back to acceptable levels.
Conclusions…
The introduction of AMMs in the already innovative cryptographic ecosystem is allowing further impetus (albeit not without criticality) to the Decentralised Finance industry, disrupting in fact not only the methods of trading and exchanging cryptographic assets, but also introducing incredibly disruptive opportunities between operators. In recent months the foundations are literally being built for the formation of a whole new industry, and a myriad of new needs, services and employment opportunities gravitating around it.
We tend to believe that, thanks to these technologies, many financial services could evolve and be translated on cryptographic protocols, thus promoting efficiency and greater democratisation of the entire global financial system.
For this to happen, however, a regulatory effort as well as a technical effort at a global level is necessary, aimed at encouraging the use of these technologies and the integration of these new markets and new players with capital and expertise deriving from the traditional financial industry.