Commit Graph

408 Commits

Author SHA1 Message Date
copybot[bot] b432167c80 copybot: live paper feed [skip ci] 2026-07-07 06:57:04 +00:00
jaxperro fa9591c379 copybot: follow-set update (deploy_bot.sh) 2026-07-07 02:56:49 -04:00
jaxperro 0de033398a feeds: first truth-scored refresh + refunds counted apart in the replay
The honest 30d backtest: $1k -> $2,538 (+154%), 78W/18L/112R — not the
refund-inflated +8,627%. Sharp list: 33 copy-positive holders under truth
gates; 0x4bFb-whale and ArbTrader no longer qualify (their conviction
records were carried by 50/50 refunds counted as wins). portfolio.py now
reports refunds as R, not L (a scratch is not a loss).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 02:50:46 -04:00
copybot[bot] d84945fc4a copybot: live paper feed [skip ci] 2026-07-07 06:16:20 +00:00
copybot[bot] 0972dfeafb copybot: live paper feed [skip ci] 2026-07-07 06:14:19 +00:00
jaxperro 327513d185 copybot: reconcile_entries — downtime entries become missed bets, not silence
The backtest reads positions (state); the bot reads trades (events). A trade
during downtime was silently baselined away at the next boot — not copied,
not missed, invisible — while the backtest still showed it (2026-07-07:
9 ArbTrader positions opened into the Fly trial-expiry crash-loop appeared
only in portfolio.json's current list). Now every boot + backstop poll
records any unseeded, unheld, unrecorded position that clears the follow
filter as a missed bet (reason 'bot offline'), settled hypothetically like
every other miss. Never copied — the entry is stale by definition. Dust
below risk.min_order_usd is ignored; API failure skips (silence is never
data). Bets that open AND close entirely within downtime stay the
backtest's domain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 02:10:21 -04:00
jaxperro 4941818d51 scoring: chain-truth resolutions overlay — refunds no longer count as wins
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>
2026-07-07 01:55:50 -04:00
copybot[bot] 23c6c44057 copybot: live paper feed [skip ci] 2026-07-07 01:20:46 +00:00
copybot[bot] 45a52433f3 copybot: live paper feed [skip ci] 2026-07-07 01:03:03 +00:00
copybot[bot] a9bbf334c4 copybot: live paper feed [skip ci] 2026-07-07 00:47:56 +00:00
copybot[bot] ea5a4d535d copybot: live paper feed [skip ci] 2026-07-07 00:42:26 +00:00
copybot[bot] 3c86019e9a copybot: live paper feed [skip ci] 2026-07-07 00:31:15 +00:00
copybot[bot] 56fc08cace copybot: live paper feed [skip ci] 2026-07-07 00:24:57 +00:00
copybot[bot] f1142ba184 copybot: live paper feed [skip ci] 2026-07-07 00:10:33 +00:00
copybot[bot] fef30218c1 copybot: live paper feed [skip ci] 2026-07-07 00:05:23 +00:00
copybot[bot] e8b4d31452 copybot: live paper feed [skip ci] 2026-07-06 23:46:43 +00:00
copybot[bot] a96c178400 copybot: live paper feed [skip ci] 2026-07-06 23:36:53 +00:00
copybot[bot] 0b539083c3 copybot: live paper feed [skip ci] 2026-07-06 23:25:16 +00:00
copybot[bot] 15e91aac0f copybot: live paper feed [skip ci] 2026-07-06 22:59:15 +00:00
copybot[bot] 10680a27bb copybot: live paper feed [skip ci] 2026-07-06 22:27:32 +00:00
copybot[bot] 61720467fc copybot: live paper feed [skip ci] 2026-07-06 22:20:09 +00:00
copybot[bot] e5bf65cbbf copybot: live paper feed [skip ci] 2026-07-06 22:12:31 +00:00
jaxperro c2e702ba97 copybot: record the Jul-5 accounting-migration residue as an audited ledger adjustment (+15.45) — ledger_drift is 0 from here
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 18:12:20 -04:00
copybot[bot] 0a29b061a5 copybot: live paper feed [skip ci] 2026-07-06 22:09:41 +00:00
copybot[bot] ba95ea04b2 copybot: live paper feed [skip ci] 2026-07-06 22:07:32 +00:00
copybot[bot] 93a8f880dc copybot: live paper feed [skip ci] 2026-07-06 22:06:48 +00:00
jaxperro dbb48b3ac3 copybot P0 fixes: on-chain settle fallback, exit reconciliation, ledger self-check
Audit 2026-07-06 found the live paper book stuck: 4 of 5 open positions were
50/50 refunds the bot could never settle, and the 5th was a position the
signal had exited a day earlier.

- resolution_price tier 2: CTF payoutNumerators/Denominator via RPC
  (ALCHEMY_RPC_URL env or config alchemy_key). CLOB winner flags never
  populate for operator-resolved in-play markets and never express 50/50
  refunds; the chain records both. Token-id match now precedes outcome-label
  match in tier 1. New bet status: 'refund' (settles at $0.50/share,
  redeems in live mode).
- reconcile_exits(): at boot + every backstop poll, verify the signal still
  holds each copied token (market-filtered data-api queries — no pagination
  cap). Exit requires three AFFIRMATIVE facts (open-positions fetched+empty,
  closed-positions fetched+contains token, market fetched+still trading) —
  an API failure must never read as an exit.
- ledger_drift(): cash-vs-ledger invariant checked every heartbeat, warned
  in the log, published in the feed (ledger_drift / adjustments fields).
  Accumulators no longer round per fill (that drifted cents per trim);
  the feed rounds at render. SELL fills now logged to copybot_fills.jsonl.
- their_positions seed cap 500 -> 2000 (whale books exceed 500).

Dry-run vs a copy of the real stuck state: 4 refunds settled at 0.50,
McCormick mirror-exited at 0.69, drift stable at the known +15.45 residue.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 18:06:42 -04:00
copybot[bot] b46f35bc34 copybot: live paper feed [skip ci] 2026-07-06 21:43:49 +00:00
copybot[bot] 08d8c08b09 copybot: live paper feed [skip ci] 2026-07-06 21:38:50 +00:00
copybot[bot] 79aa29c05a copybot: live paper feed [skip ci] 2026-07-06 21:22:24 +00:00
jaxperro 8958279ee8 cleanup: archive everything the live system no longer touches
- retired-infra/: Railway config, Mac launchd runner, GH-Actions cron
  (worker is Fly.io arn now; Actions cron last fired 2026-07-02)
- live-research/: the June selection experiments (strategy/followability/
  pnl_basket/pnl_focused/backtest_june/clean_test + outputs)
- us-venue/: the scrapped Polymarket-US listability probe (+ its
  env-gated ONLY_CONDS replay filter stays in portfolio.py — generally
  useful for subset replays)
- root sweeps hunt/huntwide/oos/copyback/watch.json -> archive/
- untracked logs/CSVs of dead experiments -> archive/local/ (gitignored)
- READMEs updated: Fly migration, geoblock gotcha, new file map

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 17:18:46 -04:00
copybot[bot] 824f7d7e12 copybot: live paper feed [skip ci] 2026-07-06 21:13:02 +00:00
copybot[bot] d4808ebd1d copybot: live paper feed [skip ci] 2026-07-06 21:11:01 +00:00
copybot[bot] 5e60d15f22 copybot: live paper feed [skip ci] 2026-07-06 20:56:51 +00:00
copybot[bot] 84428f2ab9 copybot: live paper feed [skip ci] 2026-07-06 20:49:14 +00:00
copybot[bot] 580da92d8b copybot: live paper feed [skip ci] 2026-07-06 20:37:44 +00:00
copybot[bot] 10b272f293 copybot: live paper feed [skip ci] 2026-07-06 20:22:19 +00:00
copybot[bot] 852d93d627 copybot: live paper feed [skip ci] 2026-07-06 20:15:04 +00:00
jaxperro 376c836068 deploy_bot: banner-wait parses fly log stamps as UTC (timegm, not mktime)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 16:09:30 -04:00
copybot[bot] 3d34d70e88 copybot: live paper feed [skip ci] 2026-07-06 20:08:33 +00:00
copybot[bot] bfbe7c10c3 copybot: live paper feed [skip ci] 2026-07-06 20:07:21 +00:00
jaxperro b7b1487175 copybot: migrate Railway (US region, geo-blocked) -> Fly.io arn Stockholm
Polymarket geoblocks order placement by IP and Railway ran the worker in a
US region — fine for the paper bot (reads only) but a dead end for going
live. Fly arn (Sweden, unrestricted, ~25ms from the CLOB's eu-west-2
primaries) passes: geocheck VERDICT TRADABLE, pm geoblock blocked:false.

- host/geocheck.py: 3-probe geo-gate verdict (ipinfo, pm /api/geoblock,
  unauth CLOB order POST); --idle keeps a test machine up
- host/start.sh: geocheck at boot (GEOCHECK_ONLY=1 = probe-and-idle test
  mode, no second book-writer); warns loudly if a region is blocked
- fly.toml/fly.Dockerfile: wwf-copybot, single machine, http_service :8080
  for the Alchemy push webhook (now wh_blf4qjjvfdbqs9mc -> fly.dev domain)
- deploy_bot.sh: railway redeploy -> flyctl apps restart + banner wait

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 16:02:06 -04:00
copybot[bot] 90f20ec697 copybot: live paper feed [skip ci] 2026-07-06 20:01:36 +00:00
copybot[bot] 6667018f16 copybot: live paper feed [skip ci] 2026-07-06 19:59:07 +00:00
copybot[bot] d71558dcce copybot: live paper feed [skip ci] 2026-07-06 19:57:25 +00:00
copybot[bot] 833f0d14c7 copybot: live paper feed [skip ci] 2026-07-06 19:05:59 +00:00
jaxperro 139931f150 daily: survive mid-run edits (exec a private copy) + autostash the publish rebase
Run from a mktemp snapshot so committing daily.sh while a run is in flight
can't shift bash's read offset (the 2026-07-06 phantom-syntax-error crash),
and let the publish-step rebase autostash so a dirty tree can't wedge the
auto-push behind the copybot's feed commits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 14:52:01 -04:00
jaxperro a7b782cda8 live: daily refresh — skilled + sharp wallets [skip ci] 2026-07-06 14:50:42 -04:00
copybot[bot] 2544bbe2b6 copybot: live paper feed [skip ci] 2026-07-06 18:45:00 +00:00
jaxperro b7d05b1e5c daily: Discord ping at pipeline kickoff (discord_daily.py --ping)
One plain line when the cache refresh starts, so the end-of-run digest
isn't the only sign of life. Non-fatal if the webhook is missing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 13:22:05 -04:00