fix(M4/L5/L8): oracle robustness - #18
Merged
Merged
Conversation
Groups the audit's oracle-robustness findings: - M4: a prolonged Chainlink outage freezes the risky-leg mark, so the normal CPPI trigger goes blind to a real decline. OracleHub gains prolongedStale() (feed stale beyond a configurable window since the last good snapshot); the vault gains a permissionless deRiskUnderProlongedStaleness() that fully de-risks into the safe leg at the degraded bound. Over-conservative but floor-safe; a later rebalance re-risks once the feed recovers. - L5: settleEpoch now requires oracle health, so value is never crystallized at a stale/degraded price. - L8: OracleHub takes an optional USDC/USD feed; when USDC depegs beyond a tolerance (or its feed is stale), healthy() flips false so deposits and settlement pause until the peg returns. address(0) disables the check (par assumed). Addresses the ETH/USD-as-ETH/USDC conflation at the settlement/gating layer. IOracleHealth extended with prolongedStale(); constructor unchanged (USDC feed and windows are owner setters). 7 regression tests; 127 -> 134.
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category PR grouping the audit's oracle-robustness findings. Branched off main, targets main.
M4 — prolonged-staleness circuit breaker
A prolonged Chainlink outage freezes the risky-leg mark, so the normal CPPI trigger (which reads that mark) is blind to a real decline and never fires.
OracleHub.prolongedStale()reports when the feed has been stale beyond a configurable window since the last good snapshot;CPPIVault.deRiskUnderProlongedStaleness()is then permissionless and fully de-risks into the safe leg at the degraded bound (H6). Over-conservative but floor-safe; a later rebalance re-risks once the feed recovers. Reverts to zero risky then no-ops, so it isn't spammable.L5 — gate settlement on health
settleEpochnow calls_requireOracleHealthy(), so an epoch's NAV is never crystallized at a stale or depegged price. (Claims read the frozenepochNavPerShare, so they stay open per the audit.)L8 — USDC/USD conflation
OracleHubtakes an optional USDC/USD feed viasetUsdcFeed. When USDC depegs beyondmaxUsdcDepegBps(or its feed is stale),healthy()flips false so deposits and settlement pause until the peg returns.address(0)disables the check (par assumed). This closes the ETH/USD-used-as-ETH/USDC gap at the settlement/gating layer without threading a conversion through every swap bound.Tests
7 regressions: prolonged-stale full de-risk (permissionless), not-allowed-when-not-prolonged, settleEpoch blocked when unhealthy, USDC depeg / stale-feed / within-tolerance / no-feed, and the prolonged-stale view timing. Suite 127 -> 134. No fork surface changed (ExecutionModule/PT adapter untouched).