Skip to content

Implement GET /api/analytics/protocol#177

Open
icedoutskay wants to merge 1 commit intoCommitlabs-Org:masterfrom
icedoutskay:analyticsProtocol
Open

Implement GET /api/analytics/protocol#177
icedoutskay wants to merge 1 commit intoCommitlabs-Org:masterfrom
icedoutskay:analyticsProtocol

Conversation

@icedoutskay
Copy link

Description

This PR implements the GET /api/analytics/protocol endpoint to provide high-level protocol statistics for the dashboard. It aggregates data across commitments to provide insights into TVL, compliance, and activity status.

Implementation Details

  • Endpoint Path: src/app/api/analytics/protocol/route.ts

  • Logic: Integrated on-chain data querying (and/or caches) to compute the following metrics in a single JSON payload:

  • Commitment Counts: totalCommitments, activeCommitments, violatedCommitments, settledCommitments.

  • Financials/Health: totalValueCommitted (TVL), averageDurationDays, averageComplianceScore.

  • Functionality: Endpoint returns protocol analytics (using current on-chain data/partial mocks where noted).

  • Standardization: Uses the project's shared response format.

  • Performance: Optimized for periodic polling by the frontend dashboard.

This PR closes #119

@vercel
Copy link

vercel bot commented Feb 27, 2026

Someone is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Implement GET /api/analytics/protocol for global protocol stats

1 participant