shapeshift / web

ShapeShift Web
https://app.shapeshift.com
MIT License
166 stars 176 forks source link

Cosmos (Balance + Staked amount) not showing when going through assets #1541

Closed Lychbot closed 2 years ago

Lychbot commented 2 years ago

Overview

When accessing Cosmos through the assets tab, balance is different and does not include the staked amount unlike going through the accounts page

References and additional details

Recreation steps:

  1. Connect a wallet to app.shapeshift.com or https://88478440.web-29e.pages.dev/
  2. Go to Assets and search for Cosmos
  3. Compare Cosmos balance via the asset page and accounts, notice that the balance is different and doesn't include the staked amount

Screen Shot 2022-04-21 at 6 19 21 AM

Acceptance Criteria

ATOM balance through the assets page should also balance including the staked amount, same with ATOM balance on accounts page

Screen Shot 2022-04-21 at 7 00 16 AM

Need By Date

No response

Screenshots/Mockups

No response

Ownership

Estimated effort

No response

Sponsor / Stakeholder

No response

Bounty Hunters

DiggyDiggy2 commented 2 years ago

the URLs are likely the reason

Through assets: https://app.shapeshift.com/#/assets/cosmos:cosmoshub-4/slip44:118

Through accounts: https://app.shapeshift.com/#/accounts/cosmos:cosmoshub-4:cosmos1f7c8p4f9q93vz37f2ecz5dq8gqlcej239veet8

gomesalexandre commented 2 years ago

On a related note: https://github.com/shapeshift/web/pull/1479 brings amongst other things some bugfix about inconsistent calculation of the staked amount. In the staking opportunities row, it is defined as "delegations + undelegations" whereas under the asset, the number is purely the staking which gives a different number in case the user has active undelegations.

Whoever is taking this should make sure to have that same consistent calculation in the accounts page.

chxash commented 2 years ago

Working on it

gomesalexandre commented 2 years ago

@chxash I was going to open a new issue for that but I think it can be tackled here at the same time as it's low effort and the same domain: I've noticed that according to #1396, we should only display the staked amount for balance charts. However, we also display it on the price chart:

image

@DiggyDiggy2 can you confirm that this is indeed a bug? We can add a simple check not to display it in case we're in the context of a price chart.

DiggyDiggy2 commented 2 years ago

We should really only display it on the Balance Chart. it should show the total amount of ATOM and then how much of that is staked.

gomesalexandre commented 2 years ago

@DiggyDiggy2 #1548 fixes it, but we're still fishing for a code owner approval on this one - I'll try to get someone to review it today