-
Notifications
You must be signed in to change notification settings - Fork 23
Refactor/ Merge defi and portfolio ctrl, remove most of selectedAccount's logic #1980
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
Batched 2 txns on Base with the first accounts, open the dashboard banner, but a pending to be signed transaction from other accounts is being show. We have to check if this is an issue with this PR or already existing ones. 2026-01-18.13-10-44.mp4 |
jordan-enev
approved these changes
Jan 19, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How it used to work:
In the portfolio and defi positions controllers:
call to Velcro for hints → Deployless → call to Cena for asset prices.In the selected account controller
In the meantime, the selectedAccount controller listens for updates from both controllers. Its job is to combine the state from DeFi and the portfolio, which is a tedious task because:
The biggest problem in the described flow is that this logic has to be executed on every controller update. This turned out to be expensive for large accounts, which led us to implement caching.
How caching works:
This was needed because every network update resulted in a recalculation of the entire state. Imagine a user with 12 networks, where each network emits once in both controllers, resulting in 24 recalculations of the state.
How it works now:
Closes https://github.com/AmbireTech/ambire-app/issues/3971
Closes https://github.com/AmbireTech/ambire-app/issues/5842