Skip to content

feat: chronical oracle#497

Merged
antoncoding merged 1 commit intomasterfrom
feat/chronicole
Apr 15, 2026
Merged

feat: chronical oracle#497
antoncoding merged 1 commit intomasterfrom
feat/chronicole

Conversation

@antoncoding
Copy link
Copy Markdown
Owner

@antoncoding antoncoding commented Apr 15, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for Chronicle as an oracle vendor for price feeds
    • Feeds from Chronicle now display with vendor-specific metadata, including risk tier, update intervals, and spread information
    • Oracle feed tooltips now dynamically render vendor-specific details and icons
    • Users can access vendor-specific external links to view feed information on the appropriate platform

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
monarch Ready Ready Preview, Comment Apr 15, 2026 0:20am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

Added 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

Cohort / File(s) Summary
Vendor Infrastructure
src/utils/oracle.ts
Added Chronicle vendor enum value, corresponding icon mapping, provider-to-vendor detection logic, and getChronicleFeedUrl() helper function.
Metadata Types
src/hooks/useOracleMetadata.ts
Extended EnrichedFeed type with optional Chronicle-specific fields: riskTier, updateInterval, updateSpread.
Feed UI Components
src/features/markets/components/oracle/MarketOracle/ChainlinkFeedTooltip.tsx, src/features/markets/components/oracle/MarketOracle/FeedEntry.tsx
Updated tooltip to use vendor-aware rendering for asset names, icons, external links, and interval/risk/spread fields; routed Chronicle feeds to Chainlink tooltip handler.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

feature request, ui

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title mentions 'chronical' but the PR adds Chronicle oracle support; this appears to be a typo for 'Chronicle'. The title is vague and doesn't clearly describe the main changes. Clarify the title to 'feat: add Chronicle oracle support' or similar to accurately reflect the feature being added.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/chronicole

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added feature request Specific feature ready to be implemented ui User interface labels Apr 15, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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 provider matching. If scanner emits Chronicle fields with empty/null provider, these feeds will fall back to Unknown.

♻️ 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);
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".
🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 50be305 and 9c8028a.

⛔ Files ignored due to path filters (1)
  • src/imgs/oracles/chronicle.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • src/features/markets/components/oracle/MarketOracle/ChainlinkFeedTooltip.tsx
  • src/features/markets/components/oracle/MarketOracle/FeedEntry.tsx
  • src/hooks/useOracleMetadata.ts
  • src/utils/oracle.ts

@antoncoding antoncoding merged commit 176adfc into master Apr 15, 2026
4 checks passed
@antoncoding antoncoding deleted the feat/chronicole branch April 15, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request Specific feature ready to be implemented ui User interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant