Bust the cached balance-history timeseries for the given account addresses. Called by the Helius on-chain balance webhook for every affected account — the same trigger that busts the point-in-time balance. Per-tx affected addresses are few, so the unbounded fan-out here is not a concern.
OptionaltimeZone?: stringIANA timezone (e.g. "America/Chicago"). Aligns day boundaries and localDate output to this timezone. Defaults to "UTC".
A correlated scalar subquery resolving the latest balance for an address column on the outer query, scoped to the given token,
coalesce'd to 0 when the account has no matching transaction. Each outer row gets its own balance in a single round trip — no in-memory LUT, no separategetMultiplecall.Use it directly as an outer SELECT column (it maps to a
BigNumber), inside an aggregate (coalesce(sum(${balanceColumn}), 0)), or sort by it via the select-list alias (ORDER BY balance). A single-column,LIMIT 1lookup is exactly a scalar subquery, so this replaces the formerLATERALjoin: there is nolatest_balancealias to collide, so multiple balances (different tokens or snapshot times) can sit on the same row.