An implementation of the "Split the Yield, Share the Risk" framework for yield tokenization in Solidity. This system allows users to decompose yield-bearing assets (ERC-4626) into Principal Tokens (PT) and Yield Tokens (YT), and trade them to achieve fixed interest rates.
Yield tokenization is a mechanism that separates a yield-bearing asset into two distinct components:
- Principal Tokens (PT): Represent the right to redeem the underlying principal asset at maturity.
- Yield Tokens (YT): Represent the right to collect all yield accrued by the underlying asset until maturity.
To minimize gas costs, the system uses a factory pattern with Minimal Proxies. Instead of deploying a full contract for every new maturity, the YieldTokenizer clones pre-deployed singleton implementations.
The central engine that manages tokenization, redemptions, and yield accounting.
- YieldPool.sol: A specialized pool for PT/Underlying trading.
- YieldAMMFactory.sol: Factory for deploying liquidity pools for specific PTs.
- FixedRateQuoter.sol: Calculates market-implied fixed APRs based on PT prices.
cd Constant_Yield_Solidity
forge build
forge test -vvBy selling Yield Tokens (YT) or buying Principal Tokens (PT) at a discount in the AMM, users can effectively "lock in" a fixed interest rate. The FixedRateQuoter provides the real-time implied APR: