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

Support superfluid staking queries #1525

Closed
mattverse opened this issue May 17, 2022 · 5 comments · Fixed by #1539 or #1632
Closed

Support superfluid staking queries #1525

mattverse opened this issue May 17, 2022 · 5 comments · Fixed by #1539 or #1632
Assignees

Comments

@mattverse
Copy link
Member

Background

cref: #1191 (comment)

With superfluid module now being added governance support along with meeting the interface satisfaction, we should now try to integrate the staking query with the superfluid module if possible, if not try creating a conjoined query within the superfluid module to have better support for querying superfluid staked assets.

Suggested Design

Either both approach would suffice:

  • make the existing staking query to support superfluid stakes assets as well
  • Create a new query within the superfluid module

Acceptance Criteria

Goals & criteria for success

  • being able to query staking information with superfluid staking integration
@nghuyenthevinh2000
Copy link
Member

I explore both options and I think that the second options would be better. Here is why?

I first look at staking delegation query

  1. By design, staking delegation query only returns one type of asset:
    https://github.com/cosmos/cosmos-sdk/blob/450cd7fc8708ccb0fa21f05e251d9804a2063b79/x/staking/keeper/querier.go#L464

Changing this would mean expanding staking query to return more assets.

  1. Because of 1, I look at adding delegation query to superfluid. I try out on
    "osmosisd q superfluid superfluid-delegation-by-delegator" first and it returns both superfluid delegation and staking delegation

Screenshot from 2022-05-19 10-46-51

@nghuyenthevinh2000
Copy link
Member

@mattverse @ValarDragon can you confirm my direction?

@mattverse
Copy link
Member Author

@nghuyenthevinh2000 just left a review on the draft PR!

@nghuyenthevinh2000
Copy link
Member

@mattverse @ValarDragon

two interpretations for this issue between me and @hieuvubk:

Context: Person A has staked 100 gamm/pool/1 through superfluid and 20 osmo through normal staking.

  1. Mine will be to combine query from staking module and query from superfluid. The result for querying delegation of A will be like:
  • 100 gamm/pool/1 (equivalent of 50 osmo for example)
  • 20 osmo (get from staking module for example)
  1. @hieuvubk will be to display staked superfluid asset as osmo equivalent. The result for querying delegation of A will be like:
  • 50 osmo (equivalent of 100 gamm/pool/1 for example)

Which interpretation is applied here?

@nghuyenthevinh2000
Copy link
Member

@mattverse @ValarDragon @alexanderbez

I guess that it will be hard to decide, so I have combined @hieuvubk work on osmo equivalent to mine. This is contribution to @hieuvubk

New logic for delegation query will include calculating osmo equivalent of superfluid asset and add it to normal staking:
Screenshot from 2022-06-03 12-55-37

@hieuvubk hieuvubk self-assigned this Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment