An odds feed can push several hundred messages per second during peak events. The UI only needs to repaint at ~60 fps, so most messages are redundant β but you cannot simply throttle the socket, because a market suspension or a sudden line move has to reach the user instantly.
Two-tier filtering
Split incoming messages into critical (suspensions, settlement, line moves beyond a threshold) and cosmetic (minor price ticks). Critical messages bypass the buffer and render immediately; cosmetic ones coalesce in a frame-aligned batch:
const THRESHOLD_CENTS = 5 ;
function classify ( msg : OddsUpdate ) : 'critical' | 'cosmetic' { if ( msg . suspended || msg . settled ) return 'critical' ; if ( Math . abs ( msg . newPrice - msg .β¦