user1999: 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:

cardano-cli - I tried digging through cardano-cli queries, but I didn't see any relevant queries to what I am trying to do.
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?


user5167: 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!

user5286: 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.

1999: <p>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:</p>
<ol>
<li>cardano-cli - I tried digging through cardano-cli queries, but I didn't see any relevant queries to what I am trying to do.</li>
<li>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?</li>
</ol>
 5167: <p>What I do is query &amp; grab all the data I need from:
<a href="https://cardanoscan.io/pool/f8e64037e3917cd7cb94969a5374e11b9e6c939b4b69118a8eb4509f?tab=delegators" rel="nofollow noreferrer">https://cardanoscan.io/pool/f8e64037e3917cd7cb94969a5374e11b9e6c939b4b69118a8eb4509f?tab=delegators</a></p>
<p>And then send whatever I want using cardano-cli. Works like a charm!</p>
 5286: <p>You were onto the right idea, try the blackfrost approach again. After calling <code>/accounts/{stake-address}/addresses</code> endpoint you will see a list of addresses linked to the stake address. Pick <strong>any</strong> address from that list.</p>
<p>Another approach that should work is using <a href="https://github.com/input-output-hk/cardano-addresses" rel="nofollow noreferrer">cardano-address</a>. First get all stake addresses:</p>
<p><code>cardano-address address inspect [ADDRESS]</code></p>
<p>Then query your <a href="https://github.com/input-output-hk/cardano-db-sync" rel="nofollow noreferrer">cardano-db-sync</a>. Use an <code>INNER JOIN</code> query to map addresses to stake addresses.</p>
