Commit Graph

2280 Commits

Author SHA1 Message Date
copybot[bot] 1640e2d3e5 copybot: live paper feed [skip ci] 2026-07-13 03:19:59 +00:00
jaxperro e0679a40d9 items 2-4: depth gate + guard validated + clob_user own-fill push
DEPTH GATE (copytrade.book_depth + gate in _handle_their_buy, fitted on
131 book-annotated fills): pre-order, skip if spread>0.08 (market mid-move,
median |slip| ~14%) or ask5c<$50 (dust books mispriced every fill), else
cap the stake at 10% of 5c ask depth (keeps impact <~2%; >20% of depth made
>+2% slip 33-50% likely). Fail-open: a failed book fetch declines to bind.
This is what lets stakes scale — binds mainly on slow-market wallets like
0xbadaf319 (median 23% of depth at $40-100 stakes). config.depth_gate;
paper+live inherit DEFAULT_CONFIG.

GUARD: counterfactuals VALIDATED the 0.05 absolute guard — it sits at the
EV knee (0.05-0.10 moves ≈ breakeven, >0.10 = -20% ROI). No change, comment
records the evidence. (The +9-14% lag-drift tail in deep esports books is a
detection-lag problem the depth gate can't see; RTDS ~1s already addresses
it — protected max_price is the backstop.)

CLOB_USER: UserFillsListener streams our order/trade lifecycle from
ws-subscriptions-clob/ws/user (auth = client.credentials, the SDK's derived
L2 creds; all-markets, no per-market mgmt). A matching order id triggers an
IMMEDIATE resolve_pendings() — in-play holds adopt on match, not on the 60s
tick. Events only TRIGGER; get_order stays the arbiter (2026-07-12
anti-phantom-cash invariant intact). resolve_pendings now re-entrancy-locked
(ws + heartbeat race). 60s poll stays as the fallback; ws failure degrades
to today. Live role only.

Also: sub-$1 BUY amount bumped to the $1 venue minimum (share-flooring
shaved gated $1.00 stakes to $0.99 — 7 of 13 live rejections).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 23:18:54 -04:00
jaxperro f96a0d58c5 backtest: pin Kruto floor 80 to match the live books (comparability)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:56:05 -04:00
copybot[bot] 71d0c25aea copybot: live paper feed [skip ci] 2026-07-13 02:42:37 +00:00
copybot[bot] c671b0e3f4 copybot: live paper feed [skip ci] 2026-07-13 02:32:52 +00:00
copybot[bot] c3dcf2c88e copybot: live paper feed [skip ci] 2026-07-13 02:20:36 +00:00
copybot[bot] 1c34bc105e copybot: live paper feed [skip ci] 2026-07-13 02:19:43 +00:00
jaxperro 4ffe20d6b8 follow set: drop imwalkinghere + demote LSB1, Kruto floor 126.84→80, bench 4
5-day forward sample (101 paper + 31 live copies): imwalkinghere produced
ZERO copies — his flow is 5-min BTC Up/Down markets that resolve faster
than any copy can act, and his missed bets would have LOST $390. LSB1 is
the worst forward performer (−$397, 2-4; misses also negative) → demoted
to backtest.json for re-proving. Kruto: +$736 from TWO copies at the
highest z on the table (19.3) — floor lowered to catch more flow. Bench
adds to backtest for forward proving: Vahan88, 42021, BikesAreTheBikes,
EdwardIN. badaf vindicated (+$310, 6-0 + the 0.001 counterfactual) and
stays; AIcAIc gets a week under RTDS before judgment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:19:27 -04:00
copybot[bot] f77b8b7f85 copybot: live paper feed [skip ci] 2026-07-13 02:18:24 +00:00
copybot[bot] ee905a0144 copybot: live paper feed [skip ci] 2026-07-13 02:16:21 +00:00
copybot[bot] d0e2d9bbda copybot: live paper feed [skip ci] 2026-07-13 02:16:15 +00:00
copybot[bot] b4a8753dd3 copybot: live paper feed [skip ci] 2026-07-13 02:12:11 +00:00
copybot[bot] bafb738ff5 copybot: live paper feed [skip ci] 2026-07-13 02:11:42 +00:00
jaxperro c94588a588 HANDOFF rev 9: RTDS both books, oversell+H3 fixed, clone-guard verified
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:07:13 -04:00
copybot[bot] 562520e508 copybot: live paper feed [skip ci] 2026-07-13 02:07:11 +00:00
copybot[bot] da3b950243 copybot: live paper feed [skip ci] 2026-07-13 02:05:41 +00:00
copybot[bot] fb89f4ec54 copybot: live paper feed [skip ci] 2026-07-13 02:05:07 +00:00
jaxperro 7d20588c6f clone-guard: verify over the git transport (ls-remote), not the REST API
api.github.com is effectively unreachable from the Fly boxes (Bearer 401,
anonymous rate-limited on shared egress) — the guard failed open on every
boot. ls-remote rides the same authenticated smart-HTTP path the clone
itself uses, so it works by construction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:04:40 -04:00
copybot[bot] 3db093a690 copybot: live paper feed [skip ci] 2026-07-13 02:03:22 +00:00
copybot[bot] c4e46c8463 copybot: live paper feed [skip ci] 2026-07-13 02:01:41 +00:00
jaxperro 476c1059c8 overnight batch: H3 cursor fetch, Bearer clone-guard, SDK preflight, 5c drift alarm
- H3 (burst overflow): per-wallet trade cursor + paginated activity fetch
  (up to 5×100, walks back to the last processed timestamp) — a gkmg-scale
  clip burst can no longer scroll past a single newest-100 page. Cursor
  only advances after a fetch; 600s overlap re-serves boundary rows into
  the seen-tx dedupe. offset pagination verified against the data-api.
- clone-guard: Bearer auth (fine-grained PATs reject the 'token' scheme)
  with unauthenticated fallback + 40-hex sanity on the answer — Fly's
  shared egress IPs rate-limit the anonymous path.
- preflight_live.py rewritten for the unified SDK: deposit-wallet auth,
  pUSD collateral, order-book reach, RTDS stream delivery, geo verdict.
- ledger-drift ALARM floor 1c → 5c (4dp fill rounding accumulates pennies
  across 60+ copies; the check stays for real bugs — it caught $15.45 and
  $7.24. The self-heal path keeps its own threshold.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 22:00:41 -04:00
copybot[bot] d6eb7ab2e9 copybot: live paper feed [skip ci] 2026-07-13 01:49:24 +00:00
copybot[bot] a7dd508025 copybot: live paper feed [skip ci] 2026-07-13 01:48:36 +00:00
jaxperro c88618f220 no price floor: min_price 0.01 → 0 (both books), cap stays 0.95
User call 2026-07-13 after a big 0.001 longshot was floor-blocked (the
same band class that blocked the 16x Hive copy at 0.05). Executor's
protected prices now round to 4dp and scale with the price — the old 2dp
rounding zeroed the bound on sub-penny books (BUY never bounds below the
quoted cross; SELL never above the quoted bid; verified at 0.001/0.002).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 21:48:20 -04:00
copybot[bot] 65923f17f2 copybot: live paper feed [skip ci] 2026-07-13 01:39:04 +00:00
jaxperro 8951556e30 FIX: pending-adoption oversell — bounded arbiter + per-token serialization
2026-07-12 phantom-cash incident (+$7.86 book-only, alarms caught it):
overlapping pendings on one token each read the same balance drop via
max(matched, diff) — one real 1.48-share sell booked 3×. No real money
moved wrongly (the CLOB rejects oversells); the book just self-inflated.

Fixes: (1) order's own size caps every adoption fill; (2) the balance
diff is consulted ONLY when the exchange no longer answers for the order
(a definitive killed/0 is final); (3) SELL adoptions cap at book
holdings; (4) ONE outstanding pending per token — engine buy/sell and
exit-retries refuse while the resolver owns a token. Regression suite:
the incident scenario books exactly the real fill; phantoms zero.

Surgery (machine stopped): cash → chain $11.206, the two poisoned bets
corrected from real chain fills (residual adjustment −$0.08), drift 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-12 21:38:35 -04:00
copybot[bot] 308dbf0b4e copybot: live paper feed [skip ci] 2026-07-13 01:32:26 +00:00
copybot[bot] fd41b6c849 copybot: live paper feed [skip ci] 2026-07-13 01:14:40 +00:00
copybot[bot] 8583c9f0c9 copybot: live paper feed [skip ci] 2026-07-13 01:11:24 +00:00
copybot[bot] b2ee1a0a8e copybot: live paper feed [skip ci] 2026-07-12 23:37:23 +00:00
copybot[bot] f8344e5bcd copybot: live paper feed [skip ci] 2026-07-12 23:34:53 +00:00
copybot[bot] d86d5fc874 copybot: live paper feed [skip ci] 2026-07-12 23:33:10 +00:00
copybot[bot] 682f03d59d copybot: live paper feed [skip ci] 2026-07-12 23:30:40 +00:00
copybot[bot] 32143b47ec copybot: live paper feed [skip ci] 2026-07-12 23:28:55 +00:00
copybot[bot] d88e75ce64 copybot: live paper feed [skip ci] 2026-07-12 22:57:21 +00:00
copybot[bot] a0a469a80e copybot: live paper feed [skip ci] 2026-07-12 22:30:04 +00:00
copybot[bot] 74d17b7b85 copybot: live paper feed [skip ci] 2026-07-12 22:19:33 +00:00
copybot[bot] 55d55e667d copybot: live paper feed [skip ci] 2026-07-12 22:19:29 +00:00
copybot[bot] 68ae910dfa copybot: live paper feed [skip ci] 2026-07-12 22:17:24 +00:00
copybot[bot] 21b8eafedf copybot: live paper feed [skip ci] 2026-07-12 22:15:19 +00:00
copybot[bot] 7147b757a1 copybot: live paper feed [skip ci] 2026-07-12 21:56:29 +00:00
copybot[bot] fc28d8bf1d copybot: live paper feed [skip ci] 2026-07-12 21:54:22 +00:00
copybot[bot] 0d4e73c894 copybot: live paper feed [skip ci] 2026-07-12 21:06:16 +00:00
copybot[bot] 7ba03ca1e6 copybot: live paper feed [skip ci] 2026-07-12 21:04:12 +00:00
copybot[bot] 05d18bdd06 copybot: live paper feed [skip ci] 2026-07-12 20:51:37 +00:00
copybot[bot] f080cebe46 copybot: live paper feed [skip ci] 2026-07-12 20:51:30 +00:00
copybot[bot] 39132bdba8 copybot: live paper feed [skip ci] 2026-07-12 20:34:47 +00:00
copybot[bot] 1d65fa4d2f copybot: live paper feed [skip ci] 2026-07-12 20:32:54 +00:00
copybot[bot] 19bfed5b04 copybot: live paper feed [skip ci] 2026-07-12 19:55:24 +00:00
copybot[bot] 04d3662ca3 copybot: live paper feed [skip ci] 2026-07-12 19:32:32 +00:00