Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdded Chronicle as an oracle vendor option with vendor-aware logic across metadata, utilities, and feed tooltip components. The system now dynamically detects vendors, selects vendor-specific icons/URLs, and renders vendor-dependent fields in the feed details tooltip. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/utils/oracle.ts (1)
76-82: Detect Chronicle from Chronicle-specific fields too, not only provider text.Right now Chronicle detection depends on
providermatching. If scanner emits Chronicle fields with empty/null provider, these feeds will fall back toUnknown.As per coding guidelines: "Oracle vendor/type/feed classification must resolve from scanner metadata source keyed by chainId+oracleAddress; do not use Morpho API oracles enrichment as fallback".♻️ Suggested hardening
export function detectFeedVendorFromMetadata(feed: EnrichedFeed | null | undefined): FeedVendorResult { if (!feed) { @@ const isPendleFeed = feed.pendleFeedKind != null || feed.pendleFeedSubtype != null || feed.baseDiscountPerYear != null || feed.pt != null || feed.ptSymbol != null; - const vendor = isPendleFeed ? PriceFeedVendors.Pendle : mapProviderToVendor(feed.provider); + const isChronicleFeed = + feed.riskTier != null || + feed.updateInterval != null || + feed.updateSpread != null; + const vendor = isPendleFeed + ? PriceFeedVendors.Pendle + : isChronicleFeed + ? PriceFeedVendors.Chronicle + : mapProviderToVendor(feed.provider);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/utils/oracle.ts` around lines 76 - 82, The current vendor detection only checks normalizedProvider string (lines using normalizedProvider and the mapping to PriceFeedVendors) so Chronicle feeds with empty/null provider slip through; update the vendor-detection logic in the oracle classification function to also inspect the scanner metadata (the record keyed by chainId+oracleAddress) for Chronicle-specific fields (e.g., any chronicle-prefixed keys or known Chronicle payload fields) and return PriceFeedVendors.Chronicle when those fields are present; ensure you reference PriceFeedVendors and normalizedProvider in the same function and do not fall back to Morpho API enrichment—determine vendor solely from the scanner metadata source.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/utils/oracle.ts`:
- Around line 76-82: The current vendor detection only checks normalizedProvider
string (lines using normalizedProvider and the mapping to PriceFeedVendors) so
Chronicle feeds with empty/null provider slip through; update the
vendor-detection logic in the oracle classification function to also inspect the
scanner metadata (the record keyed by chainId+oracleAddress) for
Chronicle-specific fields (e.g., any chronicle-prefixed keys or known Chronicle
payload fields) and return PriceFeedVendors.Chronicle when those fields are
present; ensure you reference PriceFeedVendors and normalizedProvider in the
same function and do not fall back to Morpho API enrichment—determine vendor
solely from the scanner metadata source.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5744dd11-3747-47ce-9e7d-613b5e07dce3
⛔ Files ignored due to path filters (1)
src/imgs/oracles/chronicle.svgis excluded by!**/*.svg
📒 Files selected for processing (4)
src/features/markets/components/oracle/MarketOracle/ChainlinkFeedTooltip.tsxsrc/features/markets/components/oracle/MarketOracle/FeedEntry.tsxsrc/hooks/useOracleMetadata.tssrc/utils/oracle.ts
Summary by CodeRabbit
Release Notes