2

I am trying to figure out how to write some scripts that will dish out rewards to delegators on my staking pool - I want to get the wallet addresses of delegators, and determine rewards based on the relative amount they have staked (e.g. 5%, 10%, 50%...). Has anyone done this? If so, how? Here is what I tried:

  1. cardano-cli - I tried digging through cardano-cli queries, but I didn't see any relevant queries to what I am trying to do.
  2. blockfrost - using /pools/{pool-id}/delegators, I can get a list of delegators and the amounts they delegated, but these are staking addresses, and I can't do anything with these addresses directly. I can easily calculate relative stake with this based on live_stake value returned. So, I tried /accounts/{stake-address}/addresses with the first delegator stake address, and it returns something like 15 addresses. What do I do with that? How do I know which is the wallet address I want to send rewards to?

5 Answers 5

2

You were onto the right idea, try the blackfrost approach again. After calling /accounts/{stake-address}/addresses endpoint you will see a list of addresses linked to the stake address. Pick any address from that list.

Another approach that should work is using cardano-address. First get all stake addresses:

cardano-address address inspect [ADDRESS]

Then query your cardano-db-sync. Use an INNER JOIN query to map addresses to stake addresses.

1
  • 1
    Aha, lightbulbs are turning on. That is cool, thanks for sharing that. One more depth to delve into. I think the blockfrost may be more straightforward and simpler, but I will keep that in mind. Jan 10 at 21:07
1

What I do is query & grab all the data I need from: https://cardanoscan.io/pool/f8e64037e3917cd7cb94969a5374e11b9e6c939b4b69118a8eb4509f?tab=delegators

And then send whatever I want using cardano-cli. Works like a charm!

3
  • Hmm, this is the same as the blockfrost /pools/poolid/delegators call. It is returning staking addresses. But you say you send money to those addresses no problem? Jan 4 at 13:22
  • I've never heard of or used blockfrost, but yes - you can send money to those addresses in Cardanoscan no problem. I do it everyday and have never enountered an issue.
    – Tygar Pool
    Jan 5 at 2:43
  • 1
    You should check out Blockfrost.io - it's a free RESTful API to call Cardano networks (mainnet or testnet) Jan 12 at 19:07
0

You pick any of the addresses associated with the staking address from the point 2, they are all in the same wallet.

3
  • What do you mean "from the point 2"? Do you mean anything other than the first address? Jan 4 at 13:23
  • This is point 2: blockfrost - using /pools/{pool-id}/delegators, I can get a list of delegators and the amounts they delegated, but these are staking addresses, and I can't do anything with these addresses directly. I can easily calculate relative stake with this based on live_stake value returned. So, I tried /accounts/{stake-address}/addresses with the first delegator stake address, and it returns something like 15 addresses. What do I do with that? How do I know which is the wallet address I want to send rewards to? Jan 5 at 8:44
  • Any of those 15 address will be OK. They are all in the same wallet. Jan 11 at 14:09
0

How do I know which is the wallet address I want to send rewards to?

In theory, any address associated with the staking key will do.

Just a reminder that the address can be mangled, so the owner of the stake rights might not be the same person as the owner of the payment funds.

1
  • I'm not sure the implications of this statement. Does this mean that the address that is returned may not be the address of the staker? That seems at odds to the call, so I don't think that's what you meant. Or what payment funds are you talking about, you mean the funds in the wallet that is staked to my pool? Sorry, I am new to SPO, so I am trying to make sure I understand the answers you are giving. Thanks for replying! Jan 8 at 17:46
0

You can get the wallet address of stake pool operator by using adapools.org. First go the desire pool, then delegators and click on the pool staking address. You will see it. An example can be found here.

1
  • This does not answer the question. The OP was asking for delegators addresses, not the SPO's address.
    – shawnim
    Jan 10 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.