Yield Farming in DeFi

Sync
SyncDAO
Published in
8 min readNov 10, 2021

Yield farming (technically known as liquidity mining) has been a staple form of earning crypto rewards since it was introduced to decentralized exchanges in October 2017. It had a profound effect on the DeFi sector, allowing everyday people to participate in money markets that have since grown to ~$100 billion and counting. Providing liquidity to a decentralized exchange has become a key component of the movement to ‘go bankless’ and it’s changing the finance game forever.

So how does liquidity mining work?

And how can users earn money by providing liquidity to decentralized exchanges? Let’s dive in!

What is Liquidity Mining?

The primary goal of a Decentralized Exchange (DEX) is to be liquid, that is, to have funds flowing smoothly through the exchange to facilitate efficient trading.

Liquidity is defined by how quickly an asset can be sold without negatively impacting its price. The more liquid an asset is, the more quickly it can be sold (and vice versa), and the easier it is to sell it for fair value or current market value. All else being equal, more liquid assets trade at a premium and illiquid assets trade at a discount.

DEXs depend on users to bring capital to their platform, therefore adding liquidity to the protocol. A user, known as a Liquidity Provider (LP), supplies their crypto into a liquidity pool. Traders using the DEX can then swap their tokens in and out of the pool. Each time a user trades, they pay a fee to the DEX. Since maintaining liquidity is paramount to the DEX, they incentivize LPs by rewarding them with a portion of the transaction fees, paid in cryptocurrencies.

As such, liquidity mining is the act of supplying crypto assets to a decentralized exchange to receive rewards in crypto.

What are liquidity pools?

A liquidity pool is a smart contract that locks tokens to ensure the liquidity of those tokens in a decentralized exchange.

In traditional finance (TradFi), traders place buy and sell orders in a book that is processed by an exchange. The exchange serves as a marketplace where buyers and sellers come together and agree on prices for assets based on the relative supply and demand.

However, this relies on a sufficient number of buyers and sellers to create liquidity. As a result, market makers (entities always willing to buy or sell assets) play a role to ensure that there is always someone to meet demand, thereby maintaining price fairness by supplying liquidity.

You can imagine how cumbersome and expensive this process is: images of chaotic Wall St trading floors come to mind, no different to a boisterous cattle auction, except with people in suits and fast computers to process the orders.

In DeFi, the order book model used by centralized exchanges is replaced by liquidity pools — code in the computer — that you can simply access from your phone or laptop, sans power suits and farm animals.

Liquidity pools offer continuous, automated liquidity for decentralized trading platforms and have become the industry standard for trading platforms in DeFi.

How do liquidity pools work?

Most liquidity pools consist of two tokens, representing a single trading pair.* Most DEXs require a 1:1 pool ratio, meaning that the pool must consist of an equal amount in value of both tokens for the pool to stay relatively efficient.

For example, if an LP contributes Ether (ETH) & DAI (DAI) to a pool (assuming 1 ETH is worth $1,000) they must contribute 1 ETH and 1,000 DAI. The LP would receive a pool token (known as LP tokens) representing their stake in the pool, in this case, ETHDAI.

The liquidity in the pool means that when a user wants to trade ETH for DAI, they can do so based on the assets in the pool instead of waiting for another user to match their trade.

The share of trading fees paid by users who use the pool to swap tokens is distributed automatically to all LPs, proportional to their stake size. So if the trading fees for the ETHDAI pool are 0.3% and an LP has contributed 10% of the assets in the pool, they’re entitled to 10% of 0.3% of the total fees collected from trades.

When an LP wants to withdraw their stake from a pool, they return their LP tokens to the pool where they are burned (removed from circulation) and can withdraw their stake.

* There are pools that have up to 8 different assets with variable ratios, but for this article let’s stick to the majority of pools that have 2 assets at 1:1.

Liquidity pools are the backbone of most DEXs like Uniswap, Curve Finance, Balancer, Sushi Swap, 1inch, Pancake Swap, Bake Swap, etc. — these are all DEXs that utilize LPs for the entire network.

Automated Market Makers (AMMs)

Different liquidity pools across different protocols use different algorithms, which essentially regulates trading on an exchange. These pricing algorithms determine the change in the price of each token transfer that a liquidity pool facilitates. This mechanism is known as an Automated Market Maker (AMM), which is another smart contract. Since smart contracts are decentralized, users do not have to trade the order book of an exchange and can effectively trade against the liquidity pool with other users.

So why doesn’t everybody become a liquidity provider and/or yield farmer and jump into AMMs?

Risk vs Reward

With high reward comes high risk. Aside from the inherent risk of depositing your funds into a smart contract and being exposed to bugs in the code, hackers, rug pulls, etc, the main antagonist to liquidity mining is divergence loss (also referred to as impermanent loss).

Divergence loss refers to the loss incurred when assets in a liquidity pool diverge in their price ratio, compared to the value of just HODLing the assets.

For example, with our previous ETHDAI pool;

  • Imagine you had 2 ETH worth $2,000 in total and you wanted to contribute to a liquidity pool for the passive income of the rewards.
  • So you convert 1 ETH to 1,000 DAI giving you a 1:1 ratio that you then deposit into the pool.
  • If the price of ETH was to rise where 1 ETH = $2,000… as the ETH in the pool increases in value and since the DAI is stable at its price of $1, the pool’s ratio goes off balance. To bring the pool back to a 1:1 ratio, the AMM sells ETH for DAI until the balance is achieved, which means you now have less ETH and more DAI, but in a lesser amount than you would have had if you just held ETH.

This loss is considered “impermanent” because if ETH went back down in value to $1,000 then you would still have 1 ETH and 1,000 DAI, but then you would have missed out on the 2x gain you potentially could have made by not locking it in the pool.

If you never swapped your 1 ETH for 1,000 DAI, your original 2 ETH worth $2,000 would now be worth $4,000, whereas in the liquidity pool, if ETH gains 100% your total value would be $2,500 minus the divergent loss.

Depending on the size of the fluctuation and the length of time the liquidity provider has staked their deposit, it may be possible to offset some or all of this loss with transaction fee rewards.

Other Risks

Security is a critical consideration while selecting a DEX. Here, open-source projects that have disclosed the entire programming code have an edge. This means it’s open to the public and can be independently evaluated by several auditors.

Since decentralized platforms are accessible to everyone, it allows users to create their own pools, which may be based on false information from bad actors in the ecosystem. Open-source code can be copied and modified to exploit users who are none-the-wiser, using fake websites and scam apps. Therefore, the original contract address should always be checked.

Losses in the exchange rate are another danger. Some protocols allow users to deposit money for a set length of time which means they are unable to withdraw their liquidity from the pool and are obligated to stay in it. In the interim, if the prices of the deposited assets change, the customer risks losing money.

Another risk is that the algorithm that determines the price of an asset may fail, or slippage due to large orders could occur where the price quoted varies significantly by the time the order is filled.

So what are we doing at SyncDAO?

At SyncDAO, we’ve taken all these factors into account and built what we believe to be a safe, strategic, and regenerative way to farm via our Perpetual Vaults. Our first vault (releasing in November) is based on stablecoin yields. Think of it as your starter-farm when first stepping into DeFi, or rather, the gumboots you wear on the farm whilst you navigate the landmines of sh*tcoins in the space.

It’s a defensive allocation that will provide:

  • long term gains with consistently compounding interest
  • incentivised growth, with 50% of tokens allocated to the community for product usage
  • fair governance, as the DAO structure allows for voting on optimal yield strategies
  • liquidity via Uniswap (and future DEXs and AMMs

Liquidity mining, specific to SyncDAO, will mean that you can stake in SyncDAO for cash flow while availing from the risk/reward volatility of the crypto market. It’s making safety attractive, volatility rewarding, and overall wealth generation fulfilling.

About SyncDAO

SyncDAO is a Decentralised Autonomous Organisation (DAO) founded by Rossco Paddison and Paul Holland. SyncDAO aims to bring DeFi to the mass market by incentivising referrals to its easy to use platform that offers the best of DeFi yield generating protocols via its Perpetual Vaults. SyncDAO is launching the first Perpetual Vault in November.

How Perpetual Vaults work

The process of working with the Perpetual Vaults is easy. Users mint Perpetual Vault Tokens and deposit these into the high-interest vaults. They can choose to earn interest in Stablecoins or may instead choose to be paid in a volatile currency like Ethereum, giving them the ability to continually dollar cost average into a blue-chip asset that may appreciate over time.

Through the SyncDAO affiliate smart contract layer, anyone can be rewarded for referring new users to the Perpetual Vaults. These rewards will be a percentage of the interest earned on the deposits made by their referees. This is all managed in a permissionless manner through fully audited smart contracts on the Ethereum blockchain.

If you’d like to know more about SyncDAO you can check out the website at syncdao.com

You can join the conversation on one of our channels

syncdao.com/discord
syncdao.com/telegram
syncdao.com/medium
syncdao.com/facebook
syncdao.com/twitter

Or check out more in-depth details about the project;

syncdao.com/deck
syncdao.com/litepaper
syncdao.com/tokenomics
syncdao.com/summary

You can verify the token address on https://etherscan.io/token/0xcf8829ae9384540c886a151fac3a865794cb9a01 and on the official SyncDAO website https://syncdao.com/how-to-buy-sdg-syncdao-governance-token/

--

--