James Bachini

DeFi Passive Income | How To Generate Yield On Crypto Assets

DeFi Passive Income

This ultimate how to guide will show you how to earn a passive income on your crypto holdings. We will start by looking at different types of DeFi passive income and how it works. Then I’ll explain how liquidity providers earn transaction fees and explore market leaders including Uniswap, Pancake Swap, Pangolin and Raydium. Finally I’ll talk about the risks involved and some more advanced yield farming strategies.

  1. 4 Types of DeFi Passive Income
  2. How DeFi Passive Income Works
  3. How To Be A Liquidity Provider
  4. Uniswap vs PancakeSwap vs Pangolin vs Raydium
  5. DeFi Yield Farming Demo [Video]
  6. Automated Market Maker Risks
  7. Incentivised & Leveraged Yield Farms
  8. Yield Farming Strategies
  9. Conclusion

4 Types of DeFi Passive Income

Lending

You can lend crypto assets including Bitcoin, Ethereum and stablecoins to both centralised and decentralised lending platforms in return for yield.

Borrowers will put up cryptocurrency as collateral and borrow (usually up to 50%) on top of this. So someone will provide 1 ETH with a value of $1000 for arguments sake and can borrow $500 in stablecoins. They get to keep their exposure to ETH while raising capital without incurring capital gains tax.

As a lender you earn lending fees of between 1 and 30% APY on your holdings.

Staking

With Ethereum 2.0 around the corner staking is about to become a hot topic. Ethereum is moving from a proof of work algorithm like bitcoin uses to a proof of stake consensus mechanism.

Instead of ASIC miners doing SHA256 maths calculations, stakeholders in the platform will deposit ETH, run a node which will compute the block cycles and provide a consensus vote.

In practice for most participants this will mean depositing ETH to a platform like Binance where they will manage everything else.

Binance currently offers ETH2.0 staking but be sure to read up on the extended lock up period which could end up being very restrictive.

Liquidity Provider

DeFi trading of crypto assets usually occurs on an AMM (Automated market maker). The most famous example is Uniswap which provides decentralised markets on Ethereum.

A liquidity provider will send a smart contract a pair of tokens such as ETH and USDT. These will go into a liquidity pool and the user will be sent liquidity provider tokens in return.

When a 3rd party user trades ETH for USDT or visa versa they add one cryptocurrency to the pool and take the other paying a fee which goes to the liquidity provider.

Yield Farming

Yield farming can either be a manual or automated process of combining different DeFi protocols to generate the best yield on assets.

Often yield farming platforms such as Yearn Finance will supplement the yield by providing governance tokens in addition to the standard yield provided.

These governance tokens hold value in their own right which increases the rewards for the user.

Some yield farming strategies use leverage to amplify both risk and rewards.


How DeFi Passive Income Works

Let’s take a walk through of how generating DeFi passive income works in practice.

The first thing you will need is some cryptocurrency and a wallet.

You can purchase cryptocurrency from exchanges such as Binance and FTX. There are many coins and tokens to choose from which all carry different risk / reward parameters. We can really separate all the relevant tokens into three groups.

CryptocurrencyExamplesDescription
StablecoinsUSDT, USDC, DAI, sUSDStablecoins arguably carry the least amount of short term risk. They are pegged to a fiat currency, often the USD. In theory 1 USDT should always be exchangeable for $1 providing a stable digital asset.
Layer 1 ProtocolsETH, BNB, SOL, AVAXL1’s are the building blocks of the DeFi space. These are the blockchains that DeFi products are built on top of. For example ETH is the native token of the Ethereum network which can be used in Uniswap liquidity pools.
Application TokensUNI, YFI, RAY, CAKE, PNGAt an application level there is more risk but potentially more upside. The tokens value is derived from the success of the crypto sector, the protocol layer it is built upon and the application itself. RAY for example is the native token for Raydium, an automated market maker on Solana.

If you have no idea where to start then I’d recommend going to Binance, purchasing $20 of BNB and using that to experiment with. There’s an article and video demonstration I did showing you how to get started on Binance Smart Chain. DeFi Yield Farming Example

Generating defi passive income with Metamask

The next thing you’ll need is a digital currency wallet. I recommend the browser plug in MetaMask which is widely used and has become an industry standard. Be careful when downloading MetaMask as I’ve seen Google Search Ads for fake version scams. The official site is at: https://metamask.io

You’ll need to setup an account and safely store a seed phrase. If your computer goes bang you can restore the wallet on a new device using the seed phrase as a backup key.

Now you can withdraw tokens from the exchange account to your digital wallet. Once you have the funds in your digital wallet it’s time to start zipping them around the DeFi ecosystem.


How To Be A Liquidity Provider

To provide liquidity to an automated market maker like the ones covered below we need a pair of assets. These assets will go into a pool for traders to exchange against. For example if a liquidity pool on Uniswap contains ETH and USDT then a trader can send ETH to receive USDT in exchange. They will pay a fee for this transaction which is passed along to the liquidity provider.

So the first step to becoming a liquidty provider is to exchange half of your cryptocurrency asset for a paired asset and we can use the AMM for this. So using the Uniswap example we could send ETH from an exchange to our metamask wallet. Then we can swap 50% of our ETH for USDT.

This is quite simple to do, go to https://app.uniswap.org/#/swap and connect the MetaMask wallet using the button in the top right. Then approve the contract and make the trade.

Exchanging ETH for USDT on Uniswap

After 30 seconds or so depending on what blockchain you are using the transaction will confirm and you’ll hold 50% ETH and 50% USDT in your wallet.

A couple of pointers. You’ll need some of the native token (ETH,BNB,SOL,AVAX) in your wallet to send transactions so you might want to exchange 49% and always keep some in reserve to save having to do a second withdrawal from the exchange to pay for the transaction fee when withdrawing funds etc.

Ethereum is very expensive to use and if you are doing this for the first time or just experimenting with a small amount of funds then one of the other blockchains like Binance Smart Chain or Avalanche may be more fun.

Now let’s put these tokens to use and send them to a liquidity pool on Uniswap.

If you click pool in the top left then select ETH and USDT. Put in the maximum amount of USDT making sure you have some ETH in reserve. Then click Supply.

After a few seconds you’ll receive ETH-USDT-LP liquidity provider tokens back to the wallet address you sent the tokens from. These may or may not show up in Metamask but you can check your balance and current pool percentage at any time on Uniswap.

Every time someone trades ETH/USDT on Uniswap the liquidity providers will earn a 0.3% transaction fee which will be distributed between all providers in line with their pool percentage.

At any time you can go into the pool and withdraw your funds. This will require some ETH in your account to pay a standard transaction fee. In essence you will send back the ETH-USDT-LP tokens and will receive back your ETH and USDT.

Note that the ratio of ETH to USDT will have changed due to collecting fees and impermanent loss which will be discussed in the section on Automated Market Maker Risks.


Uniswap vs PancakeSwap vs Pangolin vs Raydium

So where’s the best place for your money? This comes down to your appetite for risk and the value of your investment.

The least risky place in my opinion is to either user Binance’s internal stablecoin liquidity pools such as BUSD/USDT or GBP/USDT (reduces forex risk as I’m based in the UK) or provide liquidity in the form of stablecoins on Uniswap.

Due to the transaction fees on Ethereum to use Uniswap the total cost of approving, sending and withdrawing funds is upwards of $100 so this is only really good for investments above $10,000 USD.

Uniswap was the first automated market maker to gain major traction and it’s code has been audited, tested and forked more than any other DeFi project. It’s established and somewhat proven all be it over a short timescale because of the emerging nature of DeFi technology.

Uniswap are currently working on v3 which will is rumoured to utilise a layer2 protocol called Optimism which will lower transaction fees and reduce congestion. This should be released in Q2 2021.

Transaction fees vary greatly across blockchains. Current transaction fees by blockchain (estimates based on when I’ve used them over the last few months, as of March 2021).

  • Ethereum: $20
  • Binace Smart Chain $1
  • Solana $0.20
  • Avalanche $0.20

The current fees on Ethereum are providing an opportunity for alternative chains to gain traction and investment.

DeFi Automated Market Makers AMMs Uniswap PancakeSwap Raydium Pangolin
DeFi Automated Market Makers AMMs Uniswap PancakeSwap Raydium Pangolin

In the last two months we’ve seen huge inflows into Binance Smart Chain.

Binance Smart Chain is ethereum virtual machine compatible meaning that smart contracts can just be cloned and a fully fledged DeFi ecosystem is already up and running. The main automated market maker on Binance Smart Chain is PancakeSwap, I’ve used it and am quite a fan.

Binance Smart Chain is considered CDeFi or centralised decentralised finance 🤗

CZ Binance

I feel that if CZ (Binance owner) moves to decentralise the network, which I believe he will, then it could become a serious contender to Ethereum’s dominance. Binance just moves so quickly whereas sometimes it feels like development on Ethereum is always a fight against the PoW miners. Having said that I still feel Ethereum is number one until something major changes.

Avalanche is a little less developed and there is nowhere nears as much investment at this stage. Avalanche is actually a framework for multiple interconnected blockchains of which the Contract chain is EVM compatible. The main automated market maker for Avalanche is called Pangolin. There’s a video below about how to do yield farming on Avalanche and Pangolin.

Smart contracts are a little bit harder to migrate across on Solana because it’s not compatible with Ethereum. I did a developer tutorial on Solana smart contracts here: Solana Tutorial

Solana is one of “Sam’s Coins” a project from Alameda Research, the creators of FTX. The Solana blockchain is developed for performance and I believe it could potentially provide a backend to more user friendly “exchange like” decentralised trading applications. The main automated market maker on Solana is Raydium.

I think the opportunity is greatest on Avalanche / Solana right now because there’s so much room for growth if they become contenders to DeFi fund allocation. Ethereum is still number one and looks like it will remain that way. For small amounts Ethereum is unviable and Binance Smart Chain is the best place to start and learn about DeFi.


DeFi Yield Farming Demo [Video]

This video looks at a simple yield farming strategy of exchanging AVAX tokens for PNG and then staking these in the AVAX-PNG liquidity pool on Pangolin. From there we add the liquidity provider tokens to the Pangolin mining pool to receive PNG rewards.

James On YouTube

Automated Market Maker Risks

The exceptional returns of DeFi protocols don’t come risk free and there’s some important factors to consider.

💸 Impermanent Loss

Despite the name impermanent loss is often quite permanent. When a trader exchanges one asset for another on a AMM they are essentially adjusting the volumes in the pool which adjusts valuations. Liquidity providers are always on the wrong side of this trade. If ETH goes up in value then arbitrage traders will move USDT into the ETH-USDT pool meaning that liquidity providers end up with a greater share of USDT and less ETH.

It’s called impermanent loss because in theory this should balance out over the long term and the fees make up for market movements as crypto assets fluctuate in valuations against each other. The effect is most prominent when providing liquidity to a pool where assets are uncorrelated such as a highly speculative asset on one side and a stablecoin on the other.

When considering where to allocate funds it can be a good idea to look at assets that are correlated in their price movements. AVAX-PNG or BNB-AUTO for example where the price moves together a lot of the time because they are both part of the same blockchain ecosystem.

📉 Market Downturns

If you are holding cryptocurrency then you need to be aware of your exposure to the market volatility. 30% APY is less attractive in a bear market where speculative assets can decline 80%+ in valuation.

There is a lot of investment in the space right now and we are in the middle of a bull run. At some point this will almost certainly end and it’s important to plan and consider how you’ll react to unfavourable market events to avoid knee jerk reactions.

📝 Smart Contract Risk

Smart contracts are permanent, once deployed they can’t be updated. Software developers are used to building things and then rolling out patches and updates on a regular basis to fix bugs. In the DeFi space it’s much harder to migrate everything across to a new contract and bugs can be exploited to cause massive loss of funds.

It’s hard or even impossible to know if a smart contract is safe or not. I can code Solidity but honestly have no idea just by looking at someone else’s code as to if it is safe or not. There’s plenty of examples where code has been peer reviewed by security consultants and has still failed.

My advice would be to measure the estimated risk by combining total value locked by the amount of time the contract has been deployed. The more money that’s locked the more of a target the contract will be to hackers. The longer it’s been deployed the more likely it is to be safe as hackers will have already looked at it.

🚓 Rug Pulls

This is a really bad situation where the developers will just exploit the code themselves and disappear with the funds that are within the contract. This can often be done via update mechanisms or functions that require administrative permissions on the contract. Alternatively a developer can just dump their founders funds all at once to remove as much liquidity as possible.

This happens more with new projects and when there’s a lot of speculation and everyone is making money fast and fails to do due diligence. Binance Smart Chain is absolutely rife with rug pulls and I’d estimate 1/10 projects that launches is a pancake swap clone that ends up getting rugged. Investors that done well on previous projects ape in and write it off as a cost of doing business.

This can be largely avoided by not investing in projects that have anonymous developers.

🧱 Leverage

Leveraged yield farms carry additional risk that it amplifies exposure to underlying assets. This increases profits when assets are appreciating providing impressive APY’s but if the market turns then there is a risk of over-collateralised loans and questionable liquidation mechanisms.

⚡ Flash Loan Attacks

A flash loan is a large loan provided with no collateral for about 15 seconds. On Ethereum you can borrow millions of USD worth of crypto assets for very little as long as you return them within the same block.

This “feature” has led to numerous protocols suffering from flash loan attacks where a hacker/trader (not sure which is more fair) will execute multiple highly complex transactions within a single block.

For example a flash loan could be taken out in ETH. This could then be swapped for a stablecoin pegged to the USD. This is then put into a liquidity price to artificially inflate the pricing. Now the stablecoin is considered to be worth $2 rather than $1 by a smart contract which isn’t smart enough to figure out what has happened. The attacker can then use this mispricing to take out a much larger loan against the collateral than would otherwise have been possible. Some of this loan is converted to ETH to pay back the original flash loan and the rest is laundered on Curve.

The liquidity pool is drained and investors lose funds ☹


Incentivised & Leveraged Yield Farms

Yearn Finance kickstarted a movement towards automated vaults for managing DeFi finances. Around the spring of 2020 Andre Cronje wanted a way to automate the workflow of moving funds around to get the best yield. He not only achieved this but did it in a decentralised manner within an Ethereum smart contract.

By pooling funds together users could save on fees of moving funds to the protocols with the highest returns. The deal was sweetened by the distribution of the YFI governance token. This was sent out via a fair launch mechanism to the users of the smart contract and held value in itself because it distributed ownership of the Yearn Finance ecosystem. Those YFI tokens, at time of writing, are now worth $34,500 USD each.

Over time developers have got more and more aggressive with their vault and governance token distribution strategies to attract investment by providing the highest APY’s.


Yield Farming Strategies

ETH v2.0 Staking

Ethereum is the second largest crypto asset by market cap behind Bitcoin. Version 2.0 will be launched this year hopefully which will include staking as the consensus mechanism moves from proof of work to proof of stake.

DeFi staking on Ethereum 2.0

The benefit of staking funds directly with Ethereum rather than a yield farm is that it removes the application risk. You are essentially isolating the risk to the Ethereum blockchain rather than the risk of the Ethereum blockchain + a yield farming contract that runs on top of it + an automated market maker or lending protocol that the yield farming protocol interacts with.

Holding Ethereum will provide exposure to the DeFi asset class as a whole as it is the primary blockchain for DeFi protocols.

It’s possible to earn a DeFi passive income before the Eth2.0 rollout with an Ethereum staking pool such as Binance’s ETH2.0 staking product. More information is available at: https://ethereum.org/en/eth2/staking/

High Risk Early Adopter Strategy

Generally the users that commit funds the earliest to yield farms and AMM’s take the most risk but also earn the highest rewards if the yield farm is successful. This isn’t really a passive income strategy because it requires a lot of work to research products and move funds around to the protocols that offer the best risk adjusted returns which changes on a weekly basis.

If you run the calculations it’s often more profitable to buy governance tokens than it is to mine them. If the protocol gets rug pulled then the capital provided for liquidity is lost any way. If you find a yield farm that you’ve tested and think it’s going to gain traction then a direct buy of the governance token may provide better risk adjusted returns.

Some protocols such as PancakeSwap have pools as well as farms where you can stake a single asset. This removes the risk of impermanent loss if the asset does take off. If the platform does get attacked or rug pulled then the governance token is going to be worthless (SushiSwap being a noteworthy exception) so it’s worth staking to get additional rewards with minimal additional risk.

So the game is to find new yield farming platforms to invest in as early as possible. Do due diligence to avoid getting scammed and try to find the next big thing before everyone else does.

Often projects are announced on blockchain explorers such as BSCscan’s Yield Farm List and Etherscan’s Yield Farm List, or in community telegram or discord channels.

There are DeFi stats websites which show TVL for projects but these are often updated later once the project has been live for some time. DeFi Pulse is particularly slow with their approvals process, I assume to avoid listing bad projects.

Github is another place to keep an eye on what might be coming soon. You can do a search by the blockchain keyword and devs will often update testnet and mainnet launch dates on the Github readme page.

https://github.com/search?q=binance+smart+chain+yield

If you have or set up a Github account you can follow developers who you want to get updates from to stay informed on what they are working on.

Slightly Lower Risk HODL

If you are HODLing crypto assets then you can earn a DeFi passive income with them. Even Bitcoin can be wrapped into a token such as wBTC or renBTC and then provided as collateral on various Ethereum based DeFi platforms.

Centralised exchanges such as Binance have started offering managed DeFi and liquidity provider products. This might be a good option if you aren’t confident moving funds around or just want a point and click option.

You can buy USD or GBP via a bank wire and then exchange it for USDT and bUSD on Binance which can then be staked in their liquidity pool which currently has a 9.5% APY.

Yields on Binance Liquidity Pools

Because both products are pegged to the USD then your risk is limited and Binance has a great track record of keeping customers funds secure and covering losses when something does go wrong.

You can check the current yields for various pools and crypto assets at the following links:


Conclusion

There’s huge opportunity right now to use DeFi to earn a passive income and speculate on high risk governance tokens. The space is growing fast and I believe it will continue to grow over the long term eventually disrupting traditional finance products and services. This seems far fetched but so was the narrative of Bitcoin disrupting gold as a hedge against inflation four years ago.

DeFi Passive Income

If you are actively trading and researching projects then there’s both high risks and high rewards available for early adopters of new platforms and protocols. For passive investors there’s the opportunity to earn a yield on their existing crypto assets or move funds in to stablecoins pegged to the USD and earn higher returns than would be available in traditional finance.



Get The Blockchain Sector Newsletter, binge the YouTube channel and connect with me on Twitter

The Blockchain Sector newsletter goes out a few times a month when there is breaking news or interesting developments to discuss. All the content I produce is free, if you’d like to help please share this content on social media.

Thank you.

James Bachini

Disclaimer: Not a financial advisor, not financial advice. The content I create is to document my journey and for educational and entertainment purposes only. It is not under any circumstances investment advice. I am not an investment or trading professional and am learning myself while still making plenty of mistakes along the way. Any code published is experimental and not production ready to be used for financial transactions. Do your own research and do not play with funds you do not want to lose.