#!/usr/bin/env python3 """Generate a self-contained dashboard.html from watch_skilled.json. Embeds the skilled-wallet snapshot (z, out-of-sample z, record, archetype, …) into a sortable/filterable dark dashboard with Polymarket profile links and on-demand live recent-trade lookup (data-api, client-side). Re-runnable — wire into daily.sh so the dashboard refreshes with the watchlist. python3 dashboard.py # -> dashboard.html """ import json import os import time HERE = os.path.dirname(__file__) def archetype(r): if r["avg_entry"] < 0.5: return "value" # longshot / underdog value — the true alpha zone if r["avg_entry"] >= 0.85: return "favorite" # rides near-certain favorites (thin, less copyable) return "balanced" def main(): w = json.load(open(os.path.join(HERE, "watch_skilled.json"))) for i, r in enumerate(w, 1): r["rank"] = i r["arch"] = archetype(r) r["wins"] = int(round(r["win_rate"] * r["n"] / 100)) gen = time.strftime("%Y-%m-%d %H:%M") med_z = sorted(x["z"] for x in w)[len(w) // 2] med_oos = sorted(x["z_oos"] for x in w if x["z_oos"] is not None)[len(w) // 2] n_val = sum(1 for x in w if x["arch"] == "value") n_fav = sum(1 for x in w if x["arch"] == "favorite") data = json.dumps(w) html = HTML.replace("/*DATA*/", data).replace("{{GEN}}", gen) \ .replace("{{COUNT}}", str(len(w))).replace("{{MEDZ}}", f"{med_z:.1f}") \ .replace("{{MEDOOS}}", f"{med_oos:.1f}").replace("{{NVAL}}", str(n_val)) \ .replace("{{NFAV}}", str(n_fav)) out = os.path.join(HERE, "dashboard.html") open(out, "w").write(html) print(f"wrote {out} ({len(w)} wallets)") HTML = r""" Skilled Wallets — Polymarket

Skilled Wallets · Polymarket

{{COUNT}} wallets that beat their own entry prices and held up out-of-sample · generated {{GEN}}

Validated wallets
{{COUNT}}
Median z
{{MEDZ}}
Median OOS z
{{MEDOOS}}
Value / longshot
{{NVAL}}
Favorite-rider
{{NFAV}}
#Wallet zOOS z betswin% avg entryalpha 0.2–0.4 type

How to read it. z = how far the wallet beat the prices it paid (skill; >3 is strong). OOS z = whether that skill held on held-out bets — the gate that separates real edge from luck. Alpha 0.2–0.4 = share of bets in the underdog value zone where research finds real edge concentrates. Value wallets win by beating longshot/mid prices (the copyable alpha); Favorite-rider wallets post high win rates buying near-certain favorites (real but thin, hard to copy). Click any row for live recent trades. Not financial advice — split-half OOS, forward-track before sizing.

""" if __name__ == "__main__": main()