Skip to content

Demeter-Financial-Labs/Constant_Yield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Constant Yield Tokenization System

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.

Overview

Yield tokenization is a mechanism that separates a yield-bearing asset into two distinct components:

  1. Principal Tokens (PT): Represent the right to redeem the underlying principal asset at maturity.
  2. Yield Tokens (YT): Represent the right to collect all yield accrued by the underlying asset until maturity.

Architecture & Optimization

1. Minimal Proxies (EIP-1167)

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.

2. YieldTokenizer (src/YieldTokenizer.sol)

The central engine that manages tokenization, redemptions, and yield accounting.

3. AMM & Fixed-Rate Discovery (src/amm/)

  • 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.

Getting Started

Build & Test

cd Constant_Yield_Solidity
forge build
forge test -vv

Fixed-Rate Synthesis

By 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: $$APR = \left(\frac{1}{P_{PT}} - 1\right) \times \frac{365}{\text{days to maturity}}$$

About

Implementation of the strategy exposed in the "Split the Yield, Share the Risk: Pricing, Hedging and Fixed rates in DeFi" paper [2025]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors