
Before we begin and explore what decentralized exchanges, liquidity pools, and automated market makers are, it’s a good idea to briefly review what DApps are and their importance in the DeFi ecosystem.
Ready?
DApps, or decentralized applications, are nothing more and nothing less than computer programs very similar to conventional ones, with the difference that their operational logic is based on smart contracts and their code is stored immutably on the blockchain, thereby achieving decentralization of control and of all the functionalities for which they have been programmed.
If we divide the architecture of these DApps into two distinct parts—such as the back-end (which handles all the logic) and the front-end (which interacts with users and is the visible part of the application)—it is important to understand that the part stored and executed on the blockchain is the back-end, though it does not necessarily have to be all the logic, but rather the most sensitive part and the one most susceptible to changes and manipulation. It would not make sense to include the front-end on the blockchain, as this would entail unnecessary extra costs and potential future complications if we want to improve or modify this entire visual component.
When a user runs or uses one of these applications, what they are actually doing is interacting with smart contracts that are programmed to ensure the application functions properly.
Once these DApps are up and running, their operational logic cannot be modified, making them more secure and reliable than traditional applications hosted on centralized servers. Furthermore, all of their code is public and auditable, so anyone in the world can review it and report potential bugs, as well as develop new, improved versions based on the previous ones, leveraging the collective intelligence of the ecosystem.
On the other hand, DeFi, or decentralized finance, refers to a new financial system based on blockchain technology as a means of decentralizing all the financial products offered within it. This ecosystem is primarily supported by applications—or rather, protocols—that interact with one another, offering a new world of possibilities for the financial sector, where users are at the center, enabling financial interactions among themselves completely independent of any intermediary, or in other words, ensuring that all the value generated flows back to them, rather than remaining concentrated in the hands of a few, as has been the case until now.
DApps are a key component of the entire DeFi ecosystem, because if we want to develop a decentralized financial system, it would make no sense to use centralized applications, whose control and governance are in the hands of companies or organizations that assume all this responsibility.
With all this in mind, we can understand the fundamentals of decentralized exchanges and liquidity pools, as well as their value proposition.

A decentralized exchange (DEX) is one of the most important components of DeFi, serving as a trading platform based on autonomous, decentralized trading mechanisms known as automated market makers (AMMs).
These DEXs operate through smart contracts known as liquidity pools, which enable peer-to-peer token trading without the need for order books.
Don't worry, let's first take a look at how traditional markets work, and then we'll come back to this.
As we may have guessed, traditional markets operate using order books—that is, a collection of buy and sell orders that are recorded in an organized manner for the purpose of trading an asset. If someone wanted to trade their asset—let’s say BTC for UST—they would have two ways to do so.
The first option is to buy or sell at the market price by executing the buy or sell order at the top of the order book.
The second scenario arises when you want to buy or sell at a price different from the market price. In that case, you would place an order to buy or sell at a specific price and wait for a buyer or seller willing to buy or sell at that price.
As we can see, these markets serve as a meeting place for supply and demand, determining the price of an asset based on the value that buyers and sellers are willing to pay.
The problem with this mechanism is that a lack of liquidity often leads to a sharp price disparity between buy and sell orders, making the trading process inefficient and less dynamic.
Furthermore, in the event of sharp market declines caused by a surge in sell orders, the price may fall to very low levels or even zero, as it will continue to drop until it encounters a buy order.
To avoid these problems, traditional markets use market makers (MMs)—entities with high liquidity that place orders on both sides of the market, making trading more attractive and fluid.
The downside of market makers is that their buy and sell orders are not genuine; rather, they are manipulative bids and offers designed to artificially drive up or down the asset's price.
AMMs emerged with the aim of eliminating intermediaries in traditional markets—such as market makers—and automating the process of trading assets in a fully decentralized and open manner accessible to everyone.
The first major difference is that there is no longer a buy/sell order book, and we no longer need two parties—a buyer and a seller—interested in making a trade. So how does it work?
The system operates through liquidity pools, which allow for swaps between two pairs of tokens. We can think of a liquidity pool as a safe containing two pairs of assets, which I can withdraw or deposit from the safe as long as I provide the other asset. If we encounter a liquidity pool for the BTC/UST pair and I intend to buy BTC, I will go to this pool, request a withdrawal of BTC, and in exchange deposit UST in the ratio established by the pool.
These liquidity pools are essentially smart contracts that hold the tokens and determine their price—not through buy/sell orders, but through mathematical and algorithmic functions that set the price of the assets based on the pool’s movements and current state.

To better understand how the smart contract sets the price, we’ll use a practical example.
When we talk about pools, we’ll be referring to the simplest and most popular ones currently available—those where only two pairs of tokens are traded—since some pools allow for more than two pairs to be traded, but we’re keeping it simple for the sake of clarity.
The mathematical formula used to determine the price is as follows:
invariant = asset1 * asset2
Returning to the previous example, let’s consider a liquidity pool for the BTC/UST pair, where 2 BTC and 91,500 UST are held. The invariant (invariant = BTC * UST) for this pool will be 183,000 (2 × 91,500). This value will remain constant, and it will be used to recalculate the amount of assets that must be returned for each swap.
Let’s imagine that a user wants to exchange 1 BTC for UST through this pool; as a result, the pool would end up with 3 BTC in exchange for a reduction in UST, which is exactly the amount it will return to the user in the exchange.
Returning to the formula, we would find the following situation: 183,000 = 3 × UST. Solving for UST gives us a result of 61,000 UST, that is, the pool has gone from holding 91,500 UST to holding 61,000 UST; the difference between these two values is what will be returned in the exchange, therefore 30,500 UST (91,500 UST – 61,000 UST).
If we were to make another swap in this pool, the amount of UST we would receive would be less than before, since the swap price is directly related to the pool’s liquidity. In this case, we would be putting pressure on the pool by continuing to request UST in exchange for BTC.
Obviously, in practice, there would be other users performing the opposite transaction, which would offset the swap and balance the pool. In this regard, it is important to note that the greater the pool’s liquidity, the lower the cost of the swap—and vice versa—thereby incentivizing users to make swaps during periods of high liquidity and discouraging them when liquidity is low.
Let's see, then, how much the pool would pay us back if we wanted to make another 1 BTC trade.
Applying the formula again: 183,000 = 4 * UST; therefore, the pool will hold 45,750 UST after the exchange, which means that the user will receive 15,250 UST (61,000 UST – 45,750 UST) for 1 BTC.
This example is for illustrative purposes only and is exaggerated to help you understand how pools would respond to constant swaps in favor of a particular token. Fortunately, in practice, these price differences are much smaller—provided, of course, that the pool’s liquidity remains at optimal levels in relation to its usability.
The next question we should ask ourselves is, Who provides this liquidity to the pool?
The answer is liquidity providers (LPs)—or, more broadly, anyone in the world willing to deposit their tokens in exchange for a return.
Using a pool to facilitate token swaps involves an associated cost that typically ranges from 0.2% to 0.6% per swap; this fee is used to reward LPs for their contributions, thereby making the system much more efficient, since liquidity can be viewed as the fuel—a fundamental component for ensuring the survival and stability of DEXs.
Without it, as we have seen earlier, transaction costs would be too high, and users would be discouraged from trading on the DEX; this, in turn, would lead to LP providers being more inclined to move their liquidity to other pools where the rewards for their contributions are higher.
Some of the best-known and most widely used DEXs today on some of the major networks are:
It is important to note that liquidity pools are not risk-free and that LPs may be subject to a type of loss known as impermanent loss, caused by the constant fluctuations in the value of the various token pairs that make up the pools. This results in a difference in value between the amount contributed to the pool when providing liquidity and the amount received when withdrawing tokens from it.
Let's see how this plays out.
Returning to the previous example, let’s imagine that an LP decides to contribute 0.5 BTC and 22,875 UST (the two tokens must be contributed in the same proportion, 50:50), keeping in mind that 1 BTC is equivalent to 45,750 UST at that moment.
If the pool has a total value of 183,000 UST at the time of deposit, the LP allocation would be set at 25% of the total pool value (45,750 UST / 183,000 UST).
This 25% will remain constant regardless of fluctuations in the price of the tokens in the pool, so when the LP decides to withdraw their funds, they will be entitled to 25%.
If the price of BTC were to hypothetically double to 91,500 UST, the BTC/UST ratio would change, with the amount of BTC decreasing and the amount of UST increasing, while keeping the pool’s initial ratio constant. As mentioned earlier, the invariant remains fixed.
Let's calculate what this ratio would look like now following the increase in the price of BTC.
We know that the price of BTC can be calculated using the following formula: amount of BTC in the pool / amount of UST in the pool.
The invariant remains at 183,000.
Using the invariant formula, we can calculate the liquidity (amount) of BTC and UST that will result in a rise in the price of BTC. The formula would look like this:
BTC Liquidity = square root (invariant / BTC price).
UST liquidity = square root (invariant Ă— BTC price).
Therefore, the amount of BTC would become 1,414, and the amount of UST would become 129,400.5 UST. If we multiply these two values, we see that the invariant has not changed.
In this context, if the LP were to withdraw their contribution from the pool, they would receive 25% of the total—that is, 25% of 1.414 BTC and 25% of 129,400 UST—which would amount to 0.35 BTC and 32,350 UST. The value in UST would be 64,525 UST (0.35 BTC × 91,500 UST + 32,350 UST).
However, if the user had kept their assets in their portfolio instead of providing liquidity to the pool, their current value—taking into account the rise in BTC—would be 68,625 UST (0.5 UST × 91,500 UST + 22,875), a negative difference of 4,100 UST (64,525 UST – 68,625 UST).
As we have seen, impermanent loss is a factor to consider when depositing liquidity into a protocol, especially when dealing with highly volatile tokens or in bull markets where the pool consists of a token and a stablecoin, as in this example. In bear markets, the effect would be the opposite, and we could benefit from downward fluctuations in the price of the deposited token as our holdings of that token increase.
On the other hand, it’s important to remember that this loss only materializes if liquidity is withdrawn from the pool, and that the return we receive on our contribution in the form of interest could offset or even exceed this loss in unfavorable situations. Therefore, it’s important to carefully analyze each individual case and assess whether or not it’s profitable to become an LP.
As we have seen, this decentralized exchange system represents a disruptive shift compared to its centralized counterparts, allowing anyone to contribute liquidity to DEXs and earn additional returns on their assets, while also offering token issuers the opportunity to create new markets to trade their tokens and provide them with liquidity without having to list them on a centralized exchange, with the high costs and potential rejections that would entail.
In this regard Domoblock will leverage this wonderful way of adding value and liquidity to list the security tokens of the real estate projects it issues, creating a secondary market that will enhance liquidity for investors by allowing them to exit their investment by selling their shares whenever they choose. This is a key differentiator compared to traditional real estate investments.
DeFi represents a shift in the way the new financial ecosystem operates, and this is just the beginning—innovation has only just begun.
.png)
Funded:
-
-
Objective:
389.735,25 €