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?