Skip to content

Conversation

golddydev
Copy link
Collaborator

🎯 Implement Pool Historical and SPO endpoints

This PR implements SPO (Stake Pool Operator) historical data endpoints, and SPO Endpoint for single pool's detailed information.

Key Features

New Endpoints Implemented:

  • Pool SPO Information: /pools/{pool_id} - Comprehensive pool details including live stake, delegators, registration and retirement history, etc...
  • Pool Updates: Historical pool registration and retirement transactions
  • Pool Votes: Governance voting history for pools
  • Pool Blocks: Block minting history and statistics

New Data Structures:

  • PoolInfoRest: Complete pool information response structure
  • PoolLiveStakeInfo: Live stake metrics and delegator counts
  • PoolUpdateAction: Enhanced enum for pool update actions (Registered, Deregistered, etc.)

🧪 Testing

  • All existing pool endpoints remain functional
  • New endpoints follow established Blockfrost API patterns
  • Comprehensive error handling for invalid pool IDs

- Introduced  struct to encapsulate live stake data.
- Implemented  method in  to calculate live stake metrics.
@golddydev golddydev marked this pull request as ready for review September 16, 2025 18:32
@golddydev golddydev changed the base branch from golddydev/expand-spo-historical-data to main September 16, 2025 18:32
Copy link
Collaborator

@whankinsiv whankinsiv left a comment

Choose a reason for hiding this comment

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

The REST handlers look good but I would like to see blocks stored in spo_state instead of relying on epoch_state. Please add a config option store-blocks to spo_state with an optional subscription to cardano.block.header and expand HistoricalSPOState to store these hashes.

Copy link
Collaborator

@whankinsiv whankinsiv left a comment

Choose a reason for hiding this comment

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

Just a few more comments about the block related query in epoch_state and a typo in the const definition.

@golddydev golddydev merged commit 0f042c7 into main Sep 18, 2025
2 checks passed
@golddydev golddydev deleted the golddydev/impl-pools-historical-spo-endpoints branch September 18, 2025 16:07
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.

2 participants