follow-only backtest book (--follow-only -> portfolio_follow.json, daily-wired): followed-7 replay +312% vs +41% bench — bench crowding was starving the follow set

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jaxperro
2026-07-23 18:49:36 -04:00
parent b962ba9bcc
commit d638ff3abb
3 changed files with 16 additions and 1 deletions
+3 -1
View File
@@ -67,6 +67,8 @@ if p!=b: print(f"[daily] ⚠ class_pct DESYNC: paper {p} != backtest {b}")
PY
echo "[daily] $(date '+%F %T') portfolio: cache-based \$1k book -> portfolio.json"
python3 portfolio.py || echo "[daily] portfolio skipped"
echo "[daily] $(date '+%F %T') portfolio: followed-set-only book -> portfolio_follow.json"
python3 portfolio.py --follow-only --out portfolio_follow.json || echo "[daily] follow portfolio skipped"
echo "[daily] $(date '+%F %T') calibration: live-book vs model, one row/day"
# The number that sizes real money (FINDINGS "The calibration experiment"):
# the measured ratio between the live paper book and the backtest of the SAME
@@ -115,7 +117,7 @@ python3 dashboard.py
mkdir -p history && cp watch_skilled.json "history/watch_$(date '+%Y%m%d').json" 2>/dev/null
echo "[daily] $(date '+%F %T') 7/7 publish (commit + push refreshed outputs)"
PUBLISH="no changes"
git add watch_skilled.json watch_sharps.json conviction_wallets.json dashboard.html portfolio.json copybot.paper.json 2>/dev/null
git add watch_skilled.json watch_sharps.json conviction_wallets.json dashboard.html portfolio.json portfolio_follow.json copybot.paper.json 2>/dev/null
if git diff --cached --quiet 2>/dev/null; then
echo "[daily] no output changes to publish"
elif git commit -q -m "live: daily refresh — skilled + sharp wallets [skip ci]"; then
+12
View File
@@ -57,6 +57,9 @@ GAMMA = "https://gamma-api.polymarket.com"
# python3 portfolio.py --wallets 0xabc,0xdef:whale --days 30 --out /tmp/t.json
_ap = argparse.ArgumentParser()
_ap.add_argument("--wallets", help="comma list of addresses; ':whale' suffix opts into whale class")
_ap.add_argument("--follow-only", action="store_true",
help="replay only the paper bot's follow set "
"(backtest.json entries ∩ copybot.paper.json wallets)")
_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)")
@@ -116,6 +119,14 @@ if _ARGS.wallets:
else:
WALLETS = [{"wallet": w["wallet"], "name": w.get("name", w["wallet"][:10]),
"class": w.get("class", "volume")} for w in _BT.get("wallets", [])]
if _ARGS.follow_only:
# the paper bot's live follow set — names/classes stay from backtest.json
try:
_FSET = {w["wallet"].lower() for w in
json.load(open(os.path.join(HERE, "copybot.paper.json")))["wallets"]}
WALLETS = [w for w in WALLETS if w["wallet"].lower() in _FSET]
except Exception as _e:
raise SystemExit(f"--follow-only: cannot read copybot.paper.json ({_e})")
if not WALLETS:
raise SystemExit("no wallets to replay: create live/backtest.json or pass --wallets")
@@ -695,6 +706,7 @@ def main():
"missed_pnl": round(sum(hypo_pnl(m) for m in missed), 2),
"entry_mode": ENTRY_MODE, "exit_mode": EXIT_MODE,
"mirror_sell_min_p": MIRROR_SELL_MIN_P,
"follow_only": bool(_ARGS.follow_only),
}
json.dump(out, open(os.path.join(HERE, OUT) if not os.path.isabs(OUT) else OUT, "w"),
separators=(",", ":"))
File diff suppressed because one or more lines are too long