Concentrated curve

The curve is a constant-product tail plus up to two nested bands of extra depth around a sticky centre, walked segment by segment, so a swap never needs an iterative solve.

Updated Nov 11, 2026

Every swap executes on the market's ordinary liquidity tranche: the executable reserves with hLP ownership removed. That tranche is shaped as a constant-product tail plus up to two nested bands of extra depth around a sticky centre.

The reserve path

Write z=pz = \sqrt{p} for the square root of the marginal quote-per-base price. The curve is a full-range tail of liquidity L0>0L_0 > 0 plus ranges jj with liquidity LjL_j and square-root bounds aj<bja_j < b_j. With zˉj\bar z_j the price clipped into range jj:

U(z)=L0z+∑jLj(1zˉj−1bj)V(z)=L0z+∑jLj(zˉj−aj)\begin{aligned} U(z) &= \frac{L_0}{z} + \sum_j L_j\left(\frac{1}{\bar z_j} - \frac{1}{b_j}\right) \\ V(z) &= L_0 z + \sum_j L_j(\bar z_j - a_j) \end{aligned}

The inner range is the core and the wider one the shoulder. In the core both ranges are active, in the shoulder only the wider one, and outside both the tail alone. Within any one region the active liquidity LAL_A is constant, so a base input ΔU\Delta U moves the price by

z′=(1z+ΔULA)−1,ΔV=LA (z−z′)z' = \left(\frac{1}{z} + \frac{\Delta U}{L_A}\right)^{-1}, \qquad \Delta V = L_A\,(z - z')

and a quote input is the mirror image, z′=z+ΔV/LAz' = z + \Delta V / L_A. Inside region rr the reserves obey a shifted constant product,

(U−αr)(V−βr)=LA2(U - \alpha_r)(V - \beta_r) = L_A^2

where αr\alpha_r and βr\beta_r collect the active ranges' finite-range offsets and the inventory of the ranges that are inactive there. The program precomputes both constants for every region, five with a shoulder and three without, and prices every segment as a constant-product trade on the shifted reserves. A swap that reaches a boundary continues in the next region, so a quote walks at most five segments across four boundaries, each in closed form. With amplification one and zero widths the whole curve is exactly x⋅y=kx \cdot y = k.

Depth against a constant-product curve, by distance from the centre price

Shape controls

ControlMeaningAllowed values
Peak amplification AAActive liquidity at the sticky centre, relative to a constant-product curve holding the same reserves1× for exact constant product, otherwise above 1× and at most 2,000×
Core half-width hhThe core spans c/(1+h)c/(1+h) to c (1+h)c\,(1+h) around the centre price ccAt least 1 bps when A>1A > 1, zero when A=1A = 1
Fade width ffA shoulder beyond the core on each side, out to c/(1+h+f)c/(1+h+f) and c (1+h+f)c\,(1+h+f), at half the extra depthZero disables it; h+fh + f is at most 65,535 bps

In the formulas hh and ff are fractions, so 100 bps is 0.01. The split of liquidity follows from AA and is never an input. Write wc=1+hw_c = \sqrt{1+h} and wo=1+h+fw_o = \sqrt{1+h+f}, and let ıˉ\bar\imath be the mean of 1/wc1/w_c and 1/wo1/w_o, or 1/wc1/w_c alone without a shoulder. Of the total liquidity LL active at the centre, the concentrated share is

s=1−1/Aıˉ,L0=(1−s) Ls = \frac{1 - 1/A}{\bar\imath}, \qquad L_0 = (1 - s)\,L

A constant-product curve through the same centre reserves would have liquidity L(1−sıˉ)=L/AL(1 - s\bar\imath) = L/A, which is where the amplification comes from. With a shoulder, the concentrated liquidity sLsL splits into a core layer of ⌈sL/2⌉\lceil sL/2 \rceil and a shoulder layer of the remainder, so rounding favours the core.

The tail must keep at least 0.01% of the liquidity, so ss can be at most 99.99% and a wider band caps the amplification. Without a shoulder, the widest core each amplification allows is:

Peak amplificationWidest core half-width
2×29,992 bps
4×7,774 bps
10×2,343 bps
100×201 bps
2,000×8 bps

A shoulder lowers these limits. A shape outside them fails with CurveTailShareBelowMinimum at initialize_market, or when an operator announces it. A concentrated curve also needs a base fee of at least 1 bps (ConcentratedSwapFeeBelowMinimum).

In a concentrated region the marginal price differs from the inventory ratio V/UV/U, and the app shows the marginal price.

A swap across two boundaries

Take a centre price of 100 with A=4A = 4, h=100h = 100 bps and f=400f = 400 bps, and 10,000 base against 1,000,000 quote sitting at the centre. The concentrated share is 76.1%, so L=400,000L = 400{,}000 splits into a tail of 95,576 and core and shoulder layers of 152,212 each. The core runs from 99.01 to 101, and the shoulder out to 95.24 and 105.

Selling 1,000 base from the centre walks three segments:

SegmentActive liquidityBase inQuote outPrice after
Core400,000199.5019,851.2499.01
Shoulder247,788488.3347,419.5195.24
Tail95,576312.1728,811.9889.45

The seller receives 96,082.73 quote, an average of 96.08. A constant-product market with the same reserves pays 90,909.09, an average of 90.91, and ends at 82.64. Inside the core the curve is four times as deep: taking the price down to the core's edge at 99.01 costs 199.50 base here and 49.88 on the constant-product curve. These are real-number values, and the program floors each segment's output in fixed point.

The sticky centre

The sticky centre cc is stored state. It follows its own moving average mm, which folds in the last traded price at most once per slot at the centre half-life (Double EMA has the fold). Before a swap-like operation is quoted, a centre controller may apply one move toward mm. With κ\kappa the market's adjustment step and g=∣m−c∣/cg = |m - c|/c the gap,

σ=max⁡(κ, g/5),c′=c+(m−c) σg\sigma = \max(\kappa,\ g/5), \qquad c' = c + (m - c)\,\frac{\sigma}{g}

and the move happens only when g>κg > \kappa. Each move shifts the centre by the fraction σ\sigma of its value, the larger of the step and a fifth of the gap, and a gap within κ\kappa is a dead band. At most one move lands per slot. The operation's own price reaches mm only in a later slot, so a trade can lead to a later move but never recentres the curve it is about to trade on.

With κ=0.5%\kappa = 0.5\%, c=100c = 100 and mm held at 103, successive slots move the centre to 100.60, 101.10, 101.61, 102.12 and 102.63, then stop with a 0.36% gap left inside the dead band. With mm at 150 the first move would cover a fifth of the 50% gap, to 110.

A move has to be paid for: the program rebuilds the curve through the current reserves at c′c', first adding the protected bucket ZZ of retained surcharge if it holds anything (see Dynamic fees), and commits the move only if curve depth per srLP share does not fall. A move that costs depth can otherwise pass only against the market's protected profit buffer, which must cover 125% of the depth lost plus 0.01% of depth, never more than 1% of depth. An unfunded move is stored as a target and retried by later operations from a later slot. The target is dropped once mm comes back within κ\kappa of the centre or no longer sits at or beyond it, and a fee, shape or controller change or a new oracle price drops it too.

The adjustment step is between 0.0001% and 10%, and a concentrated market needs it above zero. The operator or manager changes it through the centre controller family after the full notice. Setting a market back to exact constant product releases ZZ to its LPs. preview_market returns the centre, its average, the bucket and the retention state.

Ramps

An operator's concentration change starts a ramp after the full notice. The bundle names a duration of at least 432,000 slots, one nominal day, and each of AA, hh and ff can move at most tenfold either way when its start and target are both nonzero; a bundle outside these limits fails with OperatorPolicyExceeded. Moves into or out of zero width have no ratio limit but still ramp, which is how concentrated bands are switched on or off. At slot tt of a ramp from θ0\theta_0 at t0t_0 to θ1\theta_1 at t1t_1, each control is

θ(t)=θ0+(θ1−θ0) t−t0t1−t0\theta(t) = \theta_0 + (\theta_1 - \theta_0)\,\frac{t - t_0}{t_1 - t_0}

rounded toward its starting value, with the core half-width kept at 1 bps or more until amplification reaches exactly 1×.

Swaps attempt at most one step per slot. A step rebuilds the curve through the unchanged reserves at the candidate shape and is kept only if that shape leaves the tail at least 0.01% of the liquidity, the marginal price moves by at most one unit of 10−910^{-9}, funded reserve value does not fall, market health holds and both sides' utilization is below 80%. The price test runs against the current price and against the price the starting shape gives at the current reserves, so rounding cannot build up across steps. A failed step is skipped without failing the swap and tried again in a later slot; see Lifecycles.

Rounding and empty states

Curve math runs on amounts counted in the larger of twelve decimals and the two tokens' decimals, with prices in nine-decimal fixed point. Rounding leaves dust with the market: segment outputs and the final token amount are floored, the input an exact-output quote requires is rounded up, and the liquidity root that rebuilds the curve through a new reserve point after a deposit, withdrawal, compounded fee or loss is floored. That rebuild solves one quadratic, because every boundary coordinate scales with LL.

In swap, a zero input fails with AmountZero, a trade too small to pay out one unit with InsufficientOutputAmount, a trade that would empty a side with InsufficientLiquidity, and an output below the caller's minimum, after any output transfer fee, with SlippageExceeded.

Until the first two-sided deposit the centre is the reserve ratio. That deposit sets the centre, the curve and the price history at its own price, and adds 1,000 srLP atoms to the supply that nobody holds. If the supply falls back to those 1,000 atoms with no debt and no active hLP, the curve state and price history reset, and the next deposit starts them again.