YFXL ACADEMY

What Is Yield Farming in DeFi?


One of the new concepts that has emerged is yield farming. It’s a new way to earn rewards with cryptocurrency holdings using permissionless liquidity protocols. It allows anyone to earn passive income using the decentralized ecosystem of “money legos” built on Ethereum. As a result, yield farming may change how investors HODL in the future. Why keep your assets idle when you can put them to work? Yield farming is a way to make more crypto with your crypto. It involves you lending your funds to others through the magic of computer programs called smart contracts. In return for your service, you earn fees in the form of crypto. Yield farmers will use very complicated strategies. They move their cryptos around all the time between different lending marketplaces to maximize their returns. They’ll also be very secretive about the best yield farming strategies. Why? The more people know about a strategy, the less effective it may become. Yield farming, also referred to as liquidity mining, is a way to generate rewards with cryptocurrency holdings. In simple terms, it means locking up cryptocurrencies and getting rewards. In some sense, yield farming can be paralleled with staking. However, there’s a lot of complexity going on in the background. In many cases, it works with users called liquidity providers (LP) that add funds to liquidity pools.




What is Decentralized Finance (DeFi)?


The Decentralized Finance (DeFi) movement has been at the forefront of innovation in the blockchain space. What makes DeFi applications unique? They are permissionless, meaning that anyone (or anything, like a smart contract) with an Internet connection and a supported wallet can interact with them. In addition, they typically don’t require trust in any custodians or middlemen. In other words, they are trustless.




What is Total Value Locked (TVL)?


So, what’s a good way to measure the overall health of the DeFi yield farming scene? Total Value Locked (TVL). It measures how much crypto is locked in DeFi lending and other types of money marketplaces. In some sense, TVL is the aggregate liquidity in liquidity pools. It’s a useful index to measure the health of the DeFi and yield farming market as a whole. It’s also an effective metric to compare the “market share” of different DeFi protocols. A good place to track TVL is Defi Pulse. You can check which platforms have the highest amount of ETH or other cryptoassets locked in DeFi. This can give you a general idea about the current state of yield farming. Naturally, the more value is locked, the more yield farming may be going on. It’s worth noting that you can measure TVL in ETH, USD, or even BTC. Each will give you a different outlook for the state of the DeFi money markets.




How does yield farming work?


Yield farming is closely related to a model called automated market maker (AMM). It typically involves liquidity providers (LPs) and liquidity pools. Liquidity providers deposit funds into a liquidity pool. This pool powers a marketplace where users can lend, borrow, or exchange tokens. The usage of these platforms incurs fees, which are then paid out to liquidity providers according to their share of the liquidity pool. However, the implementations can be vastly different – not to mention that this is a new technology. It’s beyond doubt that we’re going to see new approaches that improve upon the current implementations. On top of fees, another incentive to add funds to a liquidity pool could be the distribution of a new token. For example, there may not be a way to buy a token on the open market, only in small amounts. On the other hand, it may be accumulated by providing liquidity to a specific pool. The rules of distribution will all depend on the unique implementation of the protocol. The bottom line is that liquidity providers get a return based on the amount of liquidity they are providing to the pool. The funds deposited are commonly stablecoins pegged to the USD – though this isn’t a general requirement. Some of the most common stablecoins used in DeFi are DAI, USDT, USDC, BUSD, and others. Some protocols will mint tokens that represent your deposited coins in the system. For example, if you deposit DAI into Compound, you’ll get cDAI, or Compound DAI. If you deposit ETH to Compound, you’ll get cETH. As you can imagine, there can be many layers of complexity to this. You could deposit your cDAI to another protocol that mints a third token to represent your cDAI that represents your DAI. And so on, and so on. These chains can become really complex and hard to follow which is why we are introducing YFXL as a user friendly way to farm yields.




How are yield farming returns calculated?


Typically, the estimated yield farming returns are calculated annualized. This estimates the returns that you could expect over the course of a year. Some commonly used metrics are Annual Percentage Rate (APR) and Annual Percentage Yield (APY). The difference between them is that APR doesn’t take into account the effect of compounding, while APY does. Compounding, in this case, means directly reinvesting profits to generate more returns. However, be aware that APR and APY may be used interchangeably. As APR and APY come from the legacy markets, DeFi may need to find its own metrics for calculating returns. Due to the fast pace of DeFi, weekly or even daily estimated returns may make more sense.




What is collateralization in DeFi?


Typically, if you’re borrowing assets, you need to put up collateral to cover your loan. This essentially acts as insurance for your loan. How is this relevant? This depends on what protocol you’re supplying your funds to, but you may need to keep a close eye on your collateralization ratio. If your collateral’s value falls below the threshold required by the protocol, your collateral may be liquidated on the open market. What can you do to avoid liquidation? You can add more collateral. To reiterate, each platform will have its own set of rules for this, i.e., their own required collateralization ratio. In addition, they commonly work with a concept called overcollateralization. This means that borrowers have to deposit more value than they want to borrow. Why? To reduce the risk of violent market crashes liquidating a large amount of collateral in the system. So, let’s say that the lending protocol you’re using requires a collateralization ratio of 200%. This means that for every 100 USD of value you put in, you can borrow 50 USD. However, it’s usually safer to add more collateral than required to reduce liquidation risk even more. With that said, many systems will use very high collateralization ratios (such as 750%) to keep the entire platform relatively safe from liquidation risk.




What Is an Automated Market Maker (AMM)?


You could think of an automated market maker (AMM) as a robot that’s always willing to quote you a price between two assets. Some use a simple formula like Uniswap, while Curve, Balancer and others use more complicated ones. Not only can you trade trustlessly using an AMM, but you can also become "the house" by providing liquidity to a liquidity pool. This allows essentially anyone to become a market maker on an exchange and earn fees for providing liquidity. AMMs have really carved out their niche in the DeFi space due to how simple and easy they are to use. Decentralizing market making this way is intrinsic to the vision of crypto. AMM is a type of decentralized exchange (DEX) protocol that relies on a mathematical formula to price assets. Instead of using an order book like a traditional exchange, assets are priced according to a pricing algorithm. This formula can vary with each protocol. For example, Uniswap uses x * y = k, where x is the amount of one token in the liquidity pool, and y is the amount of the other. In this formula, k is a fixed constant, meaning the pool’s total liquidity always has to remain the same. Other AMMs will use other formulas for the specific use cases they target. The similarity between all of them, however, is that they determine the prices algorithmically.




How does an automated market maker (AMM) work?


An AMM works similarly to an order book exchange in that there are trading pairs – for example, ETH/DAI. However, you don’t need to have a counterparty (another trader) on the other side to make a trade. Instead, you interact with a smart contract that “makes” the market for you. On a decentralized exchange, trades happen directly between user wallets. If you sell tokens for ETH, there’s someone else on the other side of the trade buying the tokens with their ETH. We can call this a peer-to-peer (P2P) transaction. In contrast, you could think of AMMs as peer-to-contract (P2C). There’s no need for counterparties in the traditional sense, as trades happen between users and contracts. Since there’s no order book, there are also no order types on an AMM. What price you get for an asset you want to buy or sell is determined by a formula instead. So there’s no need for counterparties, but someone still has to create the market, right? Correct. The liquidity in the smart contract still has to be provided by users called liquidity providers (LPs).




What is a liquidity pool?


It’s basically a smart contract that contains funds. In return for providing liquidity to the pool, liquidity providers (LPs) get a reward. That reward may come from fees generated by the underlying DeFi platform, or some other source. Some liquidity pools pay their rewards in multiple tokens. Those reward tokens then may be deposited to other liquidity pools to earn rewards there, and so on. The basic idea is that a liquidity provider deposits funds into a liquidity pool and earns rewards in return. You could think of a liquidity pool as a big pile of funds that traders can trade against. In return for providing liquidity to the protocol, LPs earn fees from the trades that happen in their pool. In the case of Uniswap, LPs deposit an equivalent value of two tokens – for example, 50% ETH and 50% USDT to the ETH/USDT pool. Hang on, so anyone can become a market maker? Indeed! It’s quite easy to add funds to a liquidity pool. The rewards are determined by the protocol. For example, Uniswap v2 charges traders 0.3% that goes directly to LPs. Other platforms or forks may charge less to attract more liquidity providers to their pool.




What is MetaMask?


If you’re interested in the Ethereum ecosystem, you need an application like MetaMask. Far more than a simple wallet, it allows you to interact with websites that integrate Ethereum. MetaMask will let you connect to decentralized applications from inside your browser (or through a mobile app). You can make trades without intermediaries and play games with fully-transparent code (so you know you aren’t being cheated). With Ethereum came the promise of a distributed Internet – the long-awaited Web 3.0. A level playing field characterized by a lack of central points of failure, true ownership of data, and decentralized applications (or DApps). Such an infrastructure is steadily coming together with an industry-wide focus on DeFi and interoperability protocols that aim to bridge the various blockchains. It’s now possible to trustlessly exchange tokens and cryptocurrencies, take out crypto-backed loans, and even use Bitcoin on Ethereum. For many Ethereum enthusiasts, MetaMask is the go-to wallet. Unlike your regular smartphone or desktop software, it comes packaged as a browser extension, allowing users to directly interact with supporting webpages.




What Is Uniswap and How Does It Work?


Uniswap is a set of computer programs that run on the Ethereum blockchain and allow for decentralized token swaps. It works with the help of unicorns (as illustrated by their logo). Traders can exchange Ethereum tokens on Uniswap without having to trust anyone with their funds. Meanwhile, anyone can lend their crypto to special reserves called liquidity pools. In exchange for providing money to these pools, they earn fees. It is a decentralized exchange protocol built on Ethereum. To be more precise, it is an automated liquidity protocol. There is no order book or any centralized party required to make trades. Uniswap allows users to trade without intermediaries, with a high degree of decentralization and censorship-resistance. Uniswap is open-source software. You can check it out yourself on the Uniswap GitHub. Ok, but how do trades happen without an order book? Well, Uniswap works with a model that involves liquidity providers creating liquidity pools. This system provides a decentralized pricing mechanism that essentially smooths out order book depth. We’ll get into how it works in more detail. For now, just note that users can seamlessly swap between ERC-20 tokens without the need for an order book. Since the Uniswap protocol is decentralized, there is no listing process. Essentially any ERC-20 token can be launched as long as there is a liquidity pool available for traders. As a result, Uniswap doesn’t charge any listing fees, either. In a sense, the Uniswap protocol acts as a kind of public good. The Uniswap protocol was created by Hayden Adams in 2018. But the underlying technology that inspired its implementation was first described by Ethereum co-founder, Vitalik Buterin.




Welcome to YFXL Academy!


We're on a mission to educate the masses on the transformative potential of Defi and yield farming technology. We know it can be a little daunting when you're new. This guide is here to gently introduce you to some of the key concepts you need to kick-start your journey into the world of blockchain yield farming.




What is chain-agnostic farming?


Yield farming is typically done using ERC-20 tokens on Ethereum blockchain, and the rewards are usually also a type of ERC-20 token. This, however, will change soon thanks to YFXL. Why? For now, much of this activity is happening in the Ethereum ecosystem. However, YFXL cross-chain bridges will allow the farming to become blockchain-agnostic (also called cross-chain) on several blockchains for the first time!