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 , with the live dispersion. Volatility rescales the curve and never reshapes it.
Two knobs follow, and only one of them is a preset:
| Knob | Sets | Changed by |
|---|---|---|
Preset (curveId) | Shape of the book and its reference scale | UPDATE_PROFILE, TUNING tier (1 h) |
minDispersionPbps, vega | Width at quote time | Steward 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 .
| Curve | Preset names | Shape | Weights | Interior knots (bps) | Half-swing @ ref | Ref scale | Edge at | Used by |
|---|---|---|---|---|---|---|---|---|
| A | bell_100, cn_w100_d100_flat, cn_w100_d100_wall | bell, depth at the mark | 7 | 1314, 8686 | 1.00 bps | 100 pbps | 1x | stable |
| A | bell_500, cn_w500_d500_flat | bell, depth at the mark | 7 | 1314, 8686 | 5.00 bps | 500 pbps | 1x | equity, fx, volatile |
| B | cn_w500_d100_wall | bell, depth at the mark | 7 | 1314, 8686 | 5.00 bps | 100 pbps | 5x | stable |
| C | bell_100_inv | complement of the bell, depth in the wings | 9 | 4012, 4997, 7221, 7853 | 1.00 bps | 100 pbps | 1x | none |
| C | bell_500_inv | complement of the bell, depth in the wings | 9 | 4012, 4997, 7221, 7853 | 5.00 bps | 500 pbps | 1x | none |
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.
| Curve | 1% | 5% | 10% | 25% | 50% | Density at mark / mean | Density at edge / mean |
|---|---|---|---|---|---|---|---|
| A | 0.04 | 0.21 | 0.42 | 1.07 | 2.28 | 1.19x | 0.66x |
| B | 0.21 | 1.05 | 2.11 | 5.36 | 11.42 | 1.19x | 0.66x |
| C | 0.06 | 0.32 | 0.64 | 1.52 | 2.76 | 0.78x | 1.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.
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.
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).
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 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
| Situation | Preset |
|---|---|
| Pegged leg or hub, flow at the mark | bell at ref 100 |
| Floating leg, flow at the mark | bell at ref 500 |
| Pegged leg whose book must reach several times its floor | wide bell, if installed |
| Measured density has its mass in the shoulders | complement 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).
5. Related documentation
- Liquidity Shaping: spline mathematics, storage, traversal
- Parametrization:
minDispersionPbps, vega and the fences - Spread & Fees: the fee on top of the offset
- Slippage & Price Impact: the full decomposition