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 — 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:
- Quote tokens enter the pool (increase virtual quote reserve)
- PT tokens leave the pool (decrease PT reserve)
- The constant 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:
Where is the implied APY, is time to maturity in years, and is the maturity target (LP value per PT unit, stored on-chain as maturityTargetPriceBps).
| User Action | Effect on PT Price | Effect on Implied Rate |
|---|---|---|
| Buy PT | Price goes up | Rate goes down |
| Sell PT | Price goes down | Rate 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.
| Parameter | Value |
|---|---|
| Base fee | 10 bps (0.10%) |
| Max fee | 50 bps (0.50%) |
| Fee split | 80% LP, 20% protocol |