Open secretshardul opened 3 years ago
After swaps go through, the second token's balance is updated but the first one's not. This leaves end-users confused.
- Before swap: 0.1 SRM, 0.04 USDC.
- After swap: SRM balance remains 0.1, even though USDC balance is 0.8 now
Likely an RPC node issue with websockets. We might want to instead poll for accounts instead.
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
After swaps go through, the second token's balance is updated but the first one's not. This leaves end-users confused.
Before swap: 0.1 SRM, 0.04 USDC.
After swap: SRM balance remains 0.1, even though USDC balance is 0.8 now