BitMEX founder Arthur Hayes: Discussing the risks of DeFi yield farming
This article was published on ChainNews, author: Arthur Hayes, founder of BitMEX, translated by Lu Jiangfei.
After the outbreak of the COVID-19 pandemic, I became an avid cyclist, riding twice a week for 40-60 kilometers each time. Cycling is quite popular among younger crowds, but for someone like me, an "old man," riding at 5 AM feels as exhilarating as young people partying. However, cycling is a high-risk activity. Before this, I once reached a top speed of 52 kilometers per hour, which means that with a slight mishap, I could easily be in serious trouble.
Of course, besides exercise, cycling provided me with some much-needed fresh air, allowing me to gather enough energy to think. Among my cycling partners, one happens to be a cryptocurrency "farmer." During a recent ride, we had a discussion about risk management, focusing on the types of risks that decentralized finance "farmers" (also known as liquidity miners) face when investing their funds. I summarized and categorized our conversation, hoping this article will help everyone understand why yield farming is so popular, while also presenting a conceptual framework aimed at assessing the risks taken by "cryptocurrency farmers."
Farmville
DeFi is essentially a project ecosystem designed to provide financial services in the digital world without relying on centralized financial service providers like banks. For example, many DeFi projects allow people to borrow money directly from others, making the process very convenient. Those who lend money can earn rewards built into the DeFi network. DeFi has a significant impact on the future development of the lending market, primarily reflected in the following two characteristics:
- DeFi does not require credit checks, personal data, or bank accounts;
- Anyone can participate, and loan terms are executed through immutable smart contracts, eliminating the need for trusted intermediaries.
A typical example of a "centralized intermediary" is a bank. In August 2020, I wrote an article titled "Dreams of a Peasant" (Dreams of a Peasant), discussing how the DeFi ecosystem constructs proto-banks in the digital survival environment of humanity. As a concept, I fully agree that ultimately all banks and financial services should be replaced by open-source code. Although the DeFi ecosystem is still far from achieving this goal, I bet it will eventually happen.
Project ownership is open to everyone and provides useful services to the entire network. Given that many DeFi projects focus on providing lending or asset exchange services, these projects require liquidity from lenders and market makers. To reward those who lend assets, projects typically mint a native token and distribute these tokens to all lenders (usually according to a distribution schedule), with the distribution ratio generally proportional to the percentage of the total loan pool represented by the funds provided by liquidity providers (LPs). The proportion of these tokens held also represents the percentage of ownership in the project. If the utility of the project improves, the corresponding native or governance tokens will appreciate in value. In some cases, these tokens can even be used to pay certain fees set by the platform—such as a portion of the trading fees charged by decentralized exchanges.
Additionally, these tokens will enable token holders to vote on how the protocol operates and is managed. Imagine a DeFi bank where token holders can vote on interest rate spreads and the types of collateral that can be used for loans. Now imagine a decentralized asset exchange (like Uniswap, Sushiswap, 1inch, etc.) where token holders can vote on trading fee rates.
Let me give a hypothetical example to illustrate a brief cycle of yield farming using native tokens on a DeFi protocol. We assume there is a simple DeFi protocol that allows borrowers to deposit ETH and borrow a fiat-backed stablecoin, Tether (USDT):
- The protocol launches and seeks users to provide USDT loans secured by ETH;
- The governance token of the protocol is called CORN, and over the next 1000 days, 1000 CORN tokens will be distributed daily. Of the total daily distributed CORN tokens, 75% will be allocated to lenders based on the percentage of funds they provide in the USDT lending pool. The remaining 25% of tokens will be allocated to borrowers, with the distribution ratio based on the percentage of ETH borrowed each day. One very important point: you cannot directly purchase CORN tokens from the protocol; you must participate in lending transactions to earn CORN tokens. However, once CORN tokens are in circulation, you can buy them from those selling CORN tokens on the secondary market.
- From this model, it can be seen that whether you lend or borrow funds within the protocol, you can earn token rewards, and these tokens can represent ownership in the protocol. Imagine if you are poor and cannot have a real bank account; when you want to cash a COVID-19 relief check provided by the U.S. government, the bank charges you a 20% fee. Additionally, every time you overdraft a little money, those "too big to fail" banks charge you hefty overdraft fees. My mother told me that these fee-charging banks make life miserable for the poor. During the peak of the pandemic, many maskless poor people had to line up and pay a $200 fee to cash a $1200 government relief check. I am disappointed in the U.S. government.
- As a lender of USDT, you can connect your Ethereum network wallet in your browser to the CORN Web 3 site (the most commonly used wallet is MetaMask). After authorizing the connection, you can choose to stake— for example, allowing the lending of USDT and receiving corresponding CORN tokens. CORN will charge borrowers ETH interest, then exchange it for USDT on a decentralized exchange (like Uniswap), and then use USDT to pay interest to lenders, all of which is automated by the program.
- If you are a borrower, you also need to connect your wallet to the CORN platform in your browser. You do not need to stake USDT but must stake ETH as collateral, then borrow USDT and pay continuous interest with ETH. To repay the loan and recover your ETH collateral, you need to send the USDT you owe to the CORN protocol, which will implement a minimum leverage ratio based on the external ETH/USDT price. As a borrower, if you fail to repay the minimum payment on time, the ETH you staked will be automatically sold on a decentralized exchange (DEX), and the proceeds will be used to repay the amount you owe.
- Whether you are borrowing or lending, you need to stake USDT and/or ETH on the CORN protocol, and you will continuously be counted as a lender of CORN tokens. The CORN token represents a portion of ownership in the CORN network, and token holders can vote on many matters, such as changing the CORN protocol and operational terms, adjusting the interest fees charged to borrowers, etc. Based on these characteristics, CORN tokens have a definite value on some trading platforms and can be sold on the secondary market. To find a suitable price, you can build a discounted cash flow (DCF) model that predicts the total value locked (TVL) and estimates how much fee income the CORN protocol can generate. Adding a discount factor, you can roughly obtain the "fair price" of CORN tokens. Here we can also see why TVL is an important indicator for assessing DeFi projects, as a larger TVL means a larger future fee pool and a higher trading price for the tokens.
Due to the market's optimistic view of the disruption brought by DeFi projects, many DeFi project tokens are trading at very high "non-zero nominal values." Therefore, even if the interest rates themselves may not attract lenders, the potential to earn native or governance tokens from DeFi protocols, which may appreciate exponentially, can entice people to participate in staking.
The main purpose of staking is to accumulate governance tokens from DeFi platforms, which can then appreciate through yield farming. If you compare annual percentage yield (APY) metrics, you will find that the return on investment for crypto assets can make the "free market yield" of centralized traditional finance look pale in comparison. All of this sounds magical, but it is important to note that staking on DeFi protocols also carries significant risks.
Understanding these risks associated with DeFi protocols is crucial, as these risks are largely related to the code security of the DeFi platform. Several risk scenarios could lead to the loss of part or all of your staked funds.
Although the vast majority of DeFi protocol codes are open source, I believe very few people have seriously reviewed these codes, and even fewer possess the knowledge and ability to identify malicious or poor code (even I do not have this ability), as many people do not understand programming code. Even if you want to conduct extensive code reviews, you must consider that this work often consumes a lot of time, while the growth rate of DeFi TVL and token prices is astonishingly fast. Perhaps by the time you complete the audit, you have already missed the best entry opportunity. While you are studying line by line of code on GitHub, the yields are declining. Why is timing so important for DeFi projects? This is mainly because the total amount of tokens allocated by DeFi projects is usually fixed. As the number of lenders and TVL increases, the number of tokens each lender receives will decrease, leading to a reduction in APY. Therefore, it is common for early adopters of DeFi protocols to participate in contracts without conducting any technical due diligence, and it can also be very profitable.
More reputable projects will hire auditing firms to conduct security audits of their smart contracts. In the crypto industry, well-known auditing firms include Quantstamp, Hacken, and Trail of Bits. However, the DeFi market has enormous interests, and the number of qualified auditors is limited, which means that if you cannot establish contact with the heads of these companies, it is almost impossible to obtain audits from reputable firms.
Next, I will introduce several common methods that can lead to the loss of principal:
Backdoor Hacks
Protocol developers write backdoor programs themselves, allowing the protocol contract to drain all staked assets. This method is commonly referred to as an "exit scam," making it very difficult for users to recover their staked assets.
Locked Contracts
Protocol developers encode the contract in "some way" to lock the contract for a series of specific operations, preventing users from accessing all assets within the protocol. Many well-known DeFi projects have attempted this method.
Economic Manipulation
The code written by the protocol can be manipulated, which may be intentional or unintentional, ultimately leading to the economic activities of the protocol failing to meet expectations, thereby depleting assets within the contract. A common vulnerability in lending platforms is the flash loan attack. There is a great article on Hacking, Distributed that details various ways to use flash loans for arbitraging DeFi protocols.
Backdoor hacks and locked contracts typically result in users losing all staked capital, while economic manipulation usually leads to a significant loss of staked capital.
Specific protocols may be hacked, resulting in partial or total loss of funds. As a yield farmer, you must model this risk. Given that users cannot directly purchase tokens on the primary or secondary markets at the outset, the only way to acquire assets is through staking, which also puts your funds at risk. It is particularly important to note that when yield farming, you may encounter the risk of hacking.
Another risk is that since your income is denominated in governance tokens, the price of the tokens at the time you decide to sell ultimately determines your return on investment. If the platform encounters an unexpected negative event, the token price will plummet, leading to a total loss of your investment.
Of course, there are two reasonable strategies that can help you effectively manage yield farming risks and protect your returns.
Choose Multiple DeFi Projects for Farming
If you want to be a "good farmer," you should try to farm multiple crops, and the same applies when yield farming in DeFi projects. You need to diversify your funds across several different projects to reduce the potential risks of each project—this strategy is predicated on your desire to quickly enter popular new projects while lacking the ability to discern which projects may experience negative events. You need to farm multiple DeFi tokens and continuously liquidate tokens to realize profits. Your advantage lies in trading speed, token breadth, and high-risk tolerance.
So how should you allocate funds in practice? For example, suppose you decide to invest in 10 DeFi projects and believe that one particular DeFi project has a 30% chance of experiencing a negative event that causes its token price to crash within a month. This means you would lose 30% of your funds within that month. Therefore, the average mixed monthly return of the ten projects you invest in should be at least 30% to break even based on expected value. Of course, this is just a hypothetical example, and the specific numbers will depend on the actual situation. I believe someone reading this article will explore this further, and real data may be disclosed later.
Another thing to note is that if you choose a DeFi project for yield farming with a very high token price but cannot quickly attract enough TVL in the short term, it is advisable to look for a better yield farming opportunity elsewhere. Generally speaking, DeFi projects with larger and continuously growing TVL tend to have longer lifespans and are less likely to be affected by negative events. In other words, even if negative events occur, the likelihood of them severely impacting the DeFi project is lower. However, I am only providing a useful heuristic idea here, and it is important to note that just because past market volatility has been low does not mean the future will be equally calm.
Technical Due Diligence
If you possess the rare ability to quickly read and analyze DeFi code, you will undoubtedly gain a significant advantage, as you can confidently place your funds in the "safest" DeFi protocols, leading to substantial returns. The stronger your technical skills, the more confidence you will have in selecting projects for yield farming. Besides yield farming, you can also double your returns by purchasing tokens on the secondary market.
However, conducting due diligence on DeFi projects is no small task, as there are currently not many security auditors (and their capabilities are limited), while the number of DeFi projects is substantial, making it difficult to conduct thorough analysis on all projects. However, as more DeFi projects with billions of dollars in TVL emerge, I believe investors will be willing to spend more time, effort, and resources to "dig" into the motives of malicious participants before choosing projects to invest in.
Generally speaking, the farmers who understand the technology best are the ones most likely to achieve high returns.
Choose yield farming? Or choose to buy on the secondary market?
This could be a crucial decision, depending on several factors. To obtain relevant governance tokens, you can take some risks by staking crypto collateral to participate in DeFi projects, or you can buy tokens on the secondary market.
If a project's quality is decent, they typically will not issue too many tokens on the secondary market, as this practice excludes many who hope to participate in yield farming, which is not good for the project itself. On one hand, it puts the capital of stakers at risk, and on the other hand, it leads to a limited supply of tokens in the secondary market, which can only be traded back and forth among a few hands, ultimately creating a reflexive feedback loop that drives the token price higher.
If you want to get in early, then you must learn to yield farm. In this regard, the two main risk points to be aware of are:
- The principal you stake certainly carries some risk, and if losses occur, you may lose everything;
- The distributed tokens carry Delta price risk, and platform credit event risk is one of the factors. If the project is hacked, the token price will drop along with the TVL. If you do not sell the tokens in time, your return rate will continue to decline with various negative events.
For example, suppose we have a yield farming farm, let's call this farm Lilipad, which has 100,000 DAI and can produce LILI tokens through yield farming. As soon as the Lilipad contract goes live, you enter the market—note: to achieve the best results, you may need a bot to scan the Ethereum blockchain and monitor new contract deployments, especially to track TVL information, as DeFi projects typically reward based on the percentage of TVL. If your percentage of TVL is large, you may receive more incentive tokens; if your percentage is small, you may receive fewer incentive tokens.
Lilipad's TVL expands from 1 million DAI to 100 million DAI within a week (a 100-fold increase), meaning your percentage of TVL drops from 10% to 0.10%, but the number of tokens released by the project daily remains unchanged at 10,000.
If the price of LILI/DAI increases 100-fold along with the TVL, that is certainly the result everyone hopes for. However, it is important to note that even if the project becomes increasingly successful, your risk situation and APY have not changed.
If the price of LILI does not increase by 100 times, it means you will bear more risk for less return. However, for an evil "locust," the larger the farm's TVL, the more food it can consume. Thus, your risk of losing principal will increase as the TVL grows. So, is the risk you face 100 times higher than the TVL? Probably not, but the risk certainly increases in a non-linear fashion.
When you engage in yield farming, your funds themselves do not appreciate; the real value change occurs with the DeFi tokens being farmed. From this perspective, if you can directly purchase tokens, yield farming does not seem to be the optimal choice. If your risk tolerance is 100,000 DAI, it is better to buy LILI tokens worth 100,000 DAI.
As you can see, continuously liquidating LILI tokens does not align with the interests of farmers, as the risk of loss for farmers increases with the growth of TVL, while their risk capital remains unchanged. This means they need to increase their exposure to LILI tokens to "cover" the continuously increasing risks. Therefore, at this point, farmers are more willing to limit the supply of LILI tokens in the secondary market, which can drive the price curve upward—this is what I refer to as a positive reflexive loop.
As TVL increases, token prices will rise, but this also means that the potential risk of loss will increase. Therefore, if you hold tokens and are yield farming, the best choice is not to sell the tokens.
However, if there is no liquidity in the secondary market, it is also detrimental to DeFi projects. Rapidly rising token prices can attract more attention to DeFi projects, allowing them to gain more TVL. To provide more incentives for liquidity providers (LPs), many DeFi projects distribute tokens to those who stake tokens in liquidity pools on decentralized exchanges.
Liquidity pools consist of two types of assets. In the above example, farmers who provide DAI and LILI equally on decentralized exchanges like Uniswap, Sushiswap, and 1inch receive LILI token rewards. Therefore, as long as there are LILI tokens available for sale, those who only want to bear Delta price risk will buy LILI tokens, providing market quotes for farmers who wish to liquidate LILI token profits.
For any farmer participating in a liquidity pool, they are calculating impermanent loss. I will not delve too much into this risk in this article, but there is a great blog post that describes this issue in detail. Impermanent loss is the covariance between two assets. As the price of LILI tokens rises, liquidity pool stakers will hold fewer LILI tokens and more DAI. As the price of LILI tokens falls, liquidity pool stakers will hold more LILI tokens and less DAI. If the selling price of LILI tokens is sufficient to offset the impermanent loss, then it is a good deal for liquidity pool stakers. Because impermanent loss is a well-known risk, DeFi projects typically offer very high token rewards to liquidity providers.
If you can purchase LILI tokens worth 100,000 DAI, that would be the best choice. However, since the initial secondary market supply is zero at T0, incremental supply will lead to higher token prices, so even with minimal demand, prices will soar. A liquidity exposure of 100,000 DAI could potentially double or more the price of LILI tokens. If you believe that TVL will rapidly increase as a result, that’s great, but if the project fails, it could have fatal consequences.
To better illustrate that traders are in a more advantageous position than farmers, let’s consider a simple example:
- Capital = 100,000 DAI
- Time = 0
- LILI/DAI price = N/A
- Time = 1
- Capital = 100,000 DAI
- Tokens = 1,000 LILI
- LILI/DAI price = 1 DAI
When the market is in a downturn
Once a negative event occurs, all TVL will be cleared, and the LILI/DAI price will drop to 0.01 DAI.
For farmers------
- Capital loss = 100,000 DAI
- LILI/DAI loss = 990 DAI
- Total loss = 100,990 DAI
For traders------
- The trader purchased 100,000 LILI tokens for 100,000 DAI
- Capital loss = 0 DAI [no capital invested]
- LILI/DAI loss = 99,000 DAI
It can be seen that in adverse conditions, the trader's loss is 1,900 DAI less than that of the farmer.
When the market is in an upturn
TVL increases to 100,000,000 DAI, and the LILI/DAI token price also rises 100 times to 100 DAI.
For farmers------
- Capital gain = 0 DAI [capital does not appreciate]
- LILI/DAI gain = (100 DAI - 1 DAI) * 1,000 Tokens = 99,000 DAI
- Total gain = 99,000 DAI
For traders------
- Capital gain = 0 DAI [they did not stake anything]
- LILI/DAI gain = (100 DAI - 1 DAI) * 100,000 Tokens = 99,000,000 DAI
- Total gain = 9,900,000 DAI
Especially in cases of extreme market upturns, when both traders and farmers start with 100,000 DAI in capital, the trader's performance far exceeds that of the farmer. The main assumption in this example is that you can accumulate 100,000 LILI tokens at a reasonable price.
A Hard Day
Although some "vegetable" DeFi projects that allow yield farming and other meme tokens may seem dull, there are still complex risks involved, and the emerging internet "farmer class" must weigh and manage these risks. Since publishing the previous article "Dreams of a Peasant," my view has not changed: most DeFi projects remain unreliable, not only risking your capital but also affecting various businesses like borrowing, lending, asset exchange, and insurance. The infrastructure driven by Web 3 is the cornerstone of a more inclusive and equitable financial system—financial services supporting the digital age should be owned by those most engaged.
In this new ecosystem, the issue of centralized ownership will still exist; however, those who dare to take the greatest risks will certainly have the opportunity to reap the greatest rewards, regardless of their personal background or connections, contrasting sharply with the common ways of the past. In a traditional environment, the closer you are to centralization, the stronger your ability to share the "spoils" of the financial system. What are the consequences of this? When the financial system encounters problems, the risks are borne by society as a whole; when there are huge rent-seeking profits, the rewards are taken by a few. If you grasp the intricacies, you will find yourself in a great game; if you are still a "fool" blindly paying taxes, you probably won't understand the hidden evils.