2 Commits

Author SHA1 Message Date
jaxperro 43de3845a7 payouts: exact on-chain resolution timestamps via Etherscan V2 (resolution_time)
CTF ConditionResolution logs, full-range topic query (Alchemy free tier
caps getLogs at 10 blocks), cached forever in resolution_times. Verified:
Brewers Jul-7 market truly resolved 2026-07-08 04:51 — the cached
endDate-metadata res_t was 29h wrong; Kruto's sell provably 365 min
pre-resolution. Key = etherscan_key (gitignored config). Migration of
trust/validate/portfolio onto true res_t queued in HANDOFF.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 18:05: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