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

ContractPurpose
Diamond.solThe proxy — all user transactions go here. Routes calls to the correct facet.
DiamondInit.solRuns initialization logic during deployment and upgrades.
DiamondTimelock.solEnforces a 48-hour delay on all administrative actions.

Facets (10)

FacetPurpose
DiamondCutFacetAdd, replace, or remove facets
DiamondLoupeFacetQuery what functions exist on the Diamond
OwnershipFacetERC-173 owner management
PoolRegistryFacetPool and adapter management
LiquidityFacetMint PT+YT, manage positions
RedemptionFacetPost-maturity settlement
YieldAccumulatorFacetYield tracking and distribution
YieldForgeMarketFacetPT secondary market AMM
PauseFacetEmergency circuit breaker
YTOrderbookFacetYT peer-to-peer trading

Tokens

ContractTypeNotes
PrincipalToken.solERC-20Minted by LiquidityFacet, burned on redemption.
YieldToken.solERC-20Tracks yield accrual for holders.

Token naming follows the pattern: YF-PT-{HASH6}-{DDMMMYYYY} (e.g., YF-PT-A3F2E9-31MAR2025).

Adapters (2)

AdapterProtocol
UniswapV4AdapterUniswap V4
UniswapV3AdapterUniswap V3

All adapters implement the same ILiquidityAdapter interface for depositing, withdrawing, and collecting yield from the underlying protocol.