Documentation

Pricing Math

The math behind the PT secondary market — invariant, virtual reserves, and interest rate discovery.

The Yield Forge AMM uses a constant product formula with a twist: one side of the pool is virtual. This page explains the math.

The Invariant

PT Reserve×Virtual Quote Reserve=k\text{PT Reserve} \times \text{Virtual Quote Reserve} = k

  • PT Reserve — actual PT tokens deposited by LPs
  • Virtual Quote Reserve — a calculated value derived from the current price, not real tokens

This enables single-sided liquidity — LPs deposit only PT, and the protocol infers the quote side mathematically.

How Swaps Work

When someone buys PT with quote tokens:

  1. Quote tokens enter the pool (increase virtual quote reserve)
  2. PT tokens leave the pool (decrease PT reserve)
  3. The constant kk is maintained

The price impact depends on trade size relative to reserves — larger trades move the price more.

Interest Rate Discovery

The PT price directly implies a fixed interest rate:

Ppt=V(t)(1+r)tP_{pt} = \frac{V(t)}{(1 + r)^{t}}

Where rr is the implied APY, tt is time to maturity in years, and V(t)V(t) is the maturity target (LP value per PT unit, stored on-chain as maturityTargetPriceBps).

User ActionEffect on PT PriceEffect on Implied Rate
Buy PTPrice goes upRate goes down
Sell PTPrice goes downRate goes up

This makes the Yield Forge market an on-chain interest rate oracle — the trading price reflects the market's consensus on fair yield for that pool.

Dynamic Fees

Swap fees scale dynamically with time elapsed in the cycle — starting at a base rate and increasing as the pool approaches maturity. This compensates LPs for increased impermanent loss risk as PT price converges to the maturity target.

ParameterValue
Base fee10 bps (0.10%)
Max fee50 bps (0.50%)
Fee split80% LP, 20% protocol