feat: add v2 TVL and Treasury protocol endpoints#11
Open
Conversation
Add 8 new pro-only v2 endpoints for protocol TVL and treasury data:
TVL (tag: TVL):
- GET /api/v2/metrics/tvl/protocol/{protocol}
- GET /api/v2/chart/tvl/protocol/{protocol}
- GET /api/v2/chart/tvl/protocol/{protocol}/chain-breakdown
- GET /api/v2/chart/tvl/protocol/{protocol}/token-breakdown
Treasury (tag: Treasury):
- GET /api/v2/metrics/treasury/protocol/{protocol}
- GET /api/v2/chart/treasury/protocol/{protocol}
- GET /api/v2/chart/treasury/protocol/{protocol}/chain-breakdown
- GET /api/v2/chart/treasury/protocol/{protocol}/token-breakdown
Key details:
- All endpoints marked x-api-plan-only (pro users only)
- TVL key param: all, staking, borrowed, vesting, pool2
- Treasury key param: OwnTokens, all
- currency=tokens on token-breakdown endpoints only
- Full IProtocolMetricsV2 schema with real Aave examples
- New "Treasury" tag added to pro spec
- llms.txt updated with accurate docs and usage examples
Co-authored-by: Cursor <cursoragent@cursor.com>
Deploying api-docs with
|
| Latest commit: |
559a822
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3bedf7ae.api-docs-59g.pages.dev |
| Branch Preview URL: | https://tvl-v2-routes.api-docs-59g.pages.dev |
- Create BetaBadge component (purple, mirrors ProBadge pattern) - Wire BetaBadge into ModernLayout, ClassicLayout, and OperationsListItem - Add beta indicator to sidebar, stacked vertically below HTTP method - Add x-api-beta: true to all 8 v2 endpoints in pro spec - Update llms.txt with Beta markers on all v2 entries Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
defillama-openapi-pro.jsonfor protocol TVL and treasury data (metrics + charts with chain/token breakdowns)llms.txtwith concise documentation, parameter details, and usage examples for all new endpointsNew Endpoints
TVL (tag: TVL):
GET /api/v2/metrics/tvl/protocol/{protocol}— full protocol TVL metricsGET /api/v2/chart/tvl/protocol/{protocol}— TVL time seriesGET /api/v2/chart/tvl/protocol/{protocol}/chain-breakdown— TVL by chainGET /api/v2/chart/tvl/protocol/{protocol}/token-breakdown— TVL by tokenTreasury (tag: Treasury):
GET /api/v2/metrics/treasury/protocol/{protocol}— full protocol treasury metricsGET /api/v2/chart/treasury/protocol/{protocol}— treasury time seriesGET /api/v2/chart/treasury/protocol/{protocol}/chain-breakdown— treasury by chainGET /api/v2/chart/treasury/protocol/{protocol}/token-breakdown— treasury by tokenKey Details
x-api-plan-only: true(pro users only)keyparameter: metric selector for TVL (all,staking,borrowed,vesting,pool2), token filter for Treasury (OwnTokens,all)currency=tokensonly on token-breakdown endpointsIProtocolMetricsV2schema with real Aave examples for both metrics endpointsprefixItems)Test plan
[[]])llms.txtis served correctly with new sectionsMade with Cursor