Skip to content

Add a holder registry endpoint returning each holder's balance split into liquid and staked quantities #846

Description

@Chucks1093

Summary

The updated holders table needs a stakedQuantity field per holder. The existing holders endpoint should be extended to include stakedQuantity and liquidQuantity derived from the staking_positions contract state.

Scope

  • Extend GET /keys/:keyId/holders to include stakedQuantity and liquidQuantity per holder
  • Fetch staking positions from the staking_positions persistent map for each holder via the Soroban RPC
  • Compute liquidQuantity as totalQuantity minus stakedQuantity
  • Cache individual holder staking positions in Redis for 30 seconds
  • Maintain backward compatibility by adding the new fields without removing existing ones

Acceptance Criteria

  • stakedQuantity and liquidQuantity present on every holder record
  • liquidQuantity correctly computed as total minus staked
  • Holders with no stake show stakedQuantity of 0
  • Redis cache used for staking position reads
  • Existing fields unchanged for backward compatibility

ETA: 12 hours


Coordinate on Telegram

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions