Divergence loss in Orca Whirlpools

QuangleWangle
2 min readAug 4, 2022

--

Orca, the dominant DEX on Solana, is a fascinating venture, providing simultaneously the most user-friendly of interfaces as well as all the degen worthy mathematical complexities of concentrated liquidity pools.

Most liquidity providers are, or certainly ought to be, familiar with the concept of impermanent loss (referred to as divergence loss by Orca) and even if they don’t know how to calculate divergence loss themselves, there are simple calculators that do the job for them.

The problem is that these calculators are completely useless when it comes to divergence loss in Concentrated Liquidity AMM (CLAMM) pools, such as Uniswap v3 or Orca Whirlpools, and until now equivalent calculators just had not been built for CLAMMs.

A quick dive into CLAMM maths, as found in this invaluable document, reveals why the topic is rarely tackled, the formulae are an order of magnitude more complicated than for traditional constant product liquidity pools and as the average Uniswap v3 liquidity provider is a large or professional investor the demand for user level tools has been absent.

So let’s look at the maths of divergence loss in concentrated liquidity, below is an equation for divergence loss in a Whirlpool, where

DL = divergence loss
p = current price
pa = lower range
pb = upper range
pi = initial price

Note: once the price moves beyond the selected price range divergence loss has been experienced to its maximum extent. However, if a liquidity provider intends to create a new position by trading between the paired tokens and delays that trade, then an additional cost may occur.

It cannot be denied that an equation like this is daunting for many users, and it is for this reason that I have created a calculator, as part of a growing suite of DeFi calculators, to take the pain out of the process.

Please visit my Divergence Loss calculator here.

--

--