Solving Impermanent Loss on Pangolin
Since Uniswap launched on November 2nd, 2018, people have been looking to solve the problem of Impermanent Loss on Decentralized Exchanges (DEX).
I’m not arrogant enough to think I’ve solved the issue, however I believe there may be a different approach to fix the issue at the root.
Before we begin we need to talk about a few key concepts that you’ll need to understand before I elaborate on my proposal
- Impermanent Loss
- Instant arbitrage
- Chain sovereignty
- Pangolin governance
Impermanent Loss
DEX’s based on Uniswap are Automatic Market Makers (AMM for short). They use the below formula to represent the liquidity pool.
x * y = k
In this formula, k represents the liquidity pool, and y and x are ETH and the ERC20 token of the pool.
Let’s take a very brief look at how IL occurs.
Please note: I took these screenshots from this excellent article
https://finematics.com/impermanent-loss-explained/
If I provide Liquidity at the above screenshot, I have $2000 locked up as a Liquidity Provider.
If we then look at the price change in ETH from $500 to $550 we can see that if we had HODLed we would have made an extra $23.41. This is the dollar value of the Impermanent Loss. If you look you’ll see it occurred after arbitrage. The arbitrager has ended up with difference of $23.41 rather than the Liquidity Provider.
Andre Cronje has attempted to solve IL with single sided exposure https://andrecronje.medium.com/sushiswap-v2-single-sided-exposure-and-impermanent-loss-mitigation-24dbe434edbb
While I think this has merit, I think it is a band aid to the wound and a better approach would be to attempt to solve the problem at the source.
In my opinion the biggest problem here isn’t Impermanent Loss, it’s that someone else is quicker to the punch in terms of arbitrage. Could we solve this problem, by allowing the DEX to perform the arbitrage on behalf of Liquidity Providers?
Instant arbitrage
Makoto_Inoue has already started solving this problem as per the below:
https://twitter.com/ConnextNetwork/status/1363933825802248194?s=20
This solution uses State Channels so the only gas fees paid are on the initial tx. It’s a very innovative approach to low cost arbitrage and I think we’re going to see a lot of these solutions coming into the market over the coming months.
Chain sovereignty
I know we’ve been talking about Impermanent Loss, so it appears strange for me to be talking about chain sovereignty. However I do believe Liquidity and the IL for Liquidity Providers will greatly influence which chains DeFi developers will build their applications. So if you’ll bear with me ;)
We are at a crossroads in the development of blockchain technology. With the emergence of institutions and governments starting to adopt blockchains, we are entering uncharted territory.
John Perry Barlow wrote “A declaration of the independence of Cyberspace”. https://www.eff.org/cyberspace-independence While not targeted at Blockchain, it still makes for fascinating reading. I’d encourage everyone to read it.
One of his comments:
Governments derive their just powers from the consent of the governed.
I believe this is now occurring on L1 solutions. We see it with Bitcoin and Ethereum maxi’s starting to become more vociferous. People are naturally tribal and will start to align with the blockchain of their choice. This will, in my opinion, start creating a new era of sovereign players.
Let’s look at a the recent emergence of BSC and the conflict it has caused. Recently someone deployed the following contract to BSC.
The Tanks of Tienamen is a declaration of war of sorts. Pitting sovereign chain against sovereign chain.
With cross chain solutions becoming more prevalent and accessible, I believe, we are on the precipice of an arm’s race. Not fought with violence but Liquidity. The chain, who controls the Liquidity will emerge the victor.
Pangolin governance
Whilst Pangolin hasn’t released governance, I would like to propose that one of the first issues up for debate is how we can ensure that Liquidity Providers are protected from Impermanent Loss by making Pangolin an arbitrager.
The way I see this working is that Pangolin should have a Treasury where funds (in the form of tokens) are set aside for development effort. These funds should then be used to fund Makoto Inoue and/or other developers to build an automated cross chain arbitrager bot.
The way it would work would be as follows:
User becomes a Liquidity Provider -> Bot constantly checks the price of the token pair in the Pangolin LP contract -> Bot checks all DEX’s on alternative chains (Eth, BSC et al) for price difference -> If a difference occurs, create the arbitrage trade.
This is obviously highly simplified, but on the surface this looks technically possible and will also then ensure liquidity remains on the Avalanche blockchain.
A few questions to consider:
- How do we fund the arbitrage trades
- How do we protect Pangolin from Vampire Attacks
I’m sure there’s many others, but hopefully if the community thinks this is a good approach, then it will be up to us as a community to start discussing and throwing ideas around.
Take care