Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: store validator staking APY in the ValidatorHistoryAccount #9

Open
buffalu opened this issue Dec 19, 2023 · 1 comment
Open

Comments

@buffalu
Copy link
Collaborator

buffalu commented Dec 19, 2023

Is your feature request related to a problem? Please describe.
It's not possible to compute the APY for a validator on-chain, but it should be possible with StakeNet and other contextual information that StakeNet can handle.

Describe the solution you'd like
In each validator's ValidatorHistoryAccount, store the staker APY for the validator given the validators commission, vote credits, epoch length, and any other variables required to compute the epoch. It probably makes sense to just store the current epoch's APY and do some averaging over the last N epochs using the circular buffer.

It may also make sense to add information about historical epochs to this program, such as the epoch start slot, start time, end slot, and end time. It makes sense for the stake_authority to handle as an administrator unless its fields already available on-chain. If there is other information that's needed that isn't available, one can create instructions for those accounts as well.

It may also be desirable to include the validator's MEV in the APY as that may be a significant contributing factor to a validator's staking APY. This can be leveraged by combining #6 with the validator's MEV commission also stored in the validator history account.

@buffalu buffalu changed the title Feature: store validator APYs in the ValidatorHistoryAccount Feature: store validator staking APY in the ValidatorHistoryAccount Dec 19, 2023
@buffalu
Copy link
Collaborator Author

buffalu commented Jan 15, 2024

related #18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant