DeFi and Yield Farming — Everything You Need to Know
DeFi
First let’s explore how true decentralization works in the realm of DeFi. In order to be decentralized in the context of crypto and DeFi, you must possess the following characteristics;
1- Burn of Ownership Key: the creator of the project must burn the ownership key making the project ownerless (not sure if that’s a word)
2- No pre-mine, fair lunch: since the governance tokens will be used for governing the protocol, the governance tokens should be distributed fairly with zero pre mine.
3- Community Governance and Voting: Any changes to the protocol must be voted by the community
If a protocol has the characteristics above, every single aspect of the protocol is distributed across many people and countries with no single point of failure.
DeFi stands for Decentralized Finance. It has become a buzz word that a lot of people throw without knowing what exactly it means. DeFi is the movement to remove the middle man and give the financial gain opportunities back to people. While DeFi is only name of the movement, there are a suite of products that forms the ecosystem. There are DEXs (decentralized exchanges) like Uniswap, there are lending and borrowing platforms like LEND and COMP and there are automated yield farming protocols like YFI. We will dive deep into each of them and how they play a role in DeFi space. All these projects have a few things in common. One, they are decentralized meaning that there is no owner and the project is open source running as a smart contract. Two, they pass the profits a middle man would generate onto the people who supply liquidity to the projects. The protocols are not built to generate profit but only to help the space become more decentralized. So, essentially you become your own bank. Let’s start from lending and borrowing and we will build on from there.
Lending and Borrowing
Projects like LEND and COMP to name the biggest ones offer a lending and borrowing programs. Borrowers are the demand and lenders are the supply in this case. Lenders provide liquidity in the form of a cryptocurrency or a stable coin. You as a lender receive a liquidity provider (LP) token in exchange. This is the proof of your ownership in a tokenized from. Whenever you return the LP tokens, the protocol will give you back whatever you have put in plus some interest. Where does the interest come from though? When you put your funds in the protocol the protocol uses the funds to lend out to other people. The borrower pays a certain amount of interest which is passed onto you in the form of currency you have deposited. Now, you are probably asking yourself why does the borrower pay anything back since no one can enforce the obligation to pay it back. Because there is no enforcing body, the protocol over collateralize the borrower meaning that if Bob wants to borrow 100$, he needs to put in 200$ worth of crypto as a collateral and only then he can borrow a stable coin. Most protocols collateralize 1:2 ratio and the borrowers are required to keep a healthy ratio between debt and equity. So, if Bob has put down ETH as a collateral to obtain your USDT and if ETH tanks, Bob would have to supply the debt with more ETH in order to keep a healthy ratio. In the case Bob fails to do so, the protocol will liquidate the ETH collateral and pay you back the initial investment with some interest. So, now you are probably asking yourself if Bob has enough money to collateralize himself 1:2, why does he need to borrow? Because Bob believes that his ETH will appreciate in price and he doesn’t want to sell his ETH at the current price. However, he really needs some cash to get by. In this case, he can collateralize his ETH and borrow some stable coins. When he pays back the capital plus the interest, he can unlock his ETH and keep hodling. Remember these loans are instant! There is no paper work or wait time. You put down the “down payment” and acquire the stable coin without losing exposure to your holy crypto. This supply and demand dynamic creates a really interesting market which brings us to DEXs and automated market making where some of the borrowed funds go to.
DEXs and Automated Market Making
Decentralized exchanges or swap protocols are the decentralized version of centralized exchanges. Oh, that was a mouthful! DEXs are smart contracts that operate on ETH network. Just like any other exchange, there are pairs and you can trade A for B instantly without having to open accounts, do KYC and so on. How does it work? There are 2 components of this concept. One side is liquidity providers like on traditional exchanges and traders. Liquidity providers select a pool (trading pair) that they want to supply liquidity for the sake of his argument we will use ETH-USDT pair. When supply liquidity, Uniswap will give you an LP token which is a representation of your ownership percentage of the pool. Whenever you want out, you can return the LP tokens and get your pool share back and some LP fees. When you are providing liquidity, you have to provide the both sides of the pair equally. So, if you are putting in 100$ worth of ETH, you need to put 100$ USDT. Unlike the borrower above who needs to keep a healthy relationship of debt, Uniswap will automatically keep your ratio healthy by acquiring more of asset A while selling asset B which called automated market making (AMM). Let’s say ETH is 100$ and you have 1 ETH and 100 USDT which you want to use to become an LP. If ETH goes down to 50$, Uniswap will use 25 USDT to buy ETH bringing the ratio of 2 assets 1:1. As a result, now you have 150$ overall. This is called impermanent loss and it’s the most important aspect of DeFi when assessing risk. Though we will have a dedicated section for it down below. All you need to know for AMM is that regardless of which asset goes up or down, your ratio of 2 assets will always be 1:1 and that is the job of automated market maker. On the other hand, traders can trade these pairs and pay 0.3% “swap fee”. Fees are collected and distributed to the liquidity providers proportionate to their share in the liquidity pool. Once again, the middle man aka exchanges aka market makers are removed and instead all the fees are passed onto YOU. It is a win-win situation for both parties. Traders do not have to sign up to an exchange, do KYC and have to deposit their funds to an exchange (not your keys not your crypto). While, the liquidity providers enjoy the trading fees instead of having their asset sit on an exchange and do nothing.
Concept of Yield Farming
Yield Farming is the process of your putting your money to work by providing liquidity to different protocols and earning interest aka the yield on it. There many different strategies on yield farming. It can be as simple as provide liquidity to protocol A and earn some interest. Or, it can be as complicated as use X to borrow Y, lend Y for Z and deposit Z to earn A and then sell all your yields. Here is an infographic that explains the complicated process of yield farming.
However, do not let that discourage you! Because there are protocols who have automated the entire process and all you have to do is deposit funds on the platform and let the smart contract automate the entire process saving you time and gas fees. An example would be Yearn Finance (YFI). You can deposit stable coins to Yearn and let the protocol farm the pool that has the best returns. You always get exactly whatever you put in and plus some interest. There is no impermanent loss here. The current strategy on YFI is farming Curve with stable coins and selling the Curve for stable coin.
If you are a little bit savvier, then you can manually farm protocols that offer LP incentives. As an example, let’s look at FARM. Harvest.Finance is truly decentralized automated yield farming protocol (Don’t let the troll look trick you).
Harvest utilizes the same farming strategy as YFI but it also provides an incentive for providing liquidity in their pool by offering $FARM tokens. FARM is the governance token of Harvest just like YFI to Yearn. Though, YFI supply is maxed out and it can’t be farmed, Farm can currently be farmed. No pun intended. Then you can use your FARM in staking FARM pool and farm more FARM.
APY vs APR vs ROI
APY is a term that you will come across a lot in DeFi. It does differ APR and ROI vastly and to be frank, it is a little misleading. APY is the interest occurred including the compounding effect. Even though these pools are compounding your profits automatically, the effect of the compound is a lot different than what most people expect. So, keep in mind that these APY percentages are a little off and you are more likely to see lower returns than those. There is a lot of variables like over all liquidity, price of what’s being farmed, the volume of what’s being farmed and inflation rate of what’s being farmed and they all play a vital role in APY calculation. NONE OF THE APY CALCULATIONS TAKE IMPERMANENT LOSS IN CONSIDERATION!
Impermanent Loss
Impermanent loss happens to a liquidity provider when one of the assets experiences a change in the price. Because Uniswap will always keep your deposit ratio 1:1, it’s either going to sell ETH to buy more USDT, or use USDT to buy more ETH. It is very important that impermanent loss is relative to what you are measuring your worth in. If you want more USDT, then you want ETH to go up and vice versa. Let’s look at a few examples of impermanent loss in profit and loss situation. You deposit 100$ worth of ETH and 100 USDT. ETH goes to 150$. As a result, now you have 125$ worth of ETH and 125 USDT, always 1:1 ratio. On the contrast, say ETH went down to 50$, then you would have 75$ worth of ETH and 75$ USDT. It is important to note that providing liquidity to a “shit coin” pair will most likely result in impermanent loss.
Now that you have made this far, you probably want some example protocols to look at. I will list a few with their potential and risk measures.
Yearn — yearn.finance vaults are the safest way you can earn interest on your stable coin
Harvest — harvest.finance is another protocol that let’s you farm their governance token while deploying the same farming strategy as yearn
YFV, LUA — yfv.finance and luaswap.org are both protocols that let’s you deposit uniswap liquidity provider tokens and farm their governance tokens. Though, these protocols have high risk of incurring impermanent loss.
Don’t Get Rugged!
Getting rugged is a slang that’s used in DeFi space. It has come from the idea of someone pulling the rug underneath you. This happens when a large whale aka pre mined coins by developers are sold on the market and the price as well as the liquidity tanks immediately.
As a DeFi movement participant, you don’t want to get rugged. So, how do we avoid it?
Here is my checklist and reasoning of why a protocol must have the following.
· The smart contract has been audited by a REPUTABLE COMPANY. More the marrier. This will make sure that no one can steal your funds from the smart contract. So, you can minimize the smart contract risk.
· Check out their website or ask the community, if the ownership keys have been burnt and whether the project is governed by community voting. This will ensure that the developers can’t mint more tokens or change vital aspects of the protocol.
· Ask if there is any time lock on the farming strategy. All automated farming protocols use a strategy, most common ones are farming CRV or COMP or BAL. You want the protocol to have a timelock on the strategy. If the developers want to change the farming strategy to a risky project, you want to have the time to consider and chose whether you want to be part of that strategy or not.
· Check if the community is active and legit. Read their medium posts, look at their telegram, twitter. See if their medium posts are well thought and written, how often do they update the community.
· Not a requirement but good to see though its quite rare. If the team is transparent and show who they are rather than an anonymous team of developers. It just adds more liability on them and shows intention. That being said, this doesn’t make it bullet proof. Google Carlos Matos.
· If you are an LP in Uniswap, look at both contracts for the pair you are providing liquidity. Check if the pair has healthy volume to liquidity ratio. If a coin has more volume than liquidity that usually means its either new or they are about to rug everyone. Most importantly, check the contracts and the holders of the coin. If there are wallets with big percentage of the supply, rug is about to be pulled.
Final Thoughts — Is this all a scam? Is this a bubble?
I don’t believe DeFi is scam. I think there is a legit use case and demand for such protocols. People don’t want to sell their crypto but they need cash. A lot of people are holding crypto and earning nothing on them. So, there is a clear demand-based relationship between the two and DeFi is simply a bridge between them. Though, there are a lot of scam projects as well. They feed off of people’s greed by offering crazy high APY incentives to lure in liquidity providers only to dump the “governance” token on them. Therefore, if you see something that’s too good to be true, it probably is.
Visit our website: https://hftresearch.com/
Follow us on Twitter: https://twitter.com/HFTResearch
Telegram: https://t.me/HFTResearchChat
Discord: https://discord.gg/K7w2WnQ
Medium: https://medium.com/@HFTresearch
Contact: info@hftresearch.com