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

Ability to get delegator rewards and validator commissions #16

Open
blockrewards1 opened this issue Dec 13, 2024 · 1 comment
Open

Ability to get delegator rewards and validator commissions #16

blockrewards1 opened this issue Dec 13, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@blockrewards1
Copy link

Namada RPC doesn't have an endpoint to get a delegator's stake and rewards information. For example, cosmos-sdk has an easy to use API to get this information - /cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/{validator_address}

It would be great to have a similar endpoint in Namada undexer.

@mradkov
Copy link
Member

mradkov commented Dec 13, 2024

This can be accomplished relatively straightforward by:

  1. Modifying the pause/collect info on every epoch rather than how we currently do this (on every 2 epochs) using the undexer-pausable-node, before the node prunes the data. This is needed since the rewards information (https://github.com/anoma/namada/blob/08c16b74c0345542c5a89f5b4d60223ec47a10d9/crates/sdk/src/queries/vp/pos.rs#L106) is not epoched and the function above only displays data relative for the current epoch (and we want historical view).
  2. Find the storage path in order to make an abci query and then store the result in the database once per epoch.
  3. Extend dbQuery and dbRoutes with the necessary API endpoints to serve this info.

@mradkov mradkov added enhancement New feature or request good first issue Good for newcomers labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants