Appearance
Curve Engine and Trade Execution
Overview
The protocol prices interest rate swaps using an 8-Knot Curve Engine backed by a 3-Tranche Impact Kernel. Together, these components produce a genuine yield curve that reflects market expectations across maturities from 1 to 180 days, and execute trades with concentrated-liquidity-style price impact.
Key properties:
- Term structure, not a single rate. The engine maintains rates at 8 distinct maturity points (knots), forming a real yield curve. Rates at different tenors can diverge based on supply and demand at each horizon.
- Any-day tenors. Traders can pick any integer day from 1 to 180. The engine interpolates between the two nearest knots to produce a mid-rate.
- Unified liquidity. All depth comes from a single pool. The engine allocates depth across tenor segments using configurable weights, so governance can tune where liquidity concentrates.
- Local updates. Each trade only shifts the two knots that bracket the chosen tenor. A 45-day trade moves the 30-day and 60-day knots; it does not disturb the 7-day or 180-day knots.
- Stateless execution. The Impact Kernel is a pure function: given a starting rate, trade size, and available depth, it returns the execution result. No persistent AMM price state is needed.
1. The 8-Knot Term Structure
The curve is defined by 8 fixed maturity points:
| Knot | Maturity |
|---|---|
| 0 | 1 day |
| 1 | 3 days |
| 2 | 7 days |
| 3 | 14 days |
| 4 | 30 days |
| 5 | 60 days |
| 6 | 90 days |
| 7 | 180 days |
At each knot, the engine stores an integrated funding value rather than a raw rate. You can think of integrated funding as the total accumulated rate exposure from now until that maturity. The average annualized rate to any knot is simply its integrated value divided by its year-fraction.
Why integrated funding? Storing integrated values (rather than raw rates) makes interpolation between knots mathematically clean. Linear interpolation of integrated values automatically produces sensible average rates for any tenor between two knots, without introducing artifacts.
What this means for traders: The protocol displays a full yield curve, not a single number. You might see 5.2% for 7-day swaps, 4.8% for 30-day swaps, and 6.1% for 90-day swaps, all at the same time. These rates move independently based on trading activity at each part of the curve.
2. Any-Day Tenors (Interpolation)
Although the curve has only 8 knots, traders are not restricted to those maturities. You can trade any integer-day tenor from 1 to 180 days.
How it works:
- The engine finds the two knots that bracket your chosen tenor. For example, a 45-day trade falls between the 30-day knot (index 4) and the 60-day knot (index 5).
- It computes a blending weight based on where your tenor sits between the two knots:
(45 - 30) / (60 - 30) = 0.5in this case. - It interpolates the integrated funding values of the two bracketing knots using that weight.
- The result is converted to an average annualized rate: your mid-rate for that tenor.
If you trade at exactly a knot maturity (say 30 days), no interpolation is needed; you get that knot's rate directly.
3. Unified Liquidity, Segmented Depth
One Pool, Seven Segments
All liquidity comes from a single unified pool. The engine divides this pool's effective depth across 7 tenor segments, one for each gap between adjacent knots:
| Segment | Covers |
|---|---|
| 0 | 1d -- 3d |
| 1 | 3d -- 7d |
| 2 | 7d -- 14d |
| 3 | 14d -- 30d |
| 4 | 30d -- 60d |
| 5 | 60d -- 90d |
| 6 | 90d -- 180d |
Each segment receives a share of the total depth based on configurable segment weights (expressed in basis points, summing to 10,000). Governance can adjust these weights to concentrate liquidity where it is most needed.
Depth at Your Tenor
When you trade at a tenor between two knots, the engine computes the effective depth available for your trade. This depth blends the depths of the two neighboring segments using a harmonic-mean formula that ensures:
- Continuity: The depth you see changes smoothly as your tenor approaches a knot boundary. There are no jumps or cliffs where one side of a knot is dramatically cheaper than the other.
- No boundary gaming: A trader cannot exploit a discontinuity at a knot boundary to get artificially cheap execution.
4. Trade Execution: The 3-Tranche Impact Kernel
Once the engine has a mid-rate and effective depth for your tenor, execution is handled by the Impact Kernel, a stateless function that determines price impact and execution cost.
How the Tranches Work
The available depth is split into three virtual liquidity tranches:
| Tranche | Role | Typical Share |
|---|---|---|
| Core | Tight liquidity around the current rate. Most trades execute entirely within this band, experiencing minimal slippage. | Largest allocation |
| Mezzanine | Medium-width band that activates as price moves beyond Core. Provides additional depth for medium-sized trades. | Moderate allocation |
| Tail | Wide band that catches large or directional moves. Available during stress or very large trades. | Remaining allocation |
The tranches are nested: Core sits inside Mezzanine, which sits inside Tail. At any given price point, you benefit from the combined liquidity of all tranches that are active at that price.
Execution Flow
- Start at the mid-rate. The kernel begins at the current curve mid-rate for your tenor.
- Consume depth across tranches. As your trade pushes the rate, it consumes liquidity from active tranches. Small trades stay within Core and experience tight execution. Larger trades push through Core into Mezzanine and then Tail, where liquidity is thinner and slippage increases.
- Boundary crossing. When the rate crosses from one tranche boundary to the next, the active liquidity changes. The kernel snaps exactly to each boundary to prevent precision drift.
- Two rates produced. The kernel returns:
- VWAP rate: The volume-weighted average rate across the entire trade path. This is your execution price and becomes your position's entry rate.
- Endpoint rate: The post-trade marginal rate where the curve now sits. This is used for mark TWAP recording.
What This Means for Traders
- Small trades get near-zero slippage because they stay within the tightly concentrated Core tranche.
- Large trades experience progressively more slippage as they push through Mezzanine and into Tail, reflecting the economic reality that large orders consume more liquidity.
- The protocol cannot run out of liquidity silently. If a trade would push the rate beyond all tranche boundaries, the transaction fails with an explicit error rather than producing a bad fill.
5. Local Curve Updates (2-Knot Push)
After execution, the curve must be updated to reflect the new rate. The engine uses a normalized 2-knot push: only the two knots bracketing the traded tenor are moved.
Why only two knots?
- Isolation. A trade at the 45-day tenor should not disturb the 7-day rate. Markets at different maturities can evolve independently.
- Predictability. Traders can reason about which parts of the curve their trade affects.
The update weights are proportional to how close the trade is to each bracketing knot, ensuring the interpolated rate at the exact traded tenor moves by precisely the amount implied by the execution.
Optional Smoothing
The engine supports an optional smoothing step that reduces kinks in the curve after a trade. When enabled, smoothing applies a small Laplacian correction to interior knots (knots 1 through 6), gently pulling rates toward their neighbors. Two safeguards prevent smoothing from distorting the trade:
- Cap. The smoothing adjustment at any knot is capped relative to the trade's own price impact, so smoothing can never overwhelm the trade signal.
- Traded-tenor constraint. After smoothing, the engine re-corrects the two bracketing knots to ensure the rate at the exact traded tenor remains exactly where execution placed it.
6. Carry Sizing (Pricing Notional)
When you submit a trade with a face notional (e.g., $100,000 at 90 days), the engine converts this into a pricing notional (also called carry-equivalent exposure) before calculating impact and fees.
The conversion is:
Pricing Notional = Face Notional x (Tenor in seconds / Seconds per year)This is proportional to DV01 (dollar value of a basis point), the standard measure of interest rate risk. A $100,000 position at 90 days has roughly half the rate exposure of a $100,000 position at 180 days, and the pricing notional reflects that.
What carry sizing does:
- Impact calculation. The Impact Kernel uses pricing notional as the trade size, so longer-tenor trades generate proportionally more price impact for the same face notional.
- Fee basis. Fees are computed on the pricing notional, aligning fee revenue with the actual risk the trade introduces to the pool.
What carry sizing does NOT do:
- It does not build or shape the yield curve. The curve is determined purely by the 8-knot term structure and trading activity. Carry sizing is an input transformation that scales trade size for risk measurement purposes only.
7. Safety Rails
Rate Bounds
The engine enforces configurable bounds on knot rates after every trade:
- Average rate bounds. Each knot's average rate must stay within
[min_avg_rate, max_avg_rate]. This prevents the curve from reaching economically absurd values. - Forward rate bounds (optional). If enabled, the implied forward rate between each pair of adjacent knots must stay within
[min_fwd_rate, max_fwd_rate]. This prevents the term structure from inverting or steepening beyond reasonable limits.
If a trade would push any knot outside these bounds, the transaction fails.
Mark Deviation Checks
For risk-increasing trades only (trades that add exposure to the pool), the engine checks that both the VWAP execution rate and the endpoint rate are within a configurable deviation band around the pre-trade mark rate. This acts as a circuit breaker against price manipulation:
- A manipulator cannot execute at an extreme rate far from the recent trading range.
- Risk-reducing trades (exits) are exempt: traders can always reduce their positions.
The mark rate itself is computed from a per-knot TWAP using Largest-Wins semantics (see the Mark TWAP documentation for details).
Insufficient Depth
If the effective depth at the traded tenor is zero (due to segment weight configuration or pool depletion), the trade fails immediately rather than executing with infinite slippage.
Summary
| Concept | Old Model | Current Model |
|---|---|---|
| Rate representation | Single rate for all tenors | 8-knot term structure (genuine yield curve) |
| Custom tenors | Duration penalty on single rate | Interpolation between bracketing knots |
| Execution engine | Tenor-agnostic constant-product vAMM | Stateless 3-tranche Impact Kernel per tenor |
| Trade impact scope | Moved a single global rate | Moves only the 2 bracketing knots |
| Duration/carry | Reduced effective depth to penalize longer tenors | Scales trade size (pricing notional) for risk measurement; does not affect curve shape |
| Liquidity distribution | Uniform across all tenors | Configurable segment weights across 7 tenor segments |
Cross References
- Mark TWAP and Deviation Checks -- per-knot Largest-Wins mark tracking (see Mark TWAP)
- Fees -- dynamic fee components applied to pricing notional (see Fees)
- Risk Limits -- DV01 and OI caps, risk classification (see Risk Limits)
- Settlement -- funding accrual and oracle mechanics (see Settlement)
- Pool and LP Mechanics -- how depth flows from the pool to markets (see Pool LP)