UniswapV2’s LP'ers benefited from automatically compounding interest.
UniswapV3's LP'ers providers did not.
UniswapV3’s concentrated liquidity model defied the fungible fee model of UniswapV2, which assumed all liquidity was equal and therefore paid out fees proportionally to the liquidity provided.
To earn compound interest on fees, UniswapV3 LPs have to:
  1. 1.
    Transaction 1: claim their unclaimed fees, in terms of tokenA and tokenB
  2. 2.
    Transaction 2: swap tokenA to swap to tokenB or vice versa (and they have to figure out how much to swap too)
  3. 3.
    Transaction 3: add the right amount of tokenA and tokenB back into the position
Compounder does all three of these in one, gas-efficient, atomic transaction!
They’re presented with 3 interesting questions:
  • Is this the right time to compound fees (ie. are the gas costs low enough to justify it)?
  • What’s the right amount of A to B to swap so I can add the maximum amount of A and B back into the position?
  • Why is this process so hard?
Compounder solves all three of these issues!
Let me show you some of the calculations:
Assume A:B is in a 40:60 ratio
The position has accumulated 7A and 3B in unclaimed fees
The swap ratio is 1A:3B
0.4(7-X) = 0.6(3+3X)
2.8-0.4X = 1.8+1.8X
-2.2X = 1
X = -0.4545
The math seems simple enough but imagine doing that every single time you want to compound fees. What a nightmare! And once you’re done with the math, the position could’ve already shifted the liquidity ratio of A:B or the swap ratio.
What if I told you there was a way to do this process automatically, capital efficiently, and gas-efficiently?
Oh yeah, and it’s also custodial, decentralized, and at a low fee.
Last modified 10mo ago