So I’ve been very interested in crypto for a number of years and one of the major innovations and trends over the last year is yield farming. I’ve been trying to figure out what it is, so this post will be a bit of explaining it to myself.
So, first: There is bitcoin. Bitcoin is like internet money, digital gold, you can send it and receive it on the internet. It is powered by a blockchain, a distributed ledger which shows how much bitcoin anyone has.
Next there is ethereum. Ethereum is more programmable. It’s like bitcoin, but you can have smart contracts. This means that instead of the main functions being just sending, receiving and holding bitcoin, you can do other things. You can program logic into ethereum. Ether is the native token of ethereum.
Next there are centralized exchanges. To get bitcoin and ethereum today most easily in the US you need to use a crypto exchange, like Coinbase. They let you buy bitcoin and ethereum for dollars. These exchanges are controlled by a central company. They control your crypto and your private keys, which is essentially the password to your crypto. This is custodial, meaning they have custody of your assets for you; not you.
Next, there are non-custodial wallets, like Metamask. Instead of a bank or a centralized exchange like Coinbase controlling your crypto, you can be responsible for your own cryptocurrency. This is part of the promise of crypto: be your own bank. This comes with upsides and downsides. You aren’t relying on others, but then you have to rely on yourself, and protect your passwords and prevent yourself from getting hacked.
So, Metamask is a non-custodial (primarily) ethereum wallet. This means it’s like your own account for your crypto, not controlled by anyone else. You are still relying on this software, but you control your assets. You have a seed phrase, or a private key, which is what gives you access and protects your account. You lose the key, you lose the coins. Someone else gets the key, someone else gets the coins. Metamask is mostly used from a web browser, as a browser extension.
Then there are ERC-20 tokens on ethereum. ERC-20 is a standard for creating tokens that live on the ethereum blockchain. Creating a token, issuing tokens, sending and transferring tokens is one of the things you can program with ethereum smart contracts. So on ethereum, you can use ether (the native token), or any other of the many other tokens that people have created.
Next, there are decentralized exchanges (DEX). Decentralized exchanges are exchanges to trade cryptocurrency that aren’t controlled by a centralized company. The first one to know about is Uniswap. Uniswap is a decentralized exchange on the ethereum blockchain for trading ERC-20 tokens. This means you generally interact with it with your wallet, like Metamask, and you can trade coins for other coins. So you start with ethereum, but then maybe you want USDC, which is a coin that represents US dollars. You can swap ether for USDC on Uniswap. You interact with Uniswap by connecting your Metamask wallet to the Uniswap app, then approving those transactions. Uniswap is considered an Automated Market Maker (AMM), because you can trade on Uniswap without an order book.
Next, there are liquidity providers. Liquidity providers are what power AMMs like Uniswap. Say I want to trade ETH (ether) for USDC. Well somehow there needs to be USDC on the exchange. The way it gets there is from a liquidity provider. A liquidity provider takes some of one token (ETH) and some of another token (USDC), and then adds that pair of tokens to a smart contract. They get back a liquidity provider token (LP token) which represents their share of the pooled tokens. For providing tokens to the exchange, i.e. for providing liquidity, the liquidity provider earns fees.
Next, comes yield farming. Now that you have a LP token what can you do with that? You can stake, or lock up, that token in another smart contract. For doing so, you will earn yield. The yield is often in the form of another token. Yield farming effectively is a distribution mechanism for tokens, but to receive the newly distributed tokens, you have to own some tokens and lock them up. This incentives the purchasing and holding of some specified token, and people are given rewards for that.
As an example, Pancake Swap is a decentralized exchange (DEX) on Binance Smart Chain (BSC). BNB is the native token of Binance Smart Chain. CAKE is the token for pancake swap. BUSD is the Binance US Dollar pegged coin. So say you have BNB and you want to trade it for BUSD on PancakeSwap. You can just trade it. You can trade it because someone is providing BNB/BUSD liquidity, by locking up those tokens and receiving BNB/BUSD LP tokens. Now, you can go farm those. If you lock those up on Pancake Swap, then you can earn CAKE. Basically this is an incentive system to buy various tokens, lock up tokens in liquidity to provide liquidity to the exchange, and also build use cases for the exchange token. This is complicated! It takes a while to get it. You can farm CAKE/BNB to earn CAKE, which means you have BNB, and you also have CAKE, then you lock up the token pair to get a CAKE/BNB LP token, then you lock that up to farm CAKE. Confusing.
The effective “APR” of the particular farm is calculated as the current annualized rewards received in the current price. These APRs usually don’t last, and aren’t truly APRs.
So this is the gist of what yield farming is. You take tokens, or pairs of tokens, and lock those up. Then you receive a token for locking up tokens. And then you take that token and lock it up to receive more tokens. If it feels like a loop that can just keep going, well it can. That is what a lot of defi is. Defi stands for decentralized finance, and yield farming and decentralized exchanges are just a couple applications within defi.