Skip to content
Software source code displayed in shallow focus

How do duplicate market-data events distort volume and research features?

Use scoped event identities and sequence-gap controls to distinguish retransmissions from genuinely repeated trades.

The key idea

Receiving the same economic event twice must not make it count as two trades. Feed reconnections, replay and consumer recovery can repeat previously processed records. A reliable dataset needs an explicit identity and correction policy, not a rule that treats matching timestamps or matching prices as sufficient evidence of duplication.

The data assumption

Sequence numbers describe a defined stream or session. They are useful for detecting gaps and retransmissions, but may reset and need not identify one trade globally. A message can contain several updates, and an update can amend or cancel an earlier event. The provider's protocol determines the correct identity, scope and ordering rules.

Preserve raw observations separately from their effect on derived state. This allows a reviewer to see that a retransmission arrived without adding its quantity again. Equal prices and quantities are not proof of duplication: independent market participants can legitimately trade identical amounts at the same instant.

A worked example

Assume a hypothetical feed contract assigns one trade to each sequence number within a named session. Event 401 reports 100 units at $50.00; 402 reports 200 at $50.10; 403 reports 100 at $50.20. Correct volume is 400 and VWAP is $20,040/400 = $50.10.

After reconnecting, event 401 is received again with the same session and event identity. Counting it twice inflates volume to 500, a 25% overstatement, and changes VWAP to $25,040/500 = $50.08. A volume-triggered signal can change even though no additional market trade occurred. An independently identified fourth trade with the same price and size must, however, remain in the dataset.

Practical review and implementation

Define deduplication keys from the feed contract, including session or partition scope where needed. Commit processing progress consistently with durable state updates, retain replay provenance and test recovery between those steps. Monitor missing sequence ranges separately from duplicates. Apply documented correction messages to the affected event rather than either discarding them or counting them as new volume. Rebuild a small sample from raw events to verify that replay produces the same features.

Assumptions and limitations

Transport guarantees do not automatically extend through every external database and downstream calculation. A retained identity set also needs a justified lifetime that covers possible replay. Where the feed lacks stable identifiers, disclose residual ambiguity and measure its effect; aggressive timestamp-based filtering can erase real activity while appearing to improve data quality.

Primary references

Further detail on the underlying concepts and data definitions: