Dekant

The L₂-norm CFAMM

Dekant's market mechanic is a constant-function automated market maker built around a single invariant: the L₂ norm of the position vector is constant.

The invariant

For a market with N outcomes, the AMM holds a position vector x = (x₁, x₂, ..., x_N) and enforces:

‖x‖₂ = √(Σ xᵢ²) = k

where k is a scalar set at market creation and updated only by liquidity events. Every valid AMM state is a point on the surface of an N-dimensional hypersphere of radius k.

Reserves and positions are linked via:

xᵢ = k − hᵢ

where hᵢ is the AMM's holding of outcome-i tokens. So as xᵢ grows, the AMM holds fewer of token i and the price of buying more of i rises.

Why L₂ instead of the usual Σxᵢ = k or Πxᵢ = k

Constant-sum AMMs (Σxᵢ = k) give every outcome the same marginal price regardless of position - there is no price discovery. Constant-product AMMs (Uniswap-style) have an asymptotic price function that diverges at the edges, which is fine for spot trading but inappropriate when each outcome has a fixed $1 redemption ceiling.

The L₂ invariant gives a well-behaved price curve that respects the fixed payout ceiling. By Cauchy-Schwarz, the optimal trader response is:

xᵢ* ∝ pᵢ

where pᵢ is the trader's true subjective probability for outcome i. This means a rational trader's optimal action moves the AMM state toward true probabilities - the L₂ AMM is a market scoring rule.

Probability extraction

The implied probability the AMM assigns to outcome i is:

p̂ᵢ = xᵢ² / k²

Two things to notice:

  1. It always sums to 1, because Σ xᵢ² = k² is the invariant.
  2. It's quadratically distorted. A "true" 70% probability registers as 0.7² / Σ pⱼ² ≈ 84.5% in the implied vector. Probabilities near 0% and 100% get compressed; probabilities near 50% get amplified.

Recovering true probabilities

If you need calibrated probabilities (for analytics, monitoring, or risk-management), invert the distortion:

pᵢ = √p̂ᵢ / Σⱼ √p̂ⱼ

This recovers the unnormalized probabilities and re-normalizes to a true distribution.

In practice, traders rarely need to do this themselves - the trading UI displays calibrated probabilities by default. But anyone reading raw on-chain state should know the data is in the distorted form.

Why this matters

The L₂-norm CFAMM is what makes "draw a curve" work. Because every state lies on a fixed hypersphere, the system can afford to let traders make distribution buys (allocating stake across many bins weighted by a Gaussian) while preserving a clean invariant relation. The math composes; you can do single-bin buys, single-bin sells, multi-bin distribution buys, and adds/removes of liquidity, and they all live on the same constant-norm surface.

The next pages walk through each operation's closed-form math.