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

bug: First token balance not updated after swap #75

Open
secretshardul opened this issue Aug 22, 2021 · 2 comments
Open

bug: First token balance not updated after swap #75

secretshardul opened this issue Aug 22, 2021 · 2 comments

Comments

@secretshardul
Copy link
Contributor

secretshardul commented Aug 22, 2021

After swaps go through, the second token's balance is updated but the first one's not. This leaves end-users confused.

  1. Before swap: 0.1 SRM, 0.04 USDC.
    image

  2. After swap: SRM balance remains 0.1, even though USDC balance is 0.8 now
    image

@armaniferrante
Copy link
Contributor

After swaps go through, the second token's balance is updated but the first one's not. This leaves end-users confused.

  1. Before swap: 0.1 SRM, 0.04 USDC.
    image
  2. After swap: SRM balance remains 0.1, even though USDC balance is 0.8 now
    image

Likely an RPC node issue with websockets. We might want to instead poll for accounts instead.

@matt-scientist
Copy link

I think this is actually an issue with the useOwnedTokenAccount hook. The account is updated properly in the _OWNED_TOKEN_ACCOUNTS_CACHE by using provider.connection.onAccountChange, but this value isn't propagated to the returned tokenAccount. I've been looking at it for a few hours, but can't figure out how to resolve it

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

No branches or pull requests

3 participants