jk-labs-inc / jokerace

contests for communities to run, grow, and monetize.
https://jokerace.io
GNU Affero General Public License v3.0
80 stars 46 forks source link

bug: rewards incorrect on fees to rewards module contest #2228

Closed seanmc9 closed 4 days ago

seanmc9 commented 2 weeks ago

this is what I saw at 1:21pmET, whereas onchain the rewards module had 0.0325 ETH in it

Image

this was correct though (should actually be 0.0325 but it looks like one of the txns didn't make it to our db, so it's correctly reflecting what's in our db at least)

Image

Correct here too.

Image

looks like this is what netbalances is returning in packages/react-app-revamp/hooks/useRewardsTokens/useUnpaidRewardsTokens/index.ts as called in packages/react-app-revamp/components/_pages/Contest/components/RewardsInfo/index.tsx

Image

maybe we just make all of the rewards logic uniform throughout the codebase? so for this it'd be using the logic and framework in packages/react-app-revamp/components/_pages/ListContests/Contest/index.tsx for packages/react-app-revamp/components/_pages/Contest/components/RewardsInfo/index.tsx

seanmc9 commented 2 weeks ago

did a quickfix but it still is buggy bc for example right now when there's 0.0375 ETH of transactions in the rewards module, the landing page is saying 0.04 and the contest page is saying 0.03, we just need these to be consistent and accurate to the db

Image

Image

danglard commented 2 weeks ago

here we see it going to -0.01 after rewards were paid out telegram-cloud-photo-size-1-5084700619847085261-y