Fix buy/lay commission handling for upfront vig#67
Conversation
There was a problem hiding this comment.
💡 Codex Review
Lines 858 to 862 in 5ee54ca
When vig is collected upfront (buy_vig_on_win=False), Lay.placement_cost computes the commission using self.wager, which is the amount risked, rather than the potential win self.payout_ratio * self.wager that _compute_commission expects and that is used when vig is taken on the win. As a result, a lay 4 for $40 is charged commission on $40 instead of the $20 it can win, so players are debited $2 instead of $1 and losses also overstate vig. Every lay bet with upfront vig will overcharge the bankroll by the payout ratio.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_6908b663c9508328991e2235630c54fa