Protocol design

AMM and YT routing

One pool prices PT, SY and YT together, on a curve that knows the clock is ticking. This page explains why an ordinary trading pool can't hold this market, how the curve works, and how YT trades through a pool that never holds YT.

First, what an AMM is

An AMM (automated market maker) is a trading venue with no order book and no counterparty to wait for. It is a pool holding two assets, and a formula that quotes a price from the pool’s current balances. Anyone can trade against the pool at the quoted price, and anyone can deposit both assets into it (becoming a liquidity provider, or LP) to earn a cut of the trading fees.

Why the standard formula fails here

The classic AMM formula (Uniswap’s constant product) assumes the two assets have no scheduled relationship over time. PT has a scheduled principal claim. In asset units it approaches par at maturity; in SY shares its redemption amount depends on the frozen exchange rate and backing. Put PT in a standard pool and one of two bad things happens. Either the pool keeps overpricing PT along the way and arbitrage traders steadily drain the LPs as the price converges, or the pool underprices PT and nobody mints it in the first place.

The fix is a formula with time built in, so the drift toward one dollar happens inside the pricing itself instead of being extracted from LPs trade by trade.

The time-decay curve

Sidereal uses the curve Pendle V2 adapted from Notional, two established fixed-rate protocols on Ethereum:

rate_scalar   = scalar_root · YEAR / τ
exchange_rate = ln(p / (1 − p)) / rate_scalar + a

p = PT_reserve / (PT_reserve + SY_reserve_in_asset_units)

Three parameters shape it:

  • Rate scalar (r): how sharply the price reacts when the pool’s balances shift. Higher means tighter prices near the going rate, but worse prices for trades that push the rate far.
  • Rate anchor (a): the rate the curve centers itself around, set from the underlying interest rate at deployment and updated as the market discovers its own level.
  • Time to maturity (τ): the countdown. As it approaches zero, the curve flattens onto one PT face unit per unit of underlying asset. The AMM values the SY reserve at the vault’s exchange rate before pricing, so PT is measured in asset units even when one SY share is worth more than one underlying unit.

The curve concentrates liquidity around the current interest rate where trading happens, and its price can be read as a yearly rate. The AMM values the SY reserve at the vault exchange rate before feeding it to the curve, and the tokenizer uses the same rounding at that boundary, so the two contracts never disagree on units. The displayed number is the implied APY you see in the app: the fixed rate the market is currently offering.

Integer math, by necessity

Solidity has no floating-point type, so the curve is implemented in whole-number (fixed-point, WAD) math: integer ln, exp and sqrt series ported from the reference implementation. Nothing in the pricing path is a floating-point approximation. The AMM’s randomized custody/reserve suite covers both par and non-par SY rates, so the asset-unit conversion is exercised directly.

How YT trades through a PT pool

The pool only ever holds PT and SY. YT trades ride through it in one atomic transaction, using the split identity. Buying YT with SY:

1. Your SY goes to the market contract.
2. It borrows extra SY from the pool, inside the same transaction.
3. The combined SY is split into PT + YT.
4. The PT goes back to the pool, repaying the borrow.
5. The YT comes to you.

Selling YT runs the same loop backwards. Because an EVM transaction succeeds or fails as a single unit, the borrow can never be left hanging: either every step lands or none do. The AMM holds a standing ERC-20 approval for the tokenizer so the flash split can pull the SY it needs.

The payoff of this design: all three assets share one pot of liquidity. Every YT trade is a PT trade underneath, so there is no separate, thinner YT pool, and the two prices can never drift apart. They are the same price read from opposite ends.

The built-in price average (TWAP)

Every trade updates a rolling 30-minute average of the implied rate, called a TWAP (time-weighted average price). It is useful for display during active trading. It is not, by itself, a collateral-grade oracle: after a long quiet spell, one trade resets the average and the warming-up flag expires 30 minutes later even if no second trade arrives. The grant-built oracle therefore also requires fresh observations, minimum in-window coverage, and a liquidity floor.

This exists for a concrete reason: external price feeds have been manipulated before, draining lending markets that trusted them. Sidereal’s pricing path uses no external feed at all. The interest rate is derived from the bond strategy on every interaction. The native TWAP is an oracle input, not a standalone manipulation-resistance guarantee.

What liquidity providers earn

LPs deposit PT and SY at the pool’s current ratio and earn two things:

  • Trading fees, initialized per pool in basis points and bounded by the AMM contract. The configured admin can update the fee, with every change emitted on-chain.
  • Curve convergence. The curve moves its asset-denominated PT price toward one as maturity nears. Because the AMM converts SY shares to asset units before pricing, that convergence is measured in the same units the tokenizer redeems in.

Every pool operation accepts a minimum-you-will-accept bound. If the price moves against you between quote and execution beyond that bound, the transaction cancels itself rather than filling badly. See the liquidity guide for the practical walkthrough.