Skip to main content

Module dedup

Module dedup 

Source
Expand description

Account-event deduplication, shared across execution clients.

Every client that can be served the same fill twice needs this. Two situations produce a duplicate, and both are ordinary rather than exceptional:

  • A subscription replays on reconnect. A venue that opens a stream with a snapshot of recent activity re-delivers everything in that snapshot each time the socket comes back.
  • Recovery overlaps the stream. A client that refetches fills over a lookback window after a gap will refetch some the stream already delivered, because the window is deliberately wider than the gap.

The cache is keyed on (instrument, id, kind) rather than on the id alone, and DedupKey documents why. It is bounded and LRU, so it degrades by forgetting the oldest event rather than by growing without limit.

This module is exchange-agnostic: it operates on rustrade’s own UnindexedAccountEvent, never on any SDK’s wire types.

Structs§

AccountEventDeduper
A shared, bounded record of the fills already delivered, for a consumer that takes the same fill from more than one source.