Discussion about Impermanent Loss (IL) is one of the biggest topic surrounding AMM protocols and different design exist to offset or try to limit IL.
What's astonishing for me is that nobody until now is try to measure permanent loss/win, resulting if you withdraw liquidity as a liquidity provider (LP).
This info is available on-chain and can be calculated for every LP on withdraw and for every pool.
My suspicion is that the result will be devastating and show that most pools and most LP lose money.
How to use this new Metrics?
- Show LP on withdraw if they are going to be in permanent loss and if yes, how long they have to wait until enough fees are earned which possible offset the impermanent loss. (Thanks for 0xMaki for this idea)
- Allow LP provider to limit permanent loss by auto-withdraw like a stop-loss order
- Allow LP provider to maximize permanent win by auto-withdraw like a take profit order
- Show LP Permanent Loss/Win of pools pre supply
How to measure Permanent Loss/Win for one LP
-
On withdraw of liquidity
Withdraw Value: save the token ratio and total value in ETH or $ -
Look for the supply transaction
Supply Value: save the token ratio back then and the value in ETH or $ back then -
Calculate Permanent Loss/Win
Calculate Permanent Loss/Win = Supply Value - Withdraw Value -
Do some kind of normalization to make the it comparable to others LP
-
Variation would be to calculate the Supply Value with the present value to compare it to Hodl
How to measure Permanent Loss/Win for a pool
- Sum up all Permanent Loss/Win from the start of the pool
How to measure virtual Permanent Loss/Win for a pool
- Sum up all Permanent Loss/Win from the start of the pool
- Sum up all Impermanent Loss/Win from the start of the pool until now
- Add these two Sum
How to measure Permanent Loss/Win and Impermanent Loss/Win for a LP
- Look for every AMM Protocol used
- Calculate Permanent Loss/Win
- Calculate Impermanent Loss/Win
- Sum up all PL/W and IL/Win for a LP
This is a great idea! I was wondering a few questions: 1) how you would estimate the fee rate (moving average of the last 24hrs of fees)? 2) if the fees are paid out via token, how do you estimate the price of the token assuming that you receive the token at some time in the future and the token price is volatile?
I don’t know if I understand your questions right. But I take this an input.
1. I’m missing a metric for liquidity efficiency. Because if you are in a big pool with the same traffic the same stake will earn less fees than in a small pool with the same traffic.
2. I really don’t know how IL is defined exactly. Some calculate IL based on math, but then you do not add the earned fee. Others call IL what you see if you look at the pool so its with earned fees. But anyway, you can’t calculate future values and don’t have to. Or do you mean “fees are paid out via token” farming?