How to get the total stake delegated to a pool using the QueryLedgerStateLiveStakeDistribution API? #393
-
Using the pool
When checking this pool on CardanoScan, it shows it has a total stake of about 67M ADA: https://cardanoscan.io/pool/00000036d515e12e18cd3c88c74f09a67984c2c279a5296aa96efe89 Is it possible to get to this number using the Ogmios APIs? Another thing, on the documentation for this endpoint it says the response is the stake relative to the total stake of the network, but the number on the right keeps changing for each pool:
Based on the docs I was thinking the number on the left would be the total stake on the pool and on the right would be the total stake on the network, but apparently this is not the case. Could you please explain what are each of these numbers? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Try the
These numbers are a numerator and a denominator. The ratio represents the exact relative stake of the pool in the system. If you want the absolute amount, you need to know the circulating supply of Ada. I am actually thinking of removing this query, or more exactly, merge it with the rewardsProvenance one which is more useful and also provides other handy pieces of information. |
Beta Was this translation helpful? Give feedback.
-
One may wonder: but why have such a query to begin with? And to answer that, you have to understand that Ogmios is originally a proxy that provides access to the underlying queries available on the node itself. And until v6, I've been trying to stay faithful to the queries provided by the node/ledger. But truth is that many of them do not make for a great and comprehensible API at all. So from v6.0.0 onwards, I've started altering some of those, sometimes merging two queries into one, etc.. in an attempt to make them more useful. It only recently occurred to me that this particular one was... not so useful. So I'll soon be deprecating it. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the response and clarification @KtorZ, makes perfect sense to me. I am trying the |
Beta Was this translation helpful? Give feedback.
-
It actually just finished running, so took about 25 minutes |
Beta Was this translation helpful? Give feedback.
-
Is your node fully synchronized ? That query does take a bit of time given the number of stake pools, but 25 min sounds a bit excessive. |
Beta Was this translation helpful? Give feedback.
Try the
rewardsProvenance
query.These numbers are a numerator and a denominator. The ratio represents the exact relative stake of the pool in the system. If you want the absolute amount, you need to know the circulating supply of Ada.
I am actually thinking of removing this query, or more exactly, merge it with the rewardsProvenance one which is more useful and also provides other handy pieces of information.