diff --git a/smart_money.py b/smart_money.py index beba1bd8..6035e627 100644 --- a/smart_money.py +++ b/smart_money.py @@ -107,7 +107,7 @@ def leaderboard_candidates(pool): return ranked[:pool] -def closed_exits(wallet, since_ts=0, max_rows=25000, newest_bound=0): +def closed_exits(wallet, since_ts=0, max_rows=4000, newest_bound=0): """{asset: {ts, exit_p, p, iv, cond, title, outcome}} for the wallet's FULLY-CLOSED positions, newest first. `ts` is the close (sell/redeem) timestamp; the exit price is reconstructed from realized P&L over shares @@ -121,7 +121,13 @@ def closed_exits(wallet, since_ts=0, max_rows=25000, newest_bound=0): hold-to-res ceiling back into a scalper's stats). Stops at since_ts, newest_bound (for incremental refresh: rows older than what's already cached), max_rows, or an empty page. Prefer cache.closed_exits — the - incremental cached layer over this raw fetcher.""" + incremental cached layer over this raw fetcher. + + max_rows default 4000 (80 pages) bounds the FIRST backfill: full-history + depth (25k) × 90 sharp wallets stalled the daily pipeline for hours. 4000 + covers the 30d backtest and most of the 180d display window; the cache is + incremental so the horizon extends naturally on later runs, and an extreme + scalper's deepest history just keeps a hold-to-res ceiling (honest).""" out = {} off = 0 while off < max_rows: