Documentation
Smart Contracts
Overview of contracts, facets, tokens, and adapters.
Here's every contract in the Yield Forge protocol and what it does.
Core System
| Contract | Purpose |
|---|---|
| Diamond.sol | The proxy — all user transactions go here. Routes calls to the correct facet. |
| DiamondInit.sol | Runs initialization logic during deployment and upgrades. |
| DiamondTimelock.sol | Enforces a 48-hour delay on all administrative actions. |
Facets (10)
| Facet | Purpose |
|---|---|
| DiamondCutFacet | Add, replace, or remove facets |
| DiamondLoupeFacet | Query what functions exist on the Diamond |
| OwnershipFacet | ERC-173 owner management |
| PoolRegistryFacet | Pool and adapter management |
| LiquidityFacet | Mint PT+YT, manage positions |
| RedemptionFacet | Post-maturity settlement |
| YieldAccumulatorFacet | Yield tracking and distribution |
| YieldForgeMarketFacet | PT secondary market AMM |
| PauseFacet | Emergency circuit breaker |
| YTOrderbookFacet | YT peer-to-peer trading |
Tokens
| Contract | Type | Notes |
|---|---|---|
| PrincipalToken.sol | ERC-20 | Minted by LiquidityFacet, burned on redemption. |
| YieldToken.sol | ERC-20 | Tracks yield accrual for holders. |
Token naming follows the pattern: YF-PT-{HASH6}-{DDMMMYYYY} (e.g., YF-PT-A3F2E9-31MAR2025).
Adapters (2)
| Adapter | Protocol |
|---|---|
| UniswapV4Adapter | Uniswap V4 |
| UniswapV3Adapter | Uniswap V3 |
All adapters implement the same ILiquidityAdapter interface for depositing, withdrawing, and collecting yield from the underlying protocol.