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 / Undelegation calculation issue #31

Closed
0xphilipp opened this issue Apr 3, 2023 · 2 comments · Fixed by #32
Closed

Staking / Undelegation calculation issue #31

0xphilipp opened this issue Apr 3, 2023 · 2 comments · Fixed by #32
Assignees

Comments

@0xphilipp
Copy link

0xphilipp commented Apr 3, 2023

I am currently testing some liquid staking tokens and when using cw-multi-test it didnt behave as expected. After a long search I found this change: https://github.com/CosmWasm/cw-multi-test/blame/main/src/staking.rs#L775

I am not sure if this comment and added implementation is correct.

Undelegations should not count to QueryAllDelegations / QueryDelegation

Introduced by #25

@chipshort is this only for specific chains or generally all cosmos chains?

@0xphilipp
Copy link
Author

0xphilipp commented Apr 3, 2023

When looking at Terra and our release of ERIS (a LSD provider)

https://terrasco.pe/mainnet/address/terra10788fkzah89xrdm27zkj5yvhj9x3494lxawzm5qq3vvxcqz2yzaqyd3enk

image

in the state query, we use query_all_delegations which uses the AllDelegations query, it only returns the non-unbonding amount!
https://github.com/erisprotocol/contracts-terra/blob/main/contracts/hub/src/queries.rs#L94

@chipshort
Copy link
Contributor

Hi @0xphilipp. Thank you for reporting this. You are absolutely correct.
I implemented this on someone else's call without checking myself if this is the actual behaviour on chain. I'll create a PR to fix this soon

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

Successfully merging a pull request may close this issue.

2 participants