🔢
Numerical examples

Yield farming

A popular farming protocol, Orca, is currenly showing 30% APY on the SOL/USDC pool. Alice would like to provide liquidity and earn some fees but is worried about that the high price volatility might cause impermanent loss IL and result in a net negative return. Bob is already LPing in the pool and doesn’t believe SOL/USDC will move much in the medium term. They both decide to user Vyper as a way to boost and optimize their returns.
Let’s assume they start with the following capital and with SOL/USDC at $100:
Alice takes the senior tranche and Bob takes the junior. The interest split is set at 70% i.e. in the event of a net profit, 70% of Alice’s gains will go to Bob.
As people trade against the pool, the price changes and fees accrue to LPs. For sufficiently large price movements, the impermanent loss can negate the fees and result in a net loss.
Let’s consider a three extreme scenarios.

A) No fees generated and SOL/USDC drops to $50

If Alice and Bob had farmed normally in the pool, their portfolio would be:
Instead, Vyper redistributes assets first making Alice whole. After redistribution:
Bob got more of the depreciated asset (SOL) to absorb completely Alice’s IL. Despite having LP’d in a pool where the price dropped by 50%, Alice’s has suffered no IL (while of course being down in $ term)

B) No fees generated and SOL/USDC drops to $10

Again let’s first look at the portfolios had they farmed normally:
With Vyper:
So Bob will cover the loss but if the prices changes by extreme amounts then Alice will start losing some capital too. Despite having LP’d in a pool where the price dropped by 90%, Alice’s has suffered only limited IL.
By tweaking the share of Alice vs Bob’s capital we can ensure that this is only happens in very extreme scenarios. In this example, SOL/USDC needs to either drop below $14.60 (-85%) or pump above $685 (+585%) for Alice’s capital to start getting impacted. Note that this is a lower bound because we are neglecting fees while in practice as fees accrue they mitigate IL.

C) 30% fees generated and SOL/USDC remains at $100

Again let’s first look at the portfolios had they farmed normally:
Instead, Vyper redistributes SOL and USDC by giving 70% of fees generated by Alice to Bob as compensation for the protection he provided:

Summary

Copy link
On this page
Yield farming