-
Notifications
You must be signed in to change notification settings - Fork 111
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
feat: fetch data for "Portfolio by asset type" donut chart #920
base: testnet
Are you sure you want to change the base?
Conversation
@kfastov is attempting to deploy a commit to the LFG Labs Team on Vercel. A member of the Team first needs to authorize it. |
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
I'll do optimizations and some tests (on different accounts) today and then mark as ready |
Hey @kfastov , thanks for the mention! If I may say, looking at the API behavior, all the protocol pair tokens for a given protocol share the same symbol. This are all the count of tokens that use the same symbol filtering by name containing "pair" (ci):
One approach would be displaying a sum of all the tokens for a given protocol under the same symbol (as they are listed in the API). This would make the chart more aligned to the actual portfolio data, as ignoring them altogether would kinda defeat the purpose of the chart. This should be achievable using a map with the symbol as a key and incrementing the balance on each encounter of a userToken with the same symbol. What do you think? @Marchand-Nicolas PD: you can also use my account to test the chart (0x06F17c9e19D91900ac039f60344cECC6494297CBd37BbB9B3618B048a2Ed3633) |
What I aim now is just matching the Argent logic. It seems that Argent portfolio just shows the "free" undeposited tokens, but I agree that it may be counter-intuitive. |
@kfastov Hey, if that is doable, I think that indeed it would be better to take in account tokens that are locked in protocols such as zklend or ekubo |
Thanks for the help, it seems perfectly appropriate to me |
Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
Resolves: #879
Other information
Very inefficient but works.
Example for Nico.strk:
Huge thanks to @joeperpetua who already did all the heavy work in #912 creating the charts and the Argent API service