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

[Staking] Return APR for a validator somehow #471

Open
hewigovens opened this issue Mar 13, 2021 · 2 comments
Open

[Staking] Return APR for a validator somehow #471

hewigovens opened this issue Mar 13, 2021 · 2 comments
Labels
I8 - Enhancement Additional feature request

Comments

@hewigovens
Copy link

@wpank shared to us how to calculate APR based on chain data, would be great if sidecar implements this

First query for the activeEra:

SIDECAR_URL/pallets/staking/storage/activeEra

Then query for how much is currently staked:

SIDECAR_URL//pallets/staking/storage/erasTotalStake?key1=<ACTIVE_ERA>

Then query for how much total issuance there is:

SIDECAR_URL/pallets/balances/storage/totalIssuance

Then use stakedRate / TotalIssuance as an input for the above function

@dvdplm
Copy link
Contributor

dvdplm commented Mar 14, 2021

I like this idea.

@emostov emostov added I8 - Enhancement Additional feature request P7 - Nice to Have Nice, but not urgent labels Mar 16, 2021
@emostov emostov removed the P7 - Nice to Have Nice, but not urgent label Mar 23, 2021
@emostov
Copy link
Contributor

emostov commented Mar 23, 2021

Given how specific this is in to the relay chain we have decided to hold off on adding this feature for now.

Once #488 is it done, it may make sense to revisit this issue and see if either the maintainers here or a third party might want to a make pluggable version of this functionality.

@emostov emostov closed this as completed Mar 23, 2021
@emostov emostov reopened this Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I8 - Enhancement Additional feature request
Projects
None yet
Development

No branches or pull requests

3 participants