Upgrades
How the protocol can be upgraded, and what safeguards are in place.
Yield Forge is upgradeable. This allows the team to fix bugs, optimize gas costs, and add new features — without migrating to a new contract.
How Upgrades Work
The protocol uses the Diamond Cut function from EIP-2535. It supports three operations:
| Operation | What It Does | Example |
|---|---|---|
| Add | Attach a new facet with new functions | Adding a new market type |
| Replace | Swap out a facet's logic | Optimizing gas in the swap function |
| Remove | Delete functions from the Diamond | Deprecating an unused feature |
All three are done through a single diamondCut() call on the DiamondTimelock contract.
Safety Guarantees
- Only the owner can propose upgrades
- 48-hour timelock — every upgrade waits 48 hours before it can execute
- On-chain transparency — the exact bytecode and function selectors are visible in the queued transaction
- Event logging — all facet changes emit
DiamondCutevents, permanently recorded on-chain
What Can't Be Upgraded
The Diamond proxy routing logic itself is immutable. Storage layout includes reserved space for future fields — preventing storage collisions during upgrades.
What Happens to Your Funds
Upgrades change logic, not storage. Your positions, balances, and yield are stored in the Diamond's storage — they persist across upgrades unchanged.
!NOTE If you see a pending upgrade you disagree with, you have 48 hours to redeem your positions and exit the protocol before it takes effect.