Skip to content

feat: kellyParlay() — multi-leg parlay sizing#22

Merged
ianalloway merged 1 commit into
mainfrom
feat/kelly-parlay
Jun 29, 2026
Merged

feat: kellyParlay() — multi-leg parlay sizing#22
ianalloway merged 1 commit into
mainfrom
feat/kelly-parlay

Conversation

@ianalloway

Copy link
Copy Markdown
Owner

Adds kellyParlay() — sizes a multi-leg parlay (accumulator) as a single Kelly bet.

What

Combines each leg's true win probability and American odds into one effective bet (legs assumed independent), then runs the standard Kelly formula against the combined probability and odds. Returns the usual KellyResult plus combinedOdds, combinedDecimal, and trueWinProb.

  • Matches single-leg kelly() for a one-leg parlay.
  • Returns a zero fraction when the combined bet has no edge.
  • Throws on an empty legs array or any out-of-range leg probability.
  • README section + 5 new tests.

Tests

143/143 passing (npm test).

🤖 Generated with Claude Code

Combines each leg's true win probability and American odds into a single
effective bet (legs assumed independent), then runs the standard Kelly
formula against the combined probability and odds.

- returns fraction, combinedOdds, combinedDecimal, trueWinProb + KellyResult
- matches single-leg kelly() for a one-leg parlay
- zero fraction when no edge; throws on empty legs / out-of-range probability
- README section + 5 new tests (143/143 passing)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 27, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f144646ef

ℹ️ 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".

Comment thread src/index.ts
* ]);
* // → { fraction: ..., combinedOdds: ..., trueWinProb: 0.33, ... }
*/
export function kellyParlay(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Build kellyParlay into published dist artifacts

The package entry points resolve to dist/index.js and dist/index.d.ts via package.json, but this commit only adds kellyParlay under src/; rg kellyParlay dist/index.* has no matches in the checked-in build artifacts. Consumers importing @ianalloway/kelly-js from the published package will not have this advertised API at runtime or in TypeScript declarations, so the dist outputs need to be regenerated and committed with the source change.

Useful? React with 👍 / 👎.

@ianalloway
ianalloway merged commit c74f8b7 into main Jun 29, 2026
4 checks passed
@ianalloway
ianalloway deleted the feat/kelly-parlay branch June 29, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants