In this article, we will deep dive into the new and growing world of decentralized finance. I will explain to you how decentralized exchanges work and how you can participate in them to earn passive income for the money you invest. I am not here to give you investment advice, I am here solely to break down what yield farming in decentralized exchanges is and what could be the risk associated with this type of return on your crypto assets. Even if you are not familiar with the world of cryptocurrencies, I will guide you through this journey starting from the first Bitcoin transaction in 2009 to the decentralized world of finance today.
Yield farming with cryptocurrencies
Back to Basics: Bitcoin
The world of Decentralized Finance or DeFi started on the 12th of January 2009 with the first-ever Bitcoin transaction. It was the first time two individuals send money to one another across the network without the need for a central authority. On “traditional” days, when you buy a book online, you are trusting your bank to remove no more than the price of the book from your account and add it to the seller’s account. Our entire banking system is built on trust. The breakthrough of Bitcoin was that trust became distributed, so you don’t actually need to trust a central entity anymore to transfer value. Instead, you trust a network of untrusted individuals that will all verify that your transaction was executed correctly. The new technological infrastructure on top of which Bitcoin is built was called the Blockchain.
How is this done? It is a fairly complicated process called mining. Users on the network use mathematics and cryptography to solve difficult problems, validate transactions, and create Bitcoins. If you want to deep dive further into this process, there are plenty of very good articles, books, and video tutorials you can refer to, but this is not our goal today.
Bitcoin 2.0: The Ethereum Revolution
On July 30, 2015, Ethereum was released, and it was a huge revolution, even inside the Bitcoin community.
The majority of people have heard of Ethereum (ETH), but they don’t really know what makes it radically different from Bitcoin (BTC). It is a currency, yes, and it fluctuates in price against the US Dollar, these are probably the only similarities between ETH and BTC.
Ethereum was built on top of another type of Blockchain, which was very creatively called the Ethereum Blockchain. This Blockchain has the Bitcoin Blockchain as its backbone, but it is way more versatile, that is why it was nicknamed Bitcoin 2.0.
On the Ethereum Blockchain, every transaction of value can be executed, not only money transfers, as is the case with Bitcoin. For example, you can transfer your heritage on the Ethereum Blockchain, you can lease your car, or borrow money from a lender, all of this happening without a central authority to guarantee the transactions, like the central bank, your commercial bank, your car leasing company or the public administration (for your legal affairs). This is possible thanks to Smart Contracts that can be written on Ethereum using a language called Solidity.
Smart Contracts are software programs that execute on the Blockchain and can mimic real-world contracts of money or property transfer, leasing, lending and borrowing, exchanging currencies, or subscribing to insurance service providers. The Code became The Law.
Decentralized Applications and the DeFi Ecosystem
The development of Smart Contracts has opened the doors for developers to replicate programmatically all the transfers of value we use in our everyday lives.
But there was still one problem that was needed to be solved before attracting huge monetary capital to the industry. How are people going to deal with the high volatility of crypto assets? There is no way that a sane person would borrow with a very risky currency that might lose 10% of its value from one day to the other.
To solve these problems, stablecoins were created. Stablecoins are crypto-assets that maintain the same value relative to a fiat currency like the USD or the EUR. We call this stable value a peg. For example, the USDT and the DAI are two cryptocurrencies that will maintain a value of 1$. This equilibrium is achieved by producing or destroying stablecoins depending on the supply and demand market. I advise you to read more about stablecoins.
Decentralized applications are web applications that can interact with the Blockchain by using Smart Contracts to mimic the everyday traditional transactions in a decentralized way.
D-App can have many shapes and forms, but the most developed categories are:
- Decentralized Exchanges, where people can exchange different cryptocurrencies like Uniswap
- Borrowing and Lending Platforms, where people can lend and borrow crypto assets for interest like AAVE
- Derivatives Platforms, where people can buy futures contracts and options on crypto-assets like Synthetix
Yield Farming on Decentralized Exchanges, the Case of Uniswap
Decentralized exchanges are very different from centralized exchanges like Coinbase or Binance. Yes, they are decentralized, but what does that mean in practice? In traditional exchanges, there is a centralized order book, where all buyers and sellers bid for transactions, when the bid and the offer are equal, the buyer and seller are matched, and the transaction occurs. This centralized order book is said to provide ‘liquidity to the market.
In decentralized exchanges, a centralized order book is not present. That’s why it was called decentralized in the first place. Instead, liquidity providers use their own funds to ensure peer-to-peer trading inside the system. They are grouped into liquidity pools where they participate in buying and selling crypto assets from customers and benefit from a percentage of the transaction fees depending on how much money or liquidity they contribute to the pool. Liquidity providers thus earn transaction fees, this is what we call yield farming in decentralized exchanges.
Let’s look at a practical example. Let’s say I want to be a liquidity provider in the ETH/DAI liquidity pool on Uniswap: where customers exchange their DAI for ETH or vice versa, and I have 100$ to invest in this pool.
For every investor or liquidity provider, the liquidity injected must be equally divided on both tokens: I will then need to buy 50$ of DAI and 50$ of ETH to be admitted to the pool. This constraint ensures that at any point in time, the pool has equal values of DAI and ETH. My total liquidity is 100$.
If the entire pool is 10,000$, for example, my share of the entire pool is thus 1%. Therefore, I have the right to receive 1% of the transaction fees of every transaction done on this pool of liquidity. I can at any point in time, withdraw my initial liquidity injected in addition to all the fees I have accumulated during the investment period.
Yearly returns on this investment vary depending on the liquidity pool you are participating in, the activity in the DeFi ecosystem, the transaction fees, etc… You can aim for a yearly annual return of 12–25%.
Balance in the invested value of the two liquidity tokens (i.e. ETH/DAI) is key in achieving maximal returns
Risks and Watchouts While Yield Farming
You can see that the returns on this investment are pretty high. But no investment comes without risks. Rewards are high because the industry is still at its beginnings. I advise you to deep dive into the details of everything we have discussed in this article before deciding whether or not to invest in liquidity pools. You also need to watch out for the following:
- In the liquidity pool, your invested assets are cryptocurrencies. They are under the volatility risks of the crypto market. You can gain or lose from the price swings of crypto.
- You need to monitor your liquidity in the liquidity pool. If ETH prices go up or down, you will need to inject either ETH or DAI to keep the equal dollar value on both sides. Otherwise, you risk on missing transaction fees. You won’t be operating at full efficiency if one side of the balance is heavier than the other.
- Be careful of the high transaction costs on the Ethereum network. If you get money in and out of your liquidity pool very often, you might end up losing money by the end of the year.