Today, the vast majority of collateral held in DeFi lending protocols is in the form of vanilla tokens like ETH, stETH, wBTC and UNI. There aren’t many protocols that lend against LP tokens in addition to simpler collateral types. As a result, the risk management challenges of taking LP tokens as collateral are less well understood.
Valuing LP tokens creates some unique challenges for lending protocols. This blog post will describe how Notional values LP tokens, what risks this creates, and how we mitigate those risks to do it safely.
Valuing LP tokens safely is important because it allows protocols to lend against productive collateral without exposing their lenders to increased economic risk. Taking LP tokens as collateral in leveraged vaults allows Notional to directly contribute to greater liquidity in the DeFi ecosystem and offer leveraged yield opportunities to users.
What is an LP token?
An LP token represents a deposit into a liquidity pool. LP tokens are always redeemable for a proportional amount of the assets in an LP pool. If you own 10% of the LP token supply in a liquidity pool that holds ETH and USDC, you can redeem your LP tokens for 10% of the ETH and 10% of the USDC in that pool at any time.
This makes LP token valuation pretty simple at first glance - as long as we know what the assets in the LP pool are worth, we know what the LP token is worth. LP token valuation is a three-step process.
- Get the proportion of total pool LP tokens held by the vault.
- Get the total amount of each underlying asset in the pool that the vault has a claim on based on how many LP tokens it holds.
- Use a price oracle to convert the underlying asset values into the valuation currency (eg USDC).
This valuation method involves two main risks - oracle risk, and liquidity pool manipulation risk. Readers will probably be familiar with oracle risk. If the price oracle tells us that the ETH/USDC price is 1,000,000,000 USD we’re going to end up with a massively incorrect value for the LP tokens.
But readers might be less familiar with liquidity pool manipulation risk. This risk refers to a malicious user manipulating the balances of the liquidity pool so that Notional gets the wrong value for the LP tokens even though we’re using the correct oracle price.
How does liquidity pool manipulation risk work?
To manipulate a liquidity pool, a malicious user can use a flash loan to put a large trade through the liquidity pool in order to skew the balance of the assets in the pool. With a large enough trade, malicious users can significantly manipulate the value of LP tokens even though the price oracle itself is not manipulated.
For example, let’s say the ETH/USDC oracle price is 2,000 USDC and we’re trying to value ETH/USDC Uni V2 LP tokens in USDC denomination. There are 100 ETH and 200,000 USDC in the pool and our leveraged vault holds 10% of the pool’s LP tokens. With this market data, the vault’s LP tokens are worth 40,000 USDC. (10 ETH X 2,000 USDC + 20,000 USDC).
Now assume that a malicious user borrowed 1,800,000 USDC via flash loan and used that USDC to buy ETH from the liquidity pool. The liquidity pool now holds 10 ETH and 2,000,000 USDC. With these balances, the vault’s LP tokens are worth 202,000 USDC, more than 5x their previous value! (1 ETH * 2,000 USDC + 200,000 USDC).
By putting such a large trade through the liquidity pool, the malicious user changed the amount of each asset that the LP tokens have a claim on and exposed Notional to risk of exploit. With an inflated value for LP tokens, the malicious user could take on much more debt than he should be able to. When the liquidity pool is traded back down to the fair market price, the LP token value would collapse and Notional would be stuck with a large loss.
The root cause of this problem is that the price implied by the liquidity pool is wildly inconsistent with the oracle price. The liquidity pool is reporting an ETH value of 200,000 USDC. This is 100X greater than the oracle price! By using a flash loan, the malicious user has manipulated the price on the liquidity pool without allowing arbitragers to drive the price back to the fair market price.
Mitigating LP token valuation risks
Fortunately, these risks can be mitigated. Some amount of oracle risk is unavoidable but we can minimize it by restricting our use of oracles to Chainlink. Notional does not list assets as collateral that don’t have Chainlink oracles. Notional also does not list LP tokens that represent underlying assets that don’t have Chainlink oracles. This strict requirement helps minimize Notional’s oracle risk to the greatest extent possible.
We can mitigate liquidity pool manipulation risk by checking that the price implied by the liquidity pool is consistent with the oracle price. If it is not, then the pool might be manipulated and Notional will revert any risky transactions. If the liquidity pool price is consistent with the oracle price then we know that the liquidity pool is not manipulated and we can go ahead with the valuation.
LP token collateral provides great benefits for users, protocols, and DeFi as a whole. Borrowers who want to leverage LP token collateral achieve greater capital efficiency and returns. Lenders who lend to these borrowers get higher rates. And DeFi projects achieve greater liquidity for their tokens and lower transaction costs for all their users.
Valuing LP tokens safely is complex, but it can be done without incurring additional economic risk. The risk mitigation strategies outlined in this post allow Notional to lend against LP tokens and help provide value to DeFi users without imposing increased risk on the protocol’s lenders. This helps further our goal of creating a more efficient financial system.
Notional Finance Newsletter
Join the newsletter to receive the latest updates in your inbox.