The cache's won (curPrice>=0.5 at pull) counts 50/50 refunds as wins for
BOTH sides — 521 of 2,128 chain-checked follow-set markets (24%) were
refunds, which is where the whales' 92-100% displayed win rates came from.
- live/payouts.py: resolutions table in cache.duckdb, filled from the CTF
contract's payout vectors (batched+paced JSON-RPC, ~12 calls/s free tier;
resolved rows immutable, unresolved recheck 6h, RPC failures never cached).
truth(cond, asset) -> 1/0/0.5/None; refunds need no asset side.
- validate_timing: every displayed stat (conv/conv30/all-time/realized/copy
replay) settles at truth; refunds count as neither W nor L, P&L is
size*(wp-p)/p; new conv_ref/conv30_ref/all_ref feed fields.
- trust.conviction_record: optional truthfn — the selection gates
(trust_wr/trust_roi) no longer select on refund inflation.
- portfolio.py: replay pays wp (refunds 0.5/share, was 1.0).
- conviction_scan: documented as the (refund-inflated) candidate layer;
final selection re-judges against truth downstream.
Validation: 0x4bFb-whale conv 174-16 91.6% $1.61M -> 34-16 +140ref 68%
$214k, and truth-adjusted all-time P&L now sits within ~16% of lb-api's
PM P&L (was 7x apart); LSB1 (0 refunds) byte-identical, its P&L matches
PM P&L to 0.07%.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
cur_stake = class % of equity (drawdown-braked), then min(their stake):
a copy is never bigger than what the wallet actually bet. No reserve
sweep, no $250 pin — the their-bet ceiling is the liquidity bound now
(fills stay within size the market demonstrably absorbed).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
portfolio.py now replays ANY wallet set over a rolling N-day window
(default 30) instead of the hardcoded four-from-June-1:
* live/backtest.json: {days, stake_cap_usd, class_pct, wallets:[{wallet,
name, class}]} — edit to add/remove/swap wallets; seeded with the paper
bot's current 7-wallet follow set
* class parity with the bot: 'whale' replays EVERY trusted bet at
class_pct.whale of equity; 'volume' replays conviction bets at
class_pct.volume, p80 threshold from PRE-window bets only (no peeking)
* outcomes read through trust.py (trusted rows) so any pasted-in wallet
is scored honestly, not on cache marks
* ad-hoc CLI that leaves the dashboard feed alone:
python3 portfolio.py --wallets 0xabc,0xdef:whale --days 14 --out /tmp/t.json
* fix: open positions with unknown entry time used to sort at t=0 and
drain the bankroll before any historical bet ran; they now queue at the
end (and pre-window entries are excluded)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Once working equity exceeds stake_cap/pct ($6,250 at 4%), surplus cash sweeps
to state["reserve"]/portfolio reserve - banked, never bet, immune to drawdown
- keeping stakes at the $250 level where marketable fills sit inside typical
book depth. Feed/summary gain reserve; realized = cash+exposure+reserve-bank.
June backfill: equity $15,684 (+1468%), $9,185 banked, next stake pinned $250.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
+$2,454 copy P&L, 72.4% conviction win (144-55), $257 avg bet, 2.1h median
lead. Added to bot configs (p80 floor $115.27) + backtest set. June backfill
with him: +2677% (in-sample selection bias + compounding, next stake $1,070 -
treat as a ceiling; depth-aware fills become necessary at these clip sizes).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- guard: by rule, a price BELOW the sharp's fill always passes (strictly
better odds; the symmetric guard once skipped a 0.70->0.51 improvement that
won +$36). Only adverse drift is gated by price_guard_pct.
- entry cap: June sweep (0.75-1.0) peaked at max_entry 0.95 - >95c favorites
added ~23 wins yet lowered final equity (slip+fee eat 1-3% payouts, capital
compounds better elsewhere); deep caps cut real winners. Set in all configs
+ portfolio MAX_ENTRY (env-overridable for sweeps; PORTFOLIO_OUT added).
Canonical June backfill: +716%, 219W/52L, $374 fees.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
max_trade/max_position guards lifted in both paper configs; backtest STAKE_CAP
-> inf. June backfill uncapped: +531%, next stake $252, $195 fees.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Engine default + both bot configs + backtest set to 0 (cap logic stays, opt-in
via risk.max_per_event). June backfill without the cap: +465%, 237 resolved
(202W/35L), 22 missed, $170 fees.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- engine (copytrade): stake_usd() = bankroll_pct x current equity (cash + open
cost basis) - Kelly-style compounding both directions - halved while equity
sits below 80% of its high-water mark; new risk.max_per_event (default 2)
blocks stacking correlated markets on one real-world event (dated-slug prefix
grouping; LSB1 once put 6 conviction bets on a single match).
- copybot: feed/summary report the dynamic stake, stake_pct, event_cap, hwm.
- portfolio backtest mirrors the exact same rule (PCT 4%, clamp $5-$150,
EVENT_CAP 2, brake 80%/half), with per-bet stakes in every table row and a
persistent CLOB slug cache for event grouping. June backfill: +426% vs +168%
flat - compounding amplifies the in-sample month; July live is the test.
Misses fell 62 -> 19 cash-missed (+26 deliberate event-cap skips): smaller
early stakes capture more signals.
- configs: bankroll_pct 0.04, max_trade/max_position 150 (runaway guards),
max_per_event 2.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- portfolio.py: follow set -> the fee-aware copy-positive sharps (Kruto2027,
shisan888, fortuneking) + LSB1; entries pay the 0.03 sports taker fee and a
+0.5%/~90s lag haircut (entry_model); backfilled from June 1; feed exposes
fee_rate/slip/lag_est_s/fees_paid and unreal uses true cost basis.
- copybot.paper.json: same four wallets, p80 conviction floors from the cache
(Kruto $123.08, shisan $704.33, fortuneking $970, LSB1 $231). Fresh $1k state
committed separately by the bot - clean July book.
- host/start.sh + nixpacks: turnkey 24/7 worker for Railway/Fly/VPS - clones
with GITHUB_TOKEN, resumes the committed state, polls 60s, publishes
state+feed+fills back through publish_feed. Replaces the Mac poller.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- copybot: model Polymarket taker fees (V2, since 2026-03-30: shares*rate*p*(1-p),
sports 0.03) on every paper/live fill; track fees_paid in state + feed; settle
P&L nets the entry fee. publish_feed now commits state + fills ledger with the
feed (autostash rebase) so the local poller is the sole state writer.
- validate_timing: copy_pnl/held_pnl are fee-aware -> sharp selection now requires
clearing real copy costs; conv stats + lead profile use resolved bets only.
- conviction_scan/skill: exclude res_t>now rows (early-sold positions in
unresolved markets scored at curPrice - a mark, not an outcome; was ~5% of the
June test window at a 72% pseudo-win rate).
- portfolio: skip unresolved rows (stake used to vanish from equity); missed bets
of kind=open no longer KeyError - mark-to-market hypothetical P&L.
- collect: cap stale refreshes at STALE_CAP=2500/run (bulk-aged pool turned the
daily refresh into a ~40h pull holding the DuckDB lock).
- Actions cron disabled: GitHub ran */5 every ~1.5-2.5h and the 10-min stale
window skipped the rest -> 1 of ~104 qualifying buys copied. launchd --poll 60
is now the runner; workflow stays as manual backstop.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds each followed wallet's cache p80 conviction threshold so the dashboard
can filter LIVE open positions the same way the server does.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Set portfolio.py START to today so the $1k book tracks these wallets from
now forward (clean forward test, no in-sample backfill). Equity resets to
~$1,000; the daily run fills it in as bets resolve.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New portfolio.py replays the followed wallets' conviction bets ($1k/$50,
hold-to-resolution) from cache.duckdb — which has res_t, so capital
RECYCLES at the true resolution time (no client-side clob storms, no
phantom-locked capital) and covers the full bet history (~40 pages, not
the browser's 4). Writes portfolio.json (equity, splits, current/
resolved/missed tables, per-wallet); wired into daily.sh + publish. The
dashboard now renders the top page from this feed (1 request) with the
client-side replay kept as a fallback.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>