From a186d5a83943f604113e09ccf31725907fc18c73 Mon Sep 17 00:00:00 2001 From: jaxperro Date: Wed, 8 Jul 2026 16:55:15 -0400 Subject: [PATCH] =?UTF-8?q?portfolio:=20--bank=20flag=20(and=20backtest.js?= =?UTF-8?q?on=20'bank')=20=E2=80=94=20replay=20any=20starting=20bankroll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $500 Set E 30d: $14,140 (+2728%) vs $1,000's +2103% — smaller books compound purer because 4% stakes hit the their-bet ceilings later. Co-Authored-By: Claude Fable 5 --- live/portfolio.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/live/portfolio.py b/live/portfolio.py index f93fdc91..804d1584 100644 --- a/live/portfolio.py +++ b/live/portfolio.py @@ -44,7 +44,7 @@ import trust _SSL = ssl._create_unverified_context() HERE = os.path.dirname(__file__) -BANK = 1000.0 +# BANK is set after the arg/backtest.json parse below GAMMA = "https://gamma-api.polymarket.com" # ---- interchangeable-wallet replay: live/backtest.json ---------------------- @@ -58,6 +58,7 @@ GAMMA = "https://gamma-api.polymarket.com" _ap = argparse.ArgumentParser() _ap.add_argument("--wallets", help="comma list of addresses; ':whale' suffix opts into whale class") _ap.add_argument("--days", type=int, help="window length (default backtest.json's, else 30)") +_ap.add_argument("--bank", type=float, help="starting bankroll (default backtest.json's, else 1000)") _ap.add_argument("--out", help="output path (default $PORTFOLIO_OUT or portfolio.json)") _ARGS, _ = _ap.parse_known_args() try: @@ -65,6 +66,7 @@ try: except Exception: _BT = {} DAYS = _ARGS.days or int(_BT.get("days", 30)) +BANK = float(_ARGS.bank or _BT.get("bank", 1000.0)) START = time.time() - DAYS * 86400 # rolling: started following DAYS ago CLASS_PCT = {"volume": 0.04, "whale": 0.12, **(_BT.get("class_pct") or {})} BASE_PCT = CLASS_PCT.get("volume", 0.04) # sweep threshold stays on the base class