Risking It All for Yield: The Risks of Liquidity Providing and Impermanent Loss

Alejandra Corbella

Earlier this month, a study by Bancor revealed that over half of liquidity providers in Uniswap had negative returns. This means that from an investment perspective, it is more profitable to hold than to provide liquidity in automated market makers (AMMs). While this came as a surprise for many people in the crypto community, the degen community know the struggle very well, as they have been fighting impermanent loss since the beginning of DeFi.  

Getting Rekt by Impermanent Loss

DeFi summer was an exciting time for millennials that wanted maximize yield during a global pandemic and economic decay. As Uniswap and other decentralized exchanges gained massive support from the community, more users were encouraged to enter the world of AMMs and liquidity pools.  

AMMs are an algorithmic way of running decentralized exchanges, in which investors provide liquidity through liquidity pools and traders can buy and sell tokens based on supply and demand. The price of tokens is calculated based on the amount of the tokens available in the pool, using the contestant product AMM formula (A * B = K) which works as follows:

  1. More money locked in the pool UP = more stable price. UP = Price Impact DOWN (harder to move the price)
  1. Number of providers UP = Fees/Provider DOWN
  1. Token 0 IN price DOWN = Token 1 OUT price UP
  1. LP tokens price differences UP = impermanent lose UP

 

AMM Example:

A (# token a) * B (# token b) = K (constant that never change)

A = 50,000 a, B = 50,000 b (50:50) => K = 2,500,000,000

Swap a for b:

  1. Give a-in amount of a
  1. K / (A + a-in) = # of b should left for the constant to be preserved
  1. b-out = B - (# of b should left)

 

Example:

  1. Give 7000 a-in, A = 57,000
  1. 2,500,000,000 / 57,000 = 43,859
  1. b-out = 50,000 - 43,859 = 6,141  
  1. K = 43,859 * 57,000 = 2.5B (rounded)

What is impermanent loss and how does it happen?

Decentralized exchanges differ from centralized exchanges in the way they provide liquidity. Since DEXs do not have a person or entity in charge, users are encouraged to provide liquidity through liquidity pools, and in return they receive a percentage of trading fees. However, this does not take into consideration the fact that tokens might lose value or diverge in price based on supply and demand (as shown above). When this happens it usually creates an imbalance in liquidity, resulting in an uneven and lower reward, also called impermanent loss.  

But why is it called impermanent loss?  because AMMs work with the premise that tokens will return to their original divergence, leaving you with the profit of trading fees. However, this is not always the case, especially with highly volatile tokens in which profits turn into permanent loss.

Vulnerabilities in Liquidity Pools

Liquidity pools are built on smart contracts that perform market making, however mistakes in code can create backdoors that often lead to exploits. Liquidity pools play a crucial role in attacks, as they often become the mechanism for price manipulation that leads to flash loan attacks.  

Recently, Safemoon, a popular BEP-20 token, was found to have major vulnerabilities in their smart contract, including serious technical issues with their liquidity pools, that if exploited can leave investors without LP rewards. The SafeMoon smart contract is owned by an external account controlled by a specific person. This account is responsible for over $20M in funds, including transfer commissions given to liquidity providers. If this account is compromised, over 20M could be lost, plummeting the SafeMoon exchange rate.

Other Risks and Vulnerabilities

Slippage: Usually the result of high demand, volatility, and unstable crypto markets. This is when traders get into a trade at a different price they chose to get in, costing traders a lot of money. While slippage is common in traditional markets, it is far worse in the volatile crypto markets, especially in decentralized markets. Slippage can be a two-edged sword, because setting slippage too low can cause traders to miss profitable trades, while setting it too high might make them a victim of frontrunning also known as a “sandwich attack”.  

Changeable fees: Many of the popular decentralized exchanges run on the Ethereum network, which is known for its high gas prices. Gas prices increase with the demand of the network, meaning that as more protocols are introduced in Ethereum, gas fees will continue to rise. The gas pricing becomes an issue when trades get backed up, and in some cases “stuck” in the blockchain unless more gas is added to the transaction. Change in fees create frustration among traders and investors, while making them vulnerable to frontrunning attacks.  

Avoiding risk and smart contract vulnerabilities using Valid Insights

Many investors that lack technical knowledge might have a hard time understanding risks in DeFi. However, it is important that investors do proper research and assert risk management in highly volatile crypto markets. Using Valid Insights allows investors to get a unified score on the security, credibility, and reputation of different crypto assets. It has also been found by the Valid Network’s development and research team that assets with a higher Valid Score tend to be less volatile, which is helpful in liquidity providing where less volatile assets give higher returns than those of volatile nature.  

When using Valid Insights, investors can be assured of getting notified of suspicious activity, vulnerable smart contracts, and malicious actors in the blockchain.  

Sign up today for free to learn more.  

It’s time to Deriskify Crypto!

Uncover risks & opportunities in crypto to maximize your gains.

Valid Data’s real-time and predictive insights are used by Cryptocurrency traders and exchanges, as well as investors and hedge funds, to make better investment and trading decisions, to protect the value of their digital assets, and to capitalize on market opportunities that only Valid Network’s technology can uncover.

Try Valid Data

Other Blogs

Onboarding blockchain tech? Don’t miss these important facts

Key issues that enterprises must carefully consider and deal with when onboarding blockchain technology

Broken Authentication: The Greatest Vulnerability to Cryptographic Systems

What do blockchain, VPN, and SSH all have in common? They’re all implementations of cryptographic technology.

Integer Overflow in Ethereum

Many involved in blockchain do not have a full comprehension of the impact of software flaws and how they can enable vulnerability.

The Top Information Sources for Crypto Traders

Cryptocurrency trading is gaining traction worldwide as digital coins move from the fringes of DeFi to mainstream banking. Recently,

Subscribe to our newsletter and get the latest updates every day

Get crypto analysis, insights and updates right to your inbox! Sign up here so you don't miss a single newsletter.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.