CardanoSolutions / ogmios

❇️ A WebSocket JSON/RPC bridge for Cardano
https://ogmios.dev
Mozilla Public License 2.0
304 stars 90 forks source link

Possible to list delegators and live stake per pool? #227

Closed bravo-kernel closed 2 years ago

bravo-kernel commented 2 years ago

Hi there,

We are looking to generate a list of all delegators and their live stake for any given pool. Would that be possible using (only) Ogmios or should we turn to other tooling?

Result should be something similar to:

[
  {
        "address": "stake1u8mq54ph49h6fnt9k2wr75lt35mq03apyvd8adk9s3ax7us0htcz8",
        "liveStake": "3666"
    },
    {
        "address": "stake1u8c5kwrsuf706ezy5f9cy9rwnux5g3f93pqpwwtdw30udqc0df500",
        "liveStake": "1720248149"
    }
]
KtorZ commented 2 years ago

There's currently no direct query that does this unfortunately. This could be implemented through the chain-sync protocol however, by monitoring delegation certificates.

I imagine however that it could be easily added upstream in the node which likely already track this information in some form or another.

bravo-kernel commented 2 years ago

Thanks for confirming that this is indeed (currently) not possible.

Are you suggesting a feature request for cardano-node/cardano-cli?

KtorZ commented 2 years ago

More for the networking. The mini protocols are mostly in the lands of ouroboros-network. Provided that the information is available in the ledger. In this case, I think it is, so it's probably just a matter of adding the query.

I can look into it. I think there's indeed value in it.

bravo-kernel commented 2 years ago

That would be very much appreciated. The question pops up all over the place.

Much ❤️