cardano-graphql
cardano-graphql copied to clipboard
"Live Stake" calculation
I've been looking into a way to calculated the "live stake" for a while now and I can't seem to find an obvious way to do it. Having the "Active Stake" is awesome, but lacks real time tracking of stake. This makes it difficult to track a pools real-time saturation level.
I've tried looking into db-sync and while there's a "stake_address" table, I can't see an easy way to lookup the amount against the stake address AND whether that stake address is still delegated to a particular pool (in real-time).
Can you please let me know if you know this is currently possible with the current schema (db-sync) or if this is something that will be implemented in the future?
Thanks!
Agree this is a useful query to make, and one that the client should not need to calculate.
Bump
Quick update: I have an upcoming body of work that is a prerequisite to facilitate this feature. It's an overall improvement in both capabilities and quality when interfacing with cardano-node
Would be very useful to have live stake available from a postgres table in cardano-db-sync...
Here is a query that Smaug pool use with pool.pm: https://gist.github.com/SmaugPool/892f5bc18bf5c6e52245e1b7bd0bed84