Skip to content
log(swap)

The cap

The floored position never fully converts to quote: R=L/pR = L/p is an asymptote, so 100% quote is not a state any finite price reaches. Adding the missing boundary is what the one remaining degree of freedom buys.

Spending the free constant

From the ODE, the admissible family is V(p)=Llog⁡p+b p+cV(p) = L\log p + b\,p + c. Setting b=−L/pmax⁡b = -L/p_{\max} gives

V(p)=L[log⁡ppmin⁡+1−ppmax⁡],R=L(1p−1pmax⁡),Q=L (x−ξ),V(p) = L\left[\log\frac{p}{p_{\min}} + 1 - \frac{p}{p_{\max}}\right], \qquad R = L\left(\frac1p - \frac1{p_{\max}}\right), \qquad Q = L\,(x - \xi),

and the invariant gains exactly one term:

(R+Lpmax⁡)eQ/L  =  Lpmin⁡\left(R + \frac{L}{p_{\max}}\right) e^{Q/L} \;=\; \frac{L}{p_{\min}}

with the floored form recovered as pmax⁡→∞p_{\max} \to \infty. Write μ=log⁡pmax⁡\mu = \log p_{\max} and call this Λ(L,ξ,μ)\Lambda(L, \xi, \mu). The position now has two reachable single-asset states: 100% base at pmin⁡p_{\min} where Q=0Q = 0, and 100% quote at pmax⁡p_{\max} where R=0R = 0. Above pmax⁡p_{\max} it is dormant, frozen at Q=L(μ−ξ)Q = L(\mu - \xi), mirroring the floor.

Why a linear term, and nothing else

Two things must survive, and the linear term is chosen because it is what preserves both.

QQ is untouched. Since R=V′R = V' and Q=V−pV′Q = V - pV', a term b pb\,p contributes bb to RR and nothing to QQ. So dQ=L dxdQ = L\,dx holds unchanged (I2), one fee accumulator still serves capped and uncapped positions in the same pool, and the entire apparatus of Fees as a path statistic carries over verbatim.

V′′V'' is untouched. b pb\,p has zero second derivative, so V′′=−L/p2V'' = -L/p^2 and p2∣V′′∣=Lp^2\lvert V''\rvert = L at every price: I3 survives, and with it LVR=12σ2L\mathrm{LVR} = \tfrac12\sigma^2 L.

Within the family of the log invariant, the linear term is the only freedom there is — which is the sense in which the cap is determined rather than chosen. Other caps exist outside that family: V=L[log⁡(p/pmin⁡)−log⁡(1−p/pmax⁡)]V = L[\log(p/p_{\min}) - \log(1 - p/p_{\max})] also drives RR to zero at a finite price. It is rejected, at the cost of constant LVR.

What breaks

pR=L(1−p/pmax⁡)pR = L(1 - p/p_{\max}), so I1 holds for uncapped positions only. Writing m=p/pmax⁡m = p/p_{\max}, the three roles LL played at once decouple:

role of LLuncappedcapped
fee coefficientLLLL ✓
LVR coefficientLLLL ✓
base-leg value pRpRLLL(1−m)L(1-m) ✗

The economics are unchanged — both sides of break-even still scale with LL, so LL remains the correct risk-and-reward unit — but the label "LL is the base exposure in dollars" needs a second number, and an interface must show pRpR separately from LL.

Composition becomes, with ℓ=x−ξ\ell = x - \xi:

Q=Lℓ,pR=L(1−m),V=L(1+ℓ−m),Q = L\ell, \qquad pR = L(1 - m), \qquad V = L(1 + \ell - m), base weight=1−m1+ℓ−m,quote weight=ℓ1+ℓ−m,return on capital=ΔF1+ℓ−m.\text{base weight} = \frac{1-m}{1+\ell-m}, \qquad \text{quote weight} = \frac{\ell}{1+\ell-m}, \qquad \text{return on capital} = \frac{\Delta F}{1+\ell-m}.

Every uncapped formula is the m→0m \to 0 limit.

Capital efficiency is the payoff

Same fees, same LVR, less capital deployed. At L=10,000L = 10{,}000, pmin⁡=1500p_{\min} = 1500, pmax⁡=6000p_{\max} = 6000:

ppℓ\ellmmpRpRVV cappedVV uncappedefficiency
1,8000.1820.3007,0008,82311,8231.34×
3,0000.6930.5005,00011,93116,9311.42×
4,5001.0990.7502,50013,48620,9861.56×
6,0001.3861.000013,86323,8631.72×

Return on capital rises by (1+ℓ)/(1+ℓ−m)(1+\ell)/(1+\ell-m), paid for by dormancy above pmax⁡p_{\max} where the position earns nothing. Unlike Uniswap v3 concentration, the fee-to-LVR ratio per unit LL is untouched — so this is pure capital efficiency rather than a change in the risk trade.

A capped position is a difference of two floored ones

Exact at every price, on both sides of the cap:

Λ(L,ξ,μ)  =  Λ(L,ξ)  −  Λ(L,μ).\Lambda(L, \xi, \mu) \;=\; \Lambda(L, \xi) \;-\; \Lambda(L, \mu).

The second position is entered dormant, its floor μ\mu above spot: a frozen constant base holding Le−μL e^{-\mu}, which is precisely the −b-b term.

Note the sign. The difference contains a short leg, and since log⁡p\log p and pp are linearly independent, no positive combination of floored positions produces a cap. The cap is a new basis direction, not a combination of existing ones — it has to be a primitive or it does not exist.

Once capped is primitive, everything else is a positive combination

The general two-parameter bundle — long L1L_1 at floor ξ\xi, short L2L_2 at μ\mu — decomposes with non-negative coefficients:

bundle(L1@ξ,  L2@μ)  =  Λ(L2,ξ,μ)  +  Λ(L1−L2,  ξ).\text{bundle}(L_1@\xi,\; L_2@\mu) \;=\; \Lambda(L_2, \xi, \mu) \;+\; \Lambda(L_1 - L_2,\; \xi).

Net base is L1/p−L2e−μL_1/p - L_2 e^{-\mu}, non-negative for all pp iff L2≤L1L_2 \le L_1 — the upper exposure must not exceed the lower one:

L1L_1L2L_2min⁡p\min_p net base
1000600+0.0001+0.0001partial cap: shed 600 of exposure at μ\mu, keep 400 above
100010000.0000000.000000the boundary — the fully capped position
10001400−0.0666-0.0666net short above μ\mu

That constraint is not imposed to make the algebra work; it is the never-short condition, and the decomposition is non-negative exactly on it. So {capped,floored}\{\text{capped}, \text{floored}\} positively spans the whole holdable family: adding one primitive removes the need for shorts everywhere, not merely at the cap.

The primitive is fully capped — the exposure shed at pmax⁡p_{\max} equals the exposure taken on at pmin⁡p_{\min}, one LL and not two. A partial cap is then a two-position portfolio, costing nothing, and in exchange the never-short rule becomes structural: a position can only emit +L+L at ξ\xi and −L-L at μ>ξ\mu > \xi, so a net short is inexpressible rather than merely rejected.

Two entries on one ladder

The decomposition is also the implementation. A capped position writes +L+L at its floor and −L-L at its cap on the same ladder of floors, so a cap is not a second kind of boundary needing a second structure — it is a floor-level entry with a minus sign. Tracing a capped position as xx rises:

regimelong legshort legnet
x<ξx < \xidormant, base Le−ξLe^{-\xi}dormant, base −Le−μ-Le^{-\mu}R=L(e−ξ−e−μ)R = L(e^{-\xi} - e^{-\mu}), frozen
ξ<x<μ\xi < x < \muactive, +L+Ldormant, base −Le−μ-Le^{-\mu}R=L(1/p−e−μ)R = L(1/p - e^{-\mu})
x>μx > \muactive, +L+Lactive, −L-Lcontributes 00 to LaL_a; R=0R = 0

Crossing a tick upward is one signed rule covering both legs:

La+=ΔL[k],D−=ΔL[k] e−k,L_a \mathrel{+}= \Delta L[k], \qquad \mathcal{D} \mathrel{-}= \Delta L[k]\, e^{-k},

where D\mathcal{D} accumulates the dormant base of legs whose tick has not been crossed, so that Rtotal=La/p+DR_{\text{total}} = L_a/p + \mathcal{D}. Downward crossings reverse both.

Non-negativity is cumulative, never per-tick. An individual ΔL[k]\Delta L[k] may be negative — several positions may cap at one tick and none floor there — but every position credits +L+L at ξ\xi before debiting −L-L at μ>ξ\mu > \xi, so the running sum from the bottom of the ladder is non-negative at every level and La≥0L_a \ge 0 always. The one residual duty is an uncapped backstop: above every cap the sum must still be positive. See State and the ladder.