feat(synth-overlay): balance-aware Kelly position sizing (Closes #31)#36
Closed
MkDev11 wants to merge 1 commit intoentrius:mainfrom
Closed
feat(synth-overlay): balance-aware Kelly position sizing (Closes #31)#36MkDev11 wants to merge 1 commit intoentrius:mainfrom
MkDev11 wants to merge 1 commit intoentrius:mainfrom
Conversation
…ius#31) Add Position Sizing card to the Synth Overlay side panel that calculates the Kelly-optimal bet size for Polymarket binary markets. - content.js: add scrapeBalance() to detect USDC/USD balance from DOM, extend getContext() to include balance field - sidepanel.html: add Position Sizing card with balance input, Kelly side, fraction, recommended size, and EV per dollar fields - sidepanel.css: styles for the new sizing card and balance input - sidepanel.js: implement computeKellySizing() with full Kelly formula for both YES/NO sides, confidence scaling, 20% bankroll cap; add balance persistence via chrome.storage.local; wire sizing into refresh() and updateWithLivePrice() for instant recalculation - kelly.py: Python reference implementation of the Kelly logic for testing - tests/test_kelly.py: 20 tests covering basic behavior, edge cases, cap enforcement, formula correctness, and symmetry
cf42525 to
e7ed495
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(synth-overlay): balance-aware Kelly position sizing
Add Position Sizing card to the Synth Overlay side panel that calculates the Kelly-optimal bet size for Polymarket binary markets.
Closes #31
Summary
Turns the existing edge + confidence signals into a concrete recommended bet size, so users know how much to wager, not just which side. The side panel now includes a Position Sizing card that reads the user's balance (auto-detected from the Polymarket DOM or entered manually), computes the Kelly-optimal fraction for both YES and NO sides, scales by forecast confidence, caps at 20% of bankroll, and displays the recommended position size in USD.
What's new
chrome.storage.local.f* = (b·p_true − (1−p_true)) / bfor both YES and NO sides, picks the +EV side, scales by confidence score, and caps at 20%.Related Issues
Closes #31
Type of Change
Files Changed
balanceTesting
Demo Video
recording-2026-03-11-17-55-37.webm