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

Balances. Balances fetching overhaul. #2821

Open
johnthecat opened this issue Dec 10, 2024 · 0 comments
Open

Balances. Balances fetching overhaul. #2821

johnthecat opened this issue Dec 10, 2024 · 0 comments
Assignees

Comments

@johnthecat
Copy link
Contributor

We've got some technical limitation in current balances fetching mechanism.

  • User can see balances only for current wallet.
  • With a lot of chains balance subscriptions might become a performance bottleneck.

Current idea of refactoring balances is to add priority to subscriptions. We can use 3 priorities:

  • High — accounts in selected wallet in well known chains (polkadot, kusama, etc.). This subscriptions are realtime and uses polkadotjs lib storage subscription mechanism.
  • Medium — accounts is selected wallet from other chains. Balances are fetched using polling once at 1-3 minutes. Also there is transfer event subscription for better UX.
  • Low — all accounts that are not in selected wallet. Balances are fetched using pooling once at 5-6 minutes.

Also model should have methods for balances force update. It can be useful for certain user flows, when user need to see actual balances.

Nice to have:

  • updateAt field in db records for better distribution of balance requests. Older record - higher request priority on app start.
  • Cache cleanup on wallet deletion.
@johnthecat johnthecat self-assigned this Dec 10, 2024
@johnthecat johnthecat converted this from a draft issue Dec 10, 2024
@pgolovkin pgolovkin moved this from Todo to Development in Nova Spektr development Dec 10, 2024
@johnthecat johnthecat moved this from Development to Todo in Nova Spektr development Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant