Bribri333

Liquidity Pair Impermanent Asset Loss

Bribri333 Updated   
With limited tracking of impermanent loss for liquidity pairs across all chains, I wanted a very simple display of live dollar value loss in an asset pair. This should allow you to set alerts based on how much you are down and take action if needed. The output column is by default set to show your losses in USD. For those that need it, I also setup an option to track the output in something other than USDT, e.g., GBP or ETH, etc..
Release Notes:
Calculation Output Error Fixed. Code Cleaned up.
Release Notes:
The more I consider LPs (liquidity pools), the more I realize impermanent loss is simply an incomplete snapshot of your total dollar loss at that minute. It doesn't account for opportunity costs. Case in point: I love Asset A, but I want earnings so I buy 50% of Asset B so I can enter the LP. I'm happily earning away seeing low total dollar losses, but ignorant of my dwindling supply of Asset A. So the question that should be answered is where would my investment be had I just kept Asset A all along. There's a checkbox to display this information now.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?