Documentation

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:

OperationWhat It DoesExample
AddAttach a new facet with new functionsAdding a new market type
ReplaceSwap out a facet's logicOptimizing gas in the swap function
RemoveDelete functions from the DiamondDeprecating an unused feature

All three are done through a single diamondCut() call on the DiamondTimelock contract.

Safety Guarantees

  1. Only the owner can propose upgrades
  2. 48-hour timelock — every upgrade waits 48 hours before it can execute
  3. On-chain transparency — the exact bytecode and function selectors are visible in the queued transaction
  4. Event logging — all facet changes emit DiamondCut events, 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.