1

How can I track rewards for a validator? I've been looking at various resources:

and it seems complicated regarding the 3 things necessary to track:

  • Credit rewards
  • Commission rewards
  • Block rewards

Through the Solana CLI I can clearly see Credit rewards, however, what's the conversion of credits to lamports/SOL? And, if the rewards rate is based on the current inflation of the epoch and the amount staked with the validator per epoch, would I have to track every epoch for credit rewards and add up the values for "total rewards earned"? Or can I use the general "credits": <insert # of credits> returned by solana validators or solana vote-account <insert vote key>?

The goal for ^^ would be to calculate the general number of rewards generated by a validator for ALL STAKE associated with the validator. Validator commission can be computed pretty quickly after that. But, how do block rewards come into play?

Tldr, is there an easy way to compute the rewards a validator has made throughout its lifetime or any resources to point me in the direction of working through those computations manually. Thanks!

1 Answer 1

2

Unfortunately, as you've realized, "credits" are difficult to convert into SOL, and it'll be really tricky to convert those yourself.

You can fetch each block with getBlock https://docs.solana.com/developing/clients/jsonrpc-api#getblock and then check the rewards. If it's the first block in an epoch, you'll see "voting" rewards for each validator there.

Alternatively, since validator rewards are deposited into the vote account, and the vote account is used almost every slot due to votes, you can fetch the lamports in the vote account before and after each epoch boundary by seeing the votes from that vote account.

With getSignaturesForAddress https://docs.solana.com/developing/clients/jsonrpc-api#getsignaturesforaddress, you can see the last transaction before an epoch boundary, and the first one after the epoch boundary, and see the change in lamports in the account between those two.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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