CenturionDEX

Impermanent loss

Last modified:

In the previous section, we derived the value of a CenturionDEX v3 position as a function of the current price. We now use those formulas to study impermanent loss in a systematic way.

Consider a CenturionDEX v3 position defined by a price interval [pa,pb][p_a,p_b] and liquidity parameter LL. Let p0p_0 denote the entry price, that is, the market price at the moment the position is opened. Let

x0=x(p0),y0=y(p0)x_0=x(p_0), \qquad y_0=y(p_0)

be the initial real balances of tokens XX and YY contributed by the liquidity provider. For any current price p>0p>0, let

x(p),y(p)x(p), \qquad y(p)

denote the current real balances of the position.

As before, the value of the position, expressed in units of token YY, is

V(p)=x(p)p+y(p).V(p)=x(p)\,p+y(p).

If, instead of depositing liquidity, the provider had simply held the initial token amounts x0x_0 and y0y_0, then the value of that passive portfolio at price pp would be

W(p)=x0p+y0.W(p)=x_0\,p+y_0.

We define the impermanent-loss fraction by

IL(p)=V(p)W(p)1.\operatorname{IL}(p)=\frac{V(p)}{W(p)}-1.

Thus, IL(p)\operatorname{IL}(p) measures the relative difference between the value of the LP position and the value of passively holding the original assets.

This analysis generalizes the numerical position studied earlier in the example above, where the parameters were

pa=2500,pb=4900,p0=3600,L=2100.p_a=2500,\qquad p_b=4900,\qquad p_0=3600,\qquad L=2100.

We now distinguish three cases, depending on the location of the entry price p0p_0 relative to the chosen interval.


Case 1: pap0pbp_a \le p_0 \le p_b

In this case, the position is opened inside its active interval. Therefore, the initial balances are

x0=L(1p01pb),y0=L(p0pa).x_0=L\left(\frac{1}{\sqrt{p_0}}-\frac{1}{\sqrt{p_b}}\right), \qquad y_0=L\left(\sqrt{p_0}-\sqrt{p_a}\right).
Subcase 1.1: pappbp_a \le p \le p_b

When the current price remains inside the interval, the current balances are

x(p)=L(1p1pb),y(p)=L(ppa).x(p)=L\left(\frac{1}{\sqrt{p}}-\frac{1}{\sqrt{p_b}}\right), \qquad y(p)=L\left(\sqrt{p}-\sqrt{p_a}\right).

Hence,

V(p)=L(2pppbpa),V(p)=L\left(2\sqrt{p}-\frac{p}{\sqrt{p_b}}-\sqrt{p_a}\right),

while

W(p)=L[p(1p01pb)+p0pa].W(p)=L\left[p\left(\frac{1}{\sqrt{p_0}}-\frac{1}{\sqrt{p_b}}\right)+\sqrt{p_0}-\sqrt{p_a}\right].

Therefore,

IL(p)=2pppbpap(1p01pb)+p0pa1.\operatorname{IL}(p)= \frac{ 2\sqrt{p}-\dfrac{p}{\sqrt{p_b}}-\sqrt{p_a} }{ p\left(\dfrac{1}{\sqrt{p_0}}-\dfrac{1}{\sqrt{p_b}}\right)+\sqrt{p_0}-\sqrt{p_a} } -1.

In particular, IL(p0)=0\operatorname{IL}(p_0)=0, as expected.

Subcase 1.2: ppap \le p_a

If the price falls below the range, the position is entirely held in token XX, so

x(p)=L(1pa1pb),y(p)=0.x(p)=L\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right), \qquad y(p)=0.

Thus,

V(p)=Lp(1pa1pb),V(p)=L\,p\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right),

and

IL(p)=p(1pa1pb)p(1p01pb)+p0pa1.\operatorname{IL}(p)= \frac{ p\left(\dfrac{1}{\sqrt{p_a}}-\dfrac{1}{\sqrt{p_b}}\right) }{ p\left(\dfrac{1}{\sqrt{p_0}}-\dfrac{1}{\sqrt{p_b}}\right)+\sqrt{p_0}-\sqrt{p_a} } -1.
Subcase 1.3: ppbp \ge p_b

If the price rises above the range, the position is entirely held in token YY, so

x(p)=0,y(p)=L(pbpa).x(p)=0, \qquad y(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right).

Hence,

V(p)=L(pbpa),V(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right),

and

IL(p)=pbpap(1p01pb)+p0pa1.\operatorname{IL}(p)= \frac{ \sqrt{p_b}-\sqrt{p_a} }{ p\left(\dfrac{1}{\sqrt{p_0}}-\dfrac{1}{\sqrt{p_b}}\right)+\sqrt{p_0}-\sqrt{p_a} } -1.

Case 2: p0pap_0 \le p_a

In this case, the position is opened below the chosen interval, so the provider initially deposits only token XX. The initial balances are

x0=L(1pa1pb),y0=0.x_0=L\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right), \qquad y_0=0.
Subcase 2.1: ppap \le p_a

As long as the price remains below the interval, the position stays entirely in token XX. Therefore,

x(p)=L(1pa1pb),y(p)=0.x(p)=L\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right), \qquad y(p)=0.

So,

V(p)=Lp(1pa1pb)=W(p),V(p)=L\,p\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right)=W(p),

and hence

IL(p)=0.\operatorname{IL}(p)=0.

There is no impermanent loss in this regime because the LP position coincides with simply holding token XX.

Subcase 2.2: pappbp_a \le p \le p_b

Once the price enters the interval, the balances become

x(p)=L(1p1pb),y(p)=L(ppa).x(p)=L\left(\frac{1}{\sqrt{p}}-\frac{1}{\sqrt{p_b}}\right), \qquad y(p)=L\left(\sqrt{p}-\sqrt{p_a}\right).

Therefore,

V(p)=L(2pppbpa),V(p)=L\left(2\sqrt{p}-\frac{p}{\sqrt{p_b}}-\sqrt{p_a}\right),

while

W(p)=Lp(1pa1pb).W(p)=L\,p\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right).

Thus,

IL(p)=2pppbpap(1pa1pb)1.\operatorname{IL}(p)= \frac{ 2\sqrt{p}-\dfrac{p}{\sqrt{p_b}}-\sqrt{p_a} }{ p\left(\dfrac{1}{\sqrt{p_a}}-\dfrac{1}{\sqrt{p_b}}\right) } -1.
Subcase 2.3: ppbp \ge p_b

If the price rises above the interval, then

x(p)=0,y(p)=L(pbpa).x(p)=0, \qquad y(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right).

Hence,

V(p)=L(pbpa),V(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right),

whereas

W(p)=Lp(1pa1pb).W(p)=L\,p\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right).

After simplification, we obtain

IL(p)=papbp1.\operatorname{IL}(p)=\frac{\sqrt{p_a p_b}}{p}-1.

Case 3: p0pbp_0 \ge p_b

In this case, the position is opened above the chosen interval, so the provider initially deposits only token YY. The initial balances are

x0=0,y0=L(pbpa).x_0=0, \qquad y_0=L\left(\sqrt{p_b}-\sqrt{p_a}\right).
Subcase 3.1: ppap \le p_a

If the price falls below the interval, then the position is entirely converted into token XX, so

x(p)=L(1pa1pb),y(p)=0.x(p)=L\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right), \qquad y(p)=0.

Thus,

V(p)=Lp(1pa1pb),V(p)=L\,p\left(\frac{1}{\sqrt{p_a}}-\frac{1}{\sqrt{p_b}}\right),

while

W(p)=L(pbpa).W(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right).

Therefore,

IL(p)=ppapb1.\operatorname{IL}(p)=\frac{p}{\sqrt{p_a p_b}}-1.
Subcase 3.2: pappbp_a \le p \le p_b

Inside the interval, the balances are again

x(p)=L(1p1pb),y(p)=L(ppa).x(p)=L\left(\frac{1}{\sqrt{p}}-\frac{1}{\sqrt{p_b}}\right), \qquad y(p)=L\left(\sqrt{p}-\sqrt{p_a}\right).

Hence,

V(p)=L(2pppbpa),V(p)=L\left(2\sqrt{p}-\frac{p}{\sqrt{p_b}}-\sqrt{p_a}\right),

and since W(p)=L(pbpa)W(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right), we get

IL(p)=2pppbpapbpa1.\operatorname{IL}(p)= \frac{ 2\sqrt{p}-\dfrac{p}{\sqrt{p_b}}-\sqrt{p_a} }{ \sqrt{p_b}-\sqrt{p_a} } -1.
Subcase 3.3: ppbp \ge p_b

If the price remains above the interval, then the position is still fully in token YY, and therefore

x(p)=0,y(p)=L(pbpa).x(p)=0, \qquad y(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right).

So,

V(p)=W(p)=L(pbpa),V(p)=W(p)=L\left(\sqrt{p_b}-\sqrt{p_a}\right),

and consequently

IL(p)=0.\operatorname{IL}(p)=0.

Again, there is no impermanent loss in this regime because the position coincides with a passive holding of token YY.


A final remark is in order for Case 3, especially when token YY is a stablecoin such as USDC. In that setting, a CenturionDEX v3 position opened above the selected range initially consists only of token YY. By contrast, a CenturionDEX v2 position would require liquidity to be supplied in both tokens, so the provider would first need to swap part of the stablecoin balance into token XX. As a result, if the price of token XX later increases, the CenturionDEX v3 position in Case 3 may remain entirely in stablecoin and therefore exhibit zero impermanent loss relative to its initial deposit, while the corresponding CenturionDEX v2 position will generally move away from the original 50/50 value split and incur impermanent loss relative to simply holding the two deposited assets. For this reason, comparisons between CenturionDEX v2 and CenturionDEX v3 in this regime must be interpreted carefully.