Curve presets

A leg’s depth curve is not tuned per asset. It is one of a few presets written once at deploy, and the leg points at it with a curveId. This page covers what the curve does to a quote, what each installed preset looks like, and how to pick one. The spline mathematics, storage layout and gas are in Liquidity Shaping.


1. How shaping works

The mark comes from the oracle. The curve only answers one question: how far from the mark does the next unit of depth trade?

  • x is cumulative depth, 0 to 10,000 bps of the leg’s depth. The mark sits near 5,000.
  • y(x) is the price offset at that depth, nondecreasing, stored in pbps. A trade walks x away from the mark and pays the mean of y over the depth it consumes (traversal).
  • Density is dx/dy: depth per unit of price move. Where y is flat the book is deep and a trade barely moves the price. Where y is steep the book is thin.
  • Scale is separate: a quote multiplies y by κ/dispRef, with κ the live dispersion. Volatility rescales the curve and never reshapes it.

Two knobs follow, and only one of them is a preset:

KnobSetsChanged by
Preset (curveId)Shape of the book and its reference scaleUPDATE_PROFILE, TUNING tier (1 h)
minDispersionPbps, vegaWidth at quote timeSteward raise, or UPDATE_PROFILE for a cut

Writing a new preset (UPDATE_CURVE, LISTING tier, 1 day) is rare and immutable: an id is written once and never renumbered. Moving a leg between existing presets is the routine operation.

Fees and the coverage toll sit on top of the offset: Spread & Fees, Slippage & Price Impact.


2. Presets

Every number in this section is generated from the deploy manifests by gen-curve-presets.ts in the content repo, so it cannot drift from what the ceremony installs. Preset ids are per deployment: see deployed instances for the ids a given pool carries.

Installed presets

One row per preset family and reference scale. The curve letter names the shape and edge multiple: names that differ in an off-chain flag, in reference scale or by 1 to 2 ULP in the stored weights share a letter, and everything below is computed per letter. Half-swing is the offset at the far edge at the preset’s own reference scale; edge at κ is that edge as a multiple of the live dispersion κ.

CurvePreset namesShapeWeightsInterior knots (bps)Half-swing @ refRef scaleEdge at κUsed by
Abell_100, cn_w100_d100_flat, cn_w100_d100_wallbell, depth at the mark71314, 86861.00 bps100 pbps1xstable
Abell_500, cn_w500_d500_flatbell, depth at the mark71314, 86865.00 bps500 pbps1xequity, fx, volatile
Bcn_w500_d100_wallbell, depth at the mark71314, 86865.00 bps100 pbps5xstable
Cbell_100_invcomplement of the bell, depth in the wings94012, 4997, 7221, 78531.00 bps100 pbps1xnone
Cbell_500_invcomplement of the bell, depth in the wings94012, 4997, 7221, 78535.00 bps500 pbps1xnone

Offsets, densities and costs below are evaluated at a dispersion of κ = 5 bps and scale linearly with it.

Cost of depth consumed from the mark

Mean offset paid, in bps, by a trade that consumes the given share of the leg’s depth above the mark (before fees and the coverage toll), at κ = 5 bps.

Curve1%5%10%25%50%Density at mark / meanDensity at edge / mean
A0.040.210.421.072.281.19x0.66x
B0.211.052.115.3611.421.19x0.66x
C0.060.320.641.522.760.78x1.40x

Offset curve

Price offset against cumulative depth, normalized to the half-swing so shapes compare directly. Depth runs from 0 to 100% of the leg; the mark sits near 50%. orange: curve A; blue: curve C.

Normalized offset vs depth05101520253035404550556065707580859095100cumulative depth (%)10.80.60.40.20-0.2-0.4-0.6-0.8-1offset / half-swing

Depth density

Depth per unit of price move, relative to a flat curve of the same half-swing (1.0 = flat). Above 1 the book is deep and a trade moves the price little; below 1 it is thin. orange: curve A; blue: curve C.

Relative depth density05101520253035404550556065707580859095100cumulative depth (%)21.81.61.41.210.80.60.40.20density / flat

Mean offset by trade size

Mean offset paid by a trade that consumes the share of depth on the x axis, at κ = 5 bps, in bps. orange: curve A; blue: curve C. Every other curve is a multiple of these (see the edge column).

Mean offset vs depth consumed0.52.557.51012.51517.52022.52527.53032.53537.54042.54547.550depth consumed from the mark (%)32.82.62.42.221.81.61.41.210.80.60.40.20offset (bps)

Curve key: A = bell_100, bell_500, cn_w100_d100_flat, cn_w100_d100_wall, cn_w500_d500_flat; B = cn_w500_d100_wall; C = bell_100_inv, bell_500_inv.


3. Choosing a preset

Pick by the leg’s measured trade density, not by its class label: Width selection has the rule. The Used by column above shows where each preset has landed.

3.1. Bell (curve A)

Depth peaks at the mark and thins toward the edge. Small trades pay almost nothing beyond the fee and the cost climbs as a trade eats into the shoulders. It is the right shape when flow clusters near the mark and tails are rare.

  • Pegged legs and the hub take the 1 bp half-swing (bell_100), where the book is tight and the edge is the dispersion itself.
  • Floating legs (volatile, metals, FX, equity) take the 5 bp half-swing (bell_500).

The two have the same shape. They differ in the scale they were fitted at (100 against 500 pbps), so point a leg at the one whose reference scale is nearer its dispersion: the scale factor stays near 1 and the integer-pbps truncation stays small against the offset. Never derive one from the other by rescaling (§4.3).

3.2. Wide bell (curve B)

The same bell with its half-swing at 5x the reference scale: the edge sits at 5 times κ, so a leg with a 1.6 bp floor reaches 8 bp at the far edge. It is for the widest pegged legs, whose quiet-tape floor is small but whose book has to reach further out. Every figure in the cost table is 5x curve A, so check it before assigning the preset.

3.3. Complement (curve C)

The complement inverts the density: thin at the mark, deep in the wings. It is refitted from the bell as ρinv=ρmax+ρmin-ρbase and constrained monotone to under 2% density error, which is why it carries 9 weights and 4 interior knots instead of 7 and 2. At the same dispersion both reach the same edge, but the complement’s mean cost stays above the bell’s at every trade size in the table (1.5x at a 10% trade); only the marginal price in the last few percent of depth moves less, where its density is about twice the bell’s.

Assign it only when a leg’s measured density has its mass in the shoulders rather than at the mark. It is installed so the fit has somewhere to land, never chosen on intuition.

3.4. Rules of thumb

SituationPreset
Pegged leg or hub, flow at the markbell at ref 100
Floating leg, flow at the markbell at ref 500
Pegged leg whose book must reach several times its floorwide bell, if installed
Measured density has its mass in the shoulderscomplement at the matching scale

A wrong preset is cheap to fix: re-pointing is one TUNING op, and because the curve is anchor-free it can be tried against a leg’s live tape without touching the oracle or the reserves.


4. Reading the curve in the pool risk modal

The risk modal names a leg’s preset and its shape (segments, reference scale, wall). Read it with the tables above:

  • Preset is the codebook entry the leg points at. Two legs on the same name have the same shape and can differ in width.
  • Reference scale is the dispersion the preset was fitted at. The far edge sits at the curve’s edge multiple times the leg’s dispersion, so a 4 bp dispersion on a bell quotes at most 4 bps off the mark before the fee and the coverage toll.
  • Min fee is the leg’s path floor, not the one-way fee: the one-way fee is half the sum of the spoke’s and the hub’s (Spread & Fees).