Liquidity position
Last modified:
Consider a CenturionDEX v3 liquidity pool with tokens and . Throughout this section, the price will always mean the price of token expressed in units of token . Suppose that a liquidity provider chooses to supply liquidity over the price interval . We adopt the convention that the position is active on the closed interval . The defining feature of CenturionDEX v3 is that the position is active only within that interval: its liquidity is used to facilitate trades only while the market price remains between and . If the price moves outside the chosen range, the position becomes inactive and its balances remain unchanged until the price re-enters the interval . Moreover, if the price falls below , the position is entirely converted into token ; if the price rises above , it is entirely converted into token . In other words, once the price exits the range, the position ends up holding only the token associated with that side of the interval.
Although the CenturionDEX v3 AMM still relies on a constant-product structure, the geometry must be modified so that one of the token balances can become zero exactly when the price reaches one of the interval boundaries. To achieve this, we apply the translation illustrated in the animation below to the virtual constant-product curve
where denote virtual reserves; we will distinguish these from real balances below.
Recall that, for a state on this virtual curve, the price is given by
which is precisely the slope of the line joining the origin to . Consequently, in the animation above, the state corresponds to the lower boundary price , while the state corresponds to the upper boundary price , and therefore .
To determine the translation that converts the virtual constant-product curve into the actual balance curve of a CenturionDEX v3 position, we begin by evaluating the virtual boundary states associated with the chosen price interval . Let
denote the virtual states corresponding to the lower and upper boundary prices and , respectively. Since these states lie on the virtual curve
and satisfy
we obtain
and
Therefore,
At the lower boundary , the actual balance of token must be zero, so the corresponding real state must lie on the horizontal axis. This requires a downward translation by . Likewise, at the upper boundary , the actual balance of token must be zero, so the corresponding real state must lie on the vertical axis. This requires a leftward translation by . Hence, the virtual curve is translated by the vector
Applying this translation to the virtual curve , we obtain the equation of the real-balance curve:
This is the curve of real balances shown in the animation above.
Applying the same translation to the boundary virtual states yields the corresponding real boundary states
These are precisely the two endpoints of the active range on the real-balance curve.
Virtual reserves. We now introduce the virtual reserves, which are central to the concentrated-liquidity model. Let and denote the actual balances of tokens and in a position, and let and denote the corresponding virtual reserves. By definition, the virtual reserves satisfy the constant-product relation
and the spot-price relation
where is the current price of token in units of token . Thus, represents a virtual pool state lying on the virtual curve in the animation above. When the market price remains inside the interval , trades are modeled as taking place along this virtual constant-product curve, even though the actual balances of the position are given by the translated real-balance curve.
The real and virtual reserves are related by the translation derived above:
Accordingly, the real-balance equation above may be written equivalently as
or, in virtual-reserve form,
Since
it follows that
Real balances at price . We can now express the actual balances of a position as functions of the current price. If , then the position is active and the real-balance equation above applies. Substituting the virtual-reserve identities above into the translation relation, we obtain
In the boundary cases, these formulas reduce to the expected values. If , then
so the position is entirely held in token . If , then
so the position is entirely held in token .
If the price moves outside the active interval, the balances remain frozen at the nearest boundary state. Therefore, the actual balances of a CenturionDEX v3 position are given by the following piecewise formulas:
This is the natural canonical piecewise form.
Opening a position. Suppose now that a liquidity provider wants to create a CenturionDEX v3 position with chosen parameters , , and . Since trading fees in CenturionDEX v3 are accounted for separately rather than automatically reinvested into liquidity, the parameter remains fixed for a given position unless liquidity is explicitly added or removed. Consequently, once , , and are fixed, both the virtual-balance curve and the real-balance curve are fixed as well, and the state of the position always lies on the corresponding real-balance curve.
It follows that, given the current price , the liquidity provider must deposit exactly the token amounts prescribed by the piecewise formulas above. Concretely, there are three possible cases.
(i) If the current price satisfies , then the position starts entirely in token . The required deposit is
(ii) If the current price satisfies , then the position starts with both tokens. The required deposits are
(iii) If the current price satisfies , then the position starts entirely in token . The required deposit is
These three situations correspond to the three states represented in animation below.
Example
In practice, a liquidity provider will usually not choose the liquidity parameter directly. Instead, the provider selects a price interval and decides how much of one of the two tokens to contribute. Once that information is fixed, the value of can be recovered from the position formulas, and the required amount of the other token can then be computed accordingly.
Consider a CenturionDEX v3 pool between CTN and USDC, and suppose that the current price of CTN in units of USDC is
Assume that a liquidity provider wants to open a position over the interval
and that, at the current price , they want the position to contain
units of CTN.
Since , the position is opened inside its active interval, so both tokens must be deposited. From the canonical formula for the real balance of token inside the active range, we have
Evaluating at , we obtain
Hence,
Now that is known, the required amount of USDC follows from the canonical formula for the real balance of token inside the active range:
Therefore,
Thus, to open the position, the liquidity provider must deposit
Value of a Position
We now compute the value of a CenturionDEX v3 position as a function of the current price. Let and denote the real balances of tokens and held by the position when the price is . The value of the position, expressed in units of token , is
Once a position is created, the parameters , , and are fixed. Using the canonical balance formulas, we obtain the following piecewise expression for the position value.
If , then the position is entirely held in token , so
If , then the position holds both tokens, and therefore
After simplification, this becomes
Finally, if , then the position is entirely held in token , and hence
These formulas describe the value of the position throughout the entire price range and are the basis for the plot shown below.
Worked example
Consider the position constructed in the example above. Its parameters are
and it was opened at price
with deposits of CTN and USDC. Therefore, the initial value of the position is
Now suppose that the price rises to
Since , the position remains inside its active interval, so both balances must be recomputed using the in-range formulas. The CTN balance becomes
The USDC balance becomes
Hence, the value of the position at the new price is
Now compare this with the value the liquidity provider would have had if they had simply held the original assets outside the pool. In that case, the portfolio would still consist of CTN and USDC, whose value at price would be
Since
the liquidity provider is worse off than under simple holding. The difference is
which is the impermanent loss associated with this price move.
We will analyze impermanent loss in CenturionDEX v3 in more detail in the next section.