-
-
Notifications
You must be signed in to change notification settings - Fork 34
01 Fixing calculateDBPMPayouts with Test Functionality #430
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
Conversation
…ting that involves bet fees and bet amounts user balance adjustment.
astrosnat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but why are some of the backend tests failing?
Which ones @astrosnat ? Can you paste the results you are getting? |
|
Whoops, didn't realize results are in the pipeline now. I'll look into this. |
|
Need to fix tests then can merge |
|
Finished this set of features so I'm going to try to merge main back into this branch here above. #438 |
|
/draft |
|
We need to do usability testing on this @astrosnat because I had noted that this may have been superseded by: Basically we should see if it gives us the results we are looking for. |
Works on Local after testing, all tests passed.
Upon further analysing and comparing to 432 which had already been merged into main,
calculateDBPMPayoutsshould be merged and used because:Branch Comparison:
payoutbyratiovscalculatedbpmpayouts1 Structural / Directory-Level Differences
🔹 Only in
calculatedbpmpayoutshandlers/math/payout/*handlers/markets/; exposesDistributePayoutsWithRefund, splits logic further.handlers/math/positions/*security/*(ratelimit.go,headers.go,sanitizer.go+ tests)handlers/users/apply_transaction.goTransactionWin, etc.).README_*.mdfileswpam_current_test.go)🔹 Only in
payoutbyratiohandlers/markets/resolvemarketpayouts.goSelectWinningPositions,AllocateWinningSharePool).handlers/markets/resolvemarketcore.gohandlers/users/updatebalanceafterpayout.gohandlers/math/financials/calculateprofit.draft.go2 Logic Overlap vs. Divergence
payoutbyratiobranchcalculatedbpmpayoutsbranchratio = userShares / totalWinningShares).positionsmath.CalculateValuations_WPAM_DBPM()first, then pays out integer valuations. Also refunds on “N/A” resolutions.handlers/markets/; touches HTTP handler directly.handlers/math/payout/; markets handler merely orchestrates → test-friendly.updatebalanceafterpayout.gomutates balances directly.ApplyTransactionToUser()centralises balance changes & labels them (TransactionWin,TransactionRefund, …).3 What’s Already on
mainhandlers/markets/*).security/*middleware.handlers/math/payout/*separation.