live/sync_webhook.py diffs copybot.paper.json's wallets against the
push-mode webhook's address list (Notify API) and patches add/remove;
wired into deploy_bot.sh. Needs alchemy_notify_token in the gitignored
config.json (dashboard -> Webhooks -> Auth token); skips politely
without it — the 5-min backstop poll covers the gap at poll-speed lag.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The copybot service's custom start command was 'bash start.sh' — a relic
of the scratchpad folder it was first deployed from; builds from the repo
root have no root start.sh, so image rebuilds crashed and Railway kept
serving the years-old image (which is also why start.sh changes never
took effect via redeploy). railway.json now pins the start command;
nixpacks.toml's default no longer points at the retired webhook_receiver.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Setting ALCHEMY_SIGNING_KEY on the worker switches start.sh to webhook
mode: instant copies on POST /alchemy (signature-verified), a 60s
housekeeping heartbeat (settle, feed, summary), and a full backstop poll
every 5 min so a dropped push costs minutes, not a silent miss. Webhook
mode now baselines at boot and publishes an initial feed like poll mode.
No signing key -> classic 60s poll, unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Kruto2027 'Chidekh vs. Janvier O/U 22.5', sold 2026-07-05 11:48 — ten
hours before the sold-leg ledger existed. Reconstructed from the feed's
git history (realized/cash deltas between commits 34476dc and 2ef0e19,
the only open position in that window): net proceeds $53.15, whole-bet
pnl +$11.84.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Operating cheat-sheet (add/remove live wallets, backtest, promote, logs,
deploys, digest, real-money); 8am schedule; follow set points at
copybot.paper.json as source of truth; diagram gains trust.py + rolling
replay; sizing docs reflect the their-bet ceiling (cap/reserve retired);
auto p80 floors; gotcha 9 (endDate rewrites + invalidate deletion);
research numbers updated to the trusted-row era.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stake = class % of equity (drawdown-braked), capped at the signal's own
position size so far (OPEN caps at their fill, ADDs grow with their
position). No sweep, no $250 pin — fills stay within size the market
demonstrably absorbed from the signal itself.
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>
config format matches backtest.json — one entry per wallet:
wallets: [{wallet, name, class: volume|whale, floor?}]
normalize_follow_config expands it into the legacy watchlist/watch/
floors/classes structures (old-format configs like config.live.json
pass through untouched). Volume wallets without an explicit floor get
an auto p80 derived from the data-api at boot (the worker has no cache),
logged and published in the feed. live/deploy_bot.sh = validate ->
preview -> commit -> push -> railway redeploy -> confirm boot.
Promotion workflow: prove a wallet in backtest.json, copy the same
entry into copybot.paper.json, run deploy_bot.sh.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* validate_timing.display_stats adds all_win/all_won/all_lost/all_pnl —
the wallet's record and own P&L over EVERY resolved bet ever cached,
trusted rows only, deduped one-per-market (feeds the dashboard's new
All-Time columns); consensus temp table now built before the pool
* copybot write_feed adds classes {name: volume|whale} so the dashboard
can badge whale-class wallets
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>
Mirror-exits were correct at book level (cash/fees) but invisible per bet:
a fully mirror-sold bet went to 'closed' with pnl null, and a TRIMmed bet
that later resolved subtracted its ORIGINAL cost+fee while ignoring the
sold leg's proceeds — understating whole-bet pnl on the feed.
* _drain_fills links every SELL fill to its bet record
(sold_shares / sold_proceeds, net of taker fee)
* write_feed: full mirror-sell -> pnl = sold_proceeds − cost − entry fee,
plus exit_price; dashboard's existing 'mirror-sold with recorded P&L'
branch picks it up
* settle_resolved: pnl = resolution proceeds + sold leg − original cost −
entry fee (pos.cost is trim-reduced; bet.cost is the original)
Sandbox-tested: TRIM cash+record, TRIM->WIN whole-bet truth, full EXIT
feed reconcile all agree to the cent.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Whale-class wallets bypass min_their_usd and per-wallet floors entirely:
both current whales win ~92% across their ENTIRE book (Stavenson 469-39,
0x4bFb 862-72 all-time trusted; 99.2% last 30d for the whale), so
size-filtering them only costs flow. The 0.95 entry cap stays (execution
guard, validated). Floors removed from the paper config for both.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>