CoinRoster / slotmachine

fruitgame
0 stars 0 forks source link

Stats page balances and bankroll values are incorrect #38

Closed Patrick-Bay closed 6 years ago

Patrick-Bay commented 6 years ago

Similarly to the issue #37, the stats page contains incorrect bankroll and global balance values in the investments table.

Patrick-Bay commented 6 years ago

This issue will require the investigation of the buildStatsTables function in the stats page script, as well as the accompanying rpc_getInvestmentStats function in the investment plugin.

Total work is estimated to take about 2 hours.

RiskingTime commented 6 years ago

ok please proceed

Patrick-Bay commented 6 years ago

Fix for this issue has been committed (https://github.com/CoinRoster/slotmachine/commit/33cf14690304a69fd145ee38bd64b5503b317fe6), pulled to the development server, and may be tested immediately.

RiskingTime commented 6 years ago

ok, I'll review/test

RiskingTime commented 6 years ago

stats_page

RiskingTime commented 6 years ago

see the image above, I made two withdrawals from the bankroll, looks like the book value may have updated, but the current value did not?

Patrick-Bay commented 6 years ago

That seems to be what's happening. I'll have another look in the investment plugin's rpc_updateInvestorInfo function -- that would be the most likely culprit as that's where deposits and withdrawals are handled.

RiskingTime commented 6 years ago

maybe after straightening out the account level deposits/withdrawals from the bankroll will bring more clarity to the system wide stats page reflection of the bankroll?

Patrick-Bay commented 6 years ago

The latest update (https://github.com/CoinRoster/slotmachine/commit/aba4ce31acd983a83c8e691e8e827d63d299db4d) for this issue has been pulled to the development server and is currently available for testing.

Please note that I applied the same calculation to the amount subtracted from the base value of the investment https://github.com/CoinRoster/slotmachine/blob/aba4ce31acd983a83c8e691e8e827d63d299db4d/node/investment_plugin.js#L997-L998 as issue #37 -- this made sense to me since the global values should simply be a sum of individual account values. However, if this is incorrect we can simply comment out this section of code to prevent this additional calculation (note that the default action further up in the code is to subtract the whole withdrawal amount which is why this step adds it back in).

RiskingTime commented 6 years ago

ok, I will review

RiskingTime commented 6 years ago

in order to confirm that the current value of investments is correct, we need more visibility and/or a way to cross reference, I'm leaving this issue open until we can do this,