4 Commits

Author SHA1 Message Date
jaxperro cc44667b7e cache schema v2: token-keyed upsert archive, provenance, raw prices, honest failures
- bets table gains asset (token id = position identity), src/ts (endpoint
  provenance + close time), resolved (False = early-sold in an unended market;
  won is a curPrice mark). Auto-migrates v1 in place (~8s, 3,697 exact dupes
  merged); legacy rows carry NULLs until their wallet refreshes.
- refresh is now an upsert by token instead of a wallet wipe: rows sliding out
  of the rolling pull window survive, so per-wallet history accumulates into a
  permanent archive. Same-asset rows from both endpoints (partially-closed
  positions) dedupe to the larger-stake row - kills the two-endpoint
  double-count class (~35k suspect pairs found in the audit).
- p stored raw (0 = avgPrice missing), clamped on read by get_bets, so missing
  prices stay distinguishable from real 0.1c longshots; insider CLI + oos clamp
  their own direct use.
- resolved_bets(strict=True): a failed page raises instead of returning a
  silently truncated history; get_bets no longer caches or marks failed pulls
  (pre-v2 an API error cached the wallet as empty-and-fresh for 14 days -
  Kruto2027 was a live victim of this last night).

Verified: migration 18,289,320 -> 18,285,623 rows; forced refreshes of two
sharps show 0 same-asset dups, 0 legacy/new mixing, clamped reads, conviction
stats intact (Kruto conv win 73%).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 09:26:41 -04:00
jaxperro 34d02956d8 Archive dead-end strategies; add FINDINGS.md write-up
Moved the 8 tested-and-failed strategy tools into archive/ (copytrade, backtest,
edge_research, lookback, table_77, lp_screener, lp_paper, xarb) with an
archive/README explaining each. Root now holds the keepers: insider.py (made
self-sufficient — dropped the copytrade load_json dependency) and smart_money.py
(data foundation). New FINDINGS.md is the honest scorecard: six systematic
public-data edges all efficient/illusory, the win-rate survivorship-bias
finding, and the one real signal (z-score improbability + funding clustering).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 13:09:56 -04:00
jaxperro 93b0c8c94e insider.py: implement funding-cluster ring detection via Alchemy
Pulls each wallet's USDC funding history (alchemy_getAssetTransfers, full
history, no 10k-block cap) and links wallets sharing a funder = likely same
operator. Critical refinement: a shared funder only counts if its OWN outbound
degree is small (personal hub <=15 recipients); exchanges/bridges fan out to
hundreds and must be excluded or everything false-links. Verified: the 10
watchlist wallets shared 11 infra funders (Coinbase-style) and looked like one
ring until the degree filter correctly cleared them to independent.

Runs automatically after --market/--scan when alchemy_key is in config.json
(gitignored). README updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 13:05:57 -04:00
jaxperro e1ee7d13e7 Add insider/sharp detector (insider.py) — the one real edge signal
Replicates the Bubblemaps / 60 Minutes per-wallet insider methodology on the
public data API:
- Improbability z-score / p-value: wins vs the wins entry odds imply (beating
  the market's own pricing) — the rigorous edge metric the project was after,
  unlike biased win-rate or variance-driven PnL
- Pre-resolution timing, fresh-wallet (/traded count), sizing signals
- Scoring GATED by improbability so losing sports bettors (entering <24h before
  a game is normal) no longer false-flag
- Modes: --scan leaderboard, --market <conditionId|slug> (score a market's
  traders, the Bubblemaps approach), --wallet deep profile

Findings: leaderboard has no extreme insiders (max z~2.3, high-vol sharps);
scanning a market's traders surfaces real edges (e.g. arimnestos z=4.0 p~3e-5
over 2205 bets). Funding-cluster linking needs a Polygonscan/Alchemy key
(public RPC getLogs capped at 10k blocks). README documents methodology +
the project-wide conclusion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-13 12:51:28 -04:00