Skip to content

Conversation

@JIOjosBG
Copy link
Member

@JIOjosBG JIOjosBG commented Dec 19, 2025

Change:

Instead of calculating projected rewards based solely on snapshot data from relayer, now we take into account the current balances from the wallet:

  • balance on whitelisted chains
  • wallet/eth liquidity
  • stk wallet balance

To test

  • Pick random account and import it
  • The values in the extension dashboard should be average from the relayer snapshots and current balance
  • To make sure they are different, you can compare them to the values in the rewards app, as this functionality is not yet deployed there

@JIOjosBG JIOjosBG self-assigned this Dec 19, 2025
@JIOjosBG JIOjosBG added the enhancement New feature or request label Dec 19, 2025
Comment on lines 341 to 348
const currentBalance = Object.entries(this.portfolio.balancePerNetwork)
.filter(([k]) =>
portfolioAccountState.projectedRewards?.result?.supportedChainIds
.map((n) => n.toString())
.includes(k)
)
.map(([, v]): number => v)
.reduce((a, b) => a + b, 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this has a very slim chance of happening in the real world, but what if the user has some rewards network disabled and has balance on that network? Then that will decrease his rewards, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, is there a way to get the balance of disabled network? I do not think this is a big issue, since those live balances are used only for projection and rewardss are not actually decided based on that

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there isn't and yes it's not decided based on that but then users will see a wrong projection at all times because both rewards and the extension will calculate it like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but if we decide to not take into account the current user balance when there is a disabled network will be more inaccurate than taking into account the current balance without the disabled netork

@JIOjosBG JIOjosBG requested a review from PetromirDev December 19, 2025 17:01
@JIOjosBG JIOjosBG requested a review from PetromirDev January 6, 2026 11:14
@JIOjosBG JIOjosBG merged commit 4a4ad71 into v2 Jan 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants