Skip to content
log(swap)

Many bases, one quote

The second extension widens the base side rather than adding a boundary. It is the other way to spend the free constant, and the two are mutually exclusive.

The construction

Take nn base assets with prices pjp_j and holdings RjR_j, one quote QQ, and the separable value

V(p1,…,pn)=∑jLjlog⁡pj+c.V(p_1,\dots,p_n) = \sum_j L_j \log p_j + c .

Self-financing gives Rj=∂V/∂pj=Lj/pjR_j = \partial V/\partial p_j = L_j/p_j, so each base leg keeps

pjRj≡Lj,p_j R_j \equiv L_j,

I1 holding per asset. That is the defining property of the single-asset design, preserved leg by leg.

One constant, hence one floor

There is exactly one free constant cc, not nn of them — so there is no per-asset floor. With xj=log⁡pjx_j = \log p_j, L=∑jLjL = \sum_j L_j and weights wj=Lj/Lw_j = L_j/L, define the composite index

xˉ  =  ∑jwjxj  =  log⁡∏jpjwj,\bar x \;=\; \sum_j w_j x_j \;=\; \log \prod_j p_j^{w_j},

the log of the LL-weighted geometric mean of the prices. Then

Q=L (xˉ−ξˉ),V=L (1+xˉ−ξˉ)Q = L\,(\bar x - \bar\xi), \qquad V = L\,(1 + \bar x - \bar\xi)

with the weighted average log-floor ξˉ=xˉ−Q/L\bar\xi = \bar x - Q/L, and the invariant becomes

(∏jRjwj) eQ/L  =  Leξˉ.\Big(\prod_j R_j^{w_j}\Big)\, e^{Q/L} \;=\; \frac{L}{e^{\bar\xi}} .

The multi-asset invariant is the log invariant on the basket index. Everything in the single-asset case carries over under x→xˉx \to \bar x, ξ→ξˉ\xi \to \bar\xi: the holdings, the drawdown ℓ=xˉ−ξˉ\ell = \bar x - \bar\xi, the composition table, the fee statistic, aggregation.

The boundary Q=0Q = 0 is the hyperplane ∑jLjxj=L ξˉ\sum_j L_j x_j = L\,\bar\xi — not a box. One member's crash spends the common buffer. The bar denotes an average over the basket; there are no independently enforced per-asset floor boundaries. For one base, xˉ=x\bar x = x and ξˉ=ξ\bar\xi = \xi.

Four properties specific to n>1n > 1

Balancer between the bases, log against the quote

At constant QQ the invariant reduces to

∏jRjLj=const,\prod_j R_j^{L_j} = \text{const},

a weighted constant-product surface — Balancer geometry. For two equal-LL assets it is plain xy=kxy = k. So the object factorises: Balancer between base assets, log geometry against the quote. Base-to-base routing is native and exact at ΔQ=0\Delta Q = 0; the quote leg is what supplies the floor, the constant LVR and the fee structure.

LVR is correlation-free

VV is separable, so the price-space Hessian is diagonal: pjpk ∂jk2V=diag(−Lj)p_j p_k\,\partial^2_{jk} V = \mathrm{diag}(-L_j), off-diagonal exactly zero. Hence

LVR=12∑jLjσj2,\mathrm{LVR} = \tfrac12 \sum_j L_j \sigma_j^2,

with no covariance terms, constant in price. Equivalently and more strongly, ∂2V/∂xj∂xk≡0\partial^2 V/\partial x_j \partial x_k \equiv 0: VV is linear in every log-price, hence linear in xˉ\bar x, and that linearity is what makes the whole apparatus transfer.

No cross-asset price impact

Differentiating ∑jwjlog⁡Rj+Q/L=log⁡k\sum_j w_j \log R_j + Q/L = \log k gives dQ=−Lj dRj/RjdQ = -L_j\,dR_j/R_j, so

pj=−∂Q∂Rj=LjRj.p_j = -\frac{\partial Q}{\partial R_j} = \frac{L_j}{R_j}.

QQ does not appear. The marginal price of asset jj reads only asset jj's own reserve, so a trade in one asset does not move any other asset's price. This is the diagonal Hessian seen from the other side — correlation-free LVR and zero cross-impact are one statement.

It is the sharpest contrast with a shared-reserve pool: Balancer's pB=(Rq/wq)/(RB/wB)p_B = (R_q/w_q)/(R_B/w_B) contains the quote reserve, so every trade in any asset repositions every other price.

Two things do couple, and neither is price. Depth changes at a class crossing — pjp_j stays continuous but the book thins. And the floor is shared: selling AA drags xˉ\bar x down and burns the buffer that also protects BB.

Prices are independent. Solvency is not.

The price paid for the decoupling is that cross-pair liquidity is the series combination 1/Leff=1/Lj+1/Lk1/L_{\text{eff}} = 1/L_j + 1/L_k.

The basket auto-rebalances

pjRj≡Ljp_j R_j \equiv L_j makes the holdings a constant-value-weight portfolio. A base-to-base swap changes what the basket holds without changing what it is worth: the composition churns at constant value and at constant value weights. Any leg can be pulled out by base-to-base without quote and without touching the floor.

What the basket is worth: the diversification ratio

Per unit LL and per unit time, under GBM with volatility vector σ\sigma and covariance CC:

quantityvalue
fee rateϕ2/π ∑jwjσj\phi\sqrt{2/\pi}\,\sum_j w_j\sigma_j — linear in w′σw'\sigma
LVR rate12∑jwjσj2\tfrac12\sum_j w_j\sigma_j^2
index volatility (sets the buffer)σxˉ=w′Cw\sigma_{\bar x} = \sqrt{w'Cw}

For a fixed floor-hit probability over a horizon the required buffer scales with σxˉ\sigma_{\bar x}, so income per unit of capital scales with

DR(w)  :=  w′σw′Cw  ≥  1,\mathrm{DR}(w) \;:=\; \frac{w'\sigma}{\sqrt{w'Cw}} \;\ge\; 1,

the diversification ratio — exactly the return-on-capital multiple of a basket pool over a single-asset pool. It is 11 for n=1n = 1 and for perfectly correlated members; for nn equal-weight, equal-volatility, uncorrelated assets it is n\sqrt n:

nnρ=0\rho = 0ρ=0.3\rho = 0.3ρ=1\rho = 1
11.00001.00001.0000
21.41421.24031.0000
42.00001.45101.0000
82.82841.60641.0000

Admission is about covariance, not volatility

The marginal solvency cost of weight in asset jj is ∂σxˉ2/∂wj=2(Cw)j\partial \sigma_{\bar x}^2/\partial w_j = 2(Cw)_j — its covariance with the basket, not its own variance — while its marginal fee contribution is σj\sigma_j. So admit jj when σj/(Cw)j\sigma_j/(Cw)_j is large: high own volatility, low covariance with the index. That is the maximum-diversification condition, and it inverts the naive "comparable volatility" rule.

Worked counterexample — AA and BB at 60% vol with correlation 0.9, CC at 160% vol and uncorrelated:

3-asset basket       : fee ∝ 0.9333   sigma_index = 0.6606   DR = 1.4128
drop the high-vol C  : fee ∝ 0.6000   sigma_index = 0.5848   DR = 1.0260   <- WORSE

Removing the most volatile member makes the pool strictly worse. Optimal weights maximise DR\mathrm{DR} and solve in closed form as w⋆∝C−1σw^\star \propto C^{-1}\sigma.

Swaps in a basket

Quote ↔ base jj is the single-asset case with L→LjL \to L_j: Δxj=ΔQ/Lj\Delta x_j = \Delta Q/L_j, and all four exact cases and the average-price function apply unchanged. Per-asset liquidity is LjL_j.

Base jj ↔ base kk at ΔQ=0\Delta Q = 0 satisfies LjΔxj+LkΔxk=0L_j\Delta x_j + L_k \Delta x_k = 0, computed stepwise as

Δxj=−log1p ⁣(ΔRjRj),Δxk=−LjLkΔxj,ΔRkout=−Rk expm1(−Δxk).\Delta x_j = -\mathrm{log1p}\!\left(\frac{\Delta R_j}{R_j}\right), \qquad \Delta x_k = -\frac{L_j}{L_k}\Delta x_j, \qquad \Delta R_k^{\text{out}} = -R_k\,\mathrm{expm1}(-\Delta x_k) .

One log1p, one expm1, one multiply-divide. Written as a single closed form it looks like a fractional power; computed stepwise it never is.

It crosses no ticks. ΔQ=0⇒Δxˉ=0\Delta Q = 0 \Rightarrow \Delta \bar x = 0, so every class's drawdown is unchanged and active liquidity is constant. Base-to-base swaps are always single-segment, and they execute in a pool that has never held quote.

Both legs pay the fee. dF=ϕ∑jwj∣dxj∣dF = \phi\sum_j w_j\lvert dx_j\rvert gives

fee=ϕ(Lj∣Δxj∣+Lk∣Δxk∣)=2ϕLj∣Δxj∣,\text{fee} = \phi\big(L_j\lvert\Delta x_j\rvert + L_k\lvert\Delta x_k\rvert\big) = 2\phi L_j\lvert\Delta x_j\rvert,

since Lk∣Δxk∣=Lj∣Δxj∣L_k\lvert\Delta x_k\rvert = L_j\lvert\Delta x_j\rvert identically. That is LVR-correct — both assets were repriced — and it makes fees route-invariant: base→quote→base costs the same 2ϕ2\phi as the direct hop.

Why this cannot be combined with the cap

Both extensions spend the same free constant. A cap is a second boundary on one price; a basket is one boundary on an index of nn prices. There is one constant, so there is one boundary, and the two uses of it are exclusive.

That is not a limitation of an implementation — it is the shape of the admissible family. It is resolved by building two pools rather than one.