An important pillar of DeFi are DEXs (Decentralized Exchanges). Uniswap and Curve are the main exponents here.
Let's take Uniswap as an example, whose challenge was: how to enable the creation of a distributed and fully transparent token marketplace, in such a way that it was possible within the Ethereum network to swap any token for any other token without needing a trusted third party?
The traditional approach adopted by most centralized exchanges is through the order book. In it, buyers and sellers enter their offers. Those wishing to buy or sell simply execute the operation. This transaction is always intermediated by the central exchange, which assumes the risk of non-receipt. To protect itself, it establishes margin mechanisms for all participants. Thus, when you make a purchase or sale, you do not know who is on the other side of the transaction. This model is also used by most exchanges in the traditional financial market, such as B3 and Nasdaq.
By introducing decentralization in the context of exchanges, complexity increases. This is because there is no central entity to manage the order book and act as a counterparty in transactions.
The innovative solution to this challenge came from Uniswap, currently the largest DEX. It inspired many other entrepreneurs who, taking advantage of its open-source code, created their own DEXs with few modifications. In a DeFi (Decentralized Finance) environment, this practice is common and even expected.
Uniswap introduced the so-called “liquidity pools” and the AMM (Automated Market Maker) mechanism. Imagine two interconnected pools, one with 1,000 ETH and another with 2,000,000 USDC (price of 1 ETH = 2,000 USDC). If someone wants to buy 10 ETH, they will take 10 ETH from the first pool and deposit 20,000 USDC into the second. The AMM adjusts prices according to supply and demand and uses Oracles to reflect the current market price.
A challenge is attracting investors to deposit their tokens into these liquidity pools. Uniswap solved this by rewarding liquidity providers with a significant portion of the transaction fees. This attracted many investors, resulting in pools with billions of dollars.
However, Uniswap has evolved. In its third version (v3), it optimized the compensation of liquidity providers, allowing liquidity in pools to be placed in ranges, making the system more efficient in terms of capital allocation. But this also intensified a problem known as impermanent loss, in addition to adding complexity.
Impermanent loss refers to the difference in value that a liquidity provider may incur when depositing tokens in a liquidity pool compared to simply holding the tokens in their possession. This “loss” can occur when the price of one token in the pool changes relative to the other, and it is called “impermanent” because the loss only materializes when the provider decides to withdraw their tokens from the pool.
The great advantage of Uniswap is its flexibility. It allows for the exchange of one token for another without intermediaries. In contrast, in centralized exchanges (CEX), if a listed pair is ETH/USDT and you want to exchange ETH for USDC, two operations are required. Additionally, Uniswap is decentralized, allowing anyone to create a pool for any token without the need for approval.
All transactions on Uniswap are non-custodial, with direct interactions between buyer and seller facilitated by Smart Contracts.
These ensure the simultaneous transfer of both tokens. However, liquidity providers need to transfer the custody of their tokens to the Uniswap pool to share in the transaction fees.
I dedicated myself to explaining how Uniswap works in order to then discuss the innovations that are emerging. The big challenge for any DEX is attracting liquidity providers and clients. The incentives can vary, but generally involve a capital allocation and a percentage of the revenue generated by the protocol.
Today, most of the transaction fees collected on Uniswap are returned to liquidity providers. With the increasing digitization and tokenization of currencies, I see DEXs as a way for global workers to convert their payments into currencies of their choice, whether in cryptocurrencies or digitized fiat currencies. Not to mention a DEX associated with a system maintained by a Central Bank, like Drex.
Next, I will dive into one of the most promising uses I see for DeFi, especially when our currencies are tokenized.