Skip to content
log(swap)

Introduction

log(swap) is a risk-aware liquidity primitive for institutional DeFi, built on the log invariant — a relation between reserves whose holdings replicate V(p)∝log⁡pV(p) \propto \log p, so liquidity is flat in log price. The protocol uses this curve in concentrated markets and pools with shared liquidity terms.

In one line: liquidity, commoditized. One number, LL, sets the depth, the exposure and the variance a position carries at any price above its floor, so liquidity becomes a standard unit that can be sized, priced against the risk it takes, combined and split.

  • Predictable market impact. The displayed liquidity LL determines the price impact exactly, so what you see is what you get: log-price slippage is Δx=ΔQ/L\Delta x = \Delta Q/L.
  • Explicit liquidity exposure. Liquidity LL is constant across prices above the floor. Risk is constant in both the dimensions that matter: exposure — delta, pV′=LpV' = L — and the LVR risk — gamma, p2∣V′′∣=Lp^2|V''| = L — are equal to LL, which makes exposure hedgeable and P&L quantifiable.
  • Capital efficiency. For the same reserves, displayed liquidity is roughly four times that of the xy=kxy = k invariant — the same capital, four times the depth.
  • Simple liquidity workflows. Positions are fungible and liquidity is algebraic: a portfolio can be combined, split, rebalanced or resized without rebuilding fragmented ranges and positions.
  • Institutional infrastructure. At the core, the protocol provides the foundations for compliant liquidity infrastructure: protocol-owned liquidity and private pools with controlled access. SLAs and KPIs are contract-enforced parameters, under the operator's full control, and fee income and realized risk are measured from the same on-chain price path, so the outturn is a subtraction rather than a reconciliation.
  • Elegant mathematics. The log invariant makes nominal delta and gamma constant, so a single parameter LL sets the pool's liquidity exposure — liquidity with no price attached.

The documentation is organised along four axes:

  • Concepts — the mathematics, stated precisely. The invariant, the cap, the multi-asset extension, LVR, the swap law, the fee statistic, aggregation.
  • Protocol — two pools and their architecture: two managers, a router and a lens each, and how the mathematics is actually implemented.
  • Usage — every kind of participant and how each one interacts with the protocol: swapper, resting order, liquidity provider, basket holder, token creator, integrator.
  • Products — what the protocol offers: public markets, private pools, protocol-owned liquidity and launchpads.

The primitive in one line

A pool holding base RR and quote QQ runs the log invariant if

R eQ/L=Lpmin⁡R\, e^{Q/L} = \frac{L}{p_{\min}}

for an exposure L>0L > 0 in quote units and a floor pmin⁡p_{\min}. Differentiating gives p=L/Rp = L/R, and substituting back fixes the whole state: R=L/pR = L/p, Q=Llog⁡(p/pmin⁡)Q = L\log(p/p_{\min}). Read The log invariant for what that buys.

One primitive, two implementations

The protocol provides two pool types. C-pool LPs choose individual floors and caps. F-pool holders share the pool's floor, composition and any generation cap; an F-pool can hold multiple base assets:

F-pool (fungible)C-pool (concentrated)
the floorone, shared by every shareone per LP
assetsnn bases, one quoteone base, one quote
concentrationnone — liquidity is sharedper-LP floor and cap
fee accountingnone — the floor is the accumulatorexplicit, per class
resting orders—capped positions, both directions
forcapital that wants risk-management guaranteesLPs who want their own range

See The two pools.