Skip to content

feat(dashboard): add historical oracle-staleness view on protocol detail page - #151

Merged
dubemoyibe-star merged 4 commits into
stenion-lab:mainfrom
Ranjeet2063:feat/historical-oracle-staleness
Oct 7, 2026
Merged

dubemoyibe-star merged 4 commits into
stenion-lab:mainfrom
Ranjeet2063:feat/historical-oracle-staleness

Conversation

@Ranjeet2063

Copy link
Copy Markdown
Contributor

Summary of Changes

Adds a historical oracle-staleness view to the protocol detail page to represent how often a protocol's oracle price feeds have been stale across observed indexer scoring runs.

  • Calculation Logic (dashboard/app/lib/oracle-staleness.ts):

    • Analyzes the protocol's historical score factor breakdowns (oracleSafety factor and sub-signals like priceFreshness).
    • Flags runs with degraded or stale oracle feeds (priceFreshness < 50 or value < 50).
    • Computes the aggregate percentage of stale runs and tracks total stale vs evaluated runs.
  • UI Component (dashboard/components/oracle-staleness-view.tsx):

    • Displays a clean status summary distinct from the current-state status pill/badge.
    • Includes a visual progress bar indicating staleness frequency with adaptive styling (safe, accent, or warn).
    • Explanatory copy clarifying whether prices remained fresh or experienced persistent staleness.
  • Integration (dashboard/app/protocol/[id]/page.tsx):

    • Placed under the notices and before factor breakdown wrapped in a <Reveal delay={0.09}>.
  • Test Suite (dashboard/app/lib/oracle-staleness.test.ts):

    • Verified with 3 comprehensive test cases including empty history, clean runs, and the documented high-staleness scenario (e.g. 93% stale runs).

Closes #132

…ail page

- Calculate historical oracle staleness percentage and counts from past runs
- Add OracleStalenessView component visualizing staleness frequency and run ratio
- Place view on protocol detail page distinct from current-state status pill
- Add unit tests verifying staleness calculation against documented scenarios

Closes stenion-lab#132
Copilot AI balanced review requested due to automatic review settings October 5, 2026 00:54
@vercel

vercel Bot commented Oct 5, 2026

Copy link
Copy Markdown

@Ranjeet2063 is attempting to deploy a commit to the Oyibe's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Ranjeet2063

Copy link
Copy Markdown
Contributor Author

Hi @Jagadeeshftw / maintainers — this PR is ready for review. All implementation is complete. Could you please review when you get a chance? Happy to address any feedback promptly. 🙏

@dubemoyibe-star

dubemoyibe-star commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Hi @Jagadeeshftw / maintainers — this PR is ready for review. All implementation is complete. Could you please review when you get a chance? Happy to address any feedback promptly. 🙏

Hello @Ranjeet2063
I'll review now

@dubemoyibe-star
dubemoyibe-star self-requested a review October 5, 2026 08:13

@dubemoyibe-star dubemoyibe-star left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work but CI is failing on the format step

Run pnpm run format to fix

@Ranjeet2063

Copy link
Copy Markdown
Contributor Author

Formatted with Prettier as requested! The format check in CI should pass cleanly now.

@dubemoyibe-star dubemoyibe-star left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CI still fails but on the build step @Ranjeet2063

Ensure CI is green locally before pushing

Star the repo while you are at it

@Ranjeet2063

Copy link
Copy Markdown
Contributor Author

Hi @dubemoyibe-star — fixed the build step! 🛠️

  1. Fixed the relative module import in app/lib/oracle-staleness.ts (./contract).
  2. Added explicit RiskFactorComponent typing for the component finder callback to eliminate implicit any.

Verified 100% locally with pnpm run format:check, pnpm run lint, pnpm -r build (Next.js Turbopack build + full TypeScript check pass), and pnpm run test (314/314 tests pass cleanly).

Also starred the repo as requested! ⭐ Ready for your review and merge. Thank you!

@dubemoyibe-star dubemoyibe-star left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice Work
Merging!!!!!!!!

@dubemoyibe-star
dubemoyibe-star merged commit 5470e11 into stenion-lab:main Oct 7, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Historical oracle-staleness view

3 participants