Include the total stake of an account in queryLedgerState/rewardAccountSummaries #373
inimrod
started this conversation in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is your idea? Provide a use case.
It would be really convenient if we could get a stake account's total stake (ADA balance) across all of its associated utxo addresses.
This piece of data should probably be available via
queryLedgerState/rewardAccountSummaries
perhaps? or wherever more appropriate.Why is it a good idea?
There are many cases where we'd be interested in getting the total stake controlled by an account. Like, for granting tiered perks/services depending on the amount of a user's stake delegated to a pool. Or for distributing pro-rated token rewards.
What is the current alternative and why is it not good enough?
From the currently available queries on Ogmios, the only way I see I can get this info is if I start at the beginning of Shelley era and keep track of all the account balances and rewards earned every epoch.
But obviously this is too tedious and would necessitate dumping all the tracked info into a database. Probably ok if we are really building an entire chain explorer. But quite too much if all we want is to query the node for this bit of info from time to time.
There's always the 3rd party services like blockfrost. But it's still ideal to be able to get this straight from a locally running cardano-node + ogmios, since the node should already have this info.
Beta Was this translation helpful? Give feedback.
All reactions