Skip to content
Alchemy Logo

Timestamps, sequence, and replay

Beta

HyperCore APIs are in beta. Message fields, limits, and behavior may change, including breaking changes. To request access, contact [email protected].

Every data message includes the source block:

  • data.blockNumber: the HyperCore block height.
  • data.blockTime: the block's time in Unix milliseconds.

Fill objects also carry their own time field, in Unix milliseconds.

HyperCore produces blocks every fraction of a second. Event streams (fills) send a message for each block that contains matching fills. Book streams send a market only when it changes, so block numbers skip normally between messages on book streams.

seq is a counter on each subscription. It starts at 1 and increases by exactly one for every data, gap, or book_reset message on that subscription. A skipped value means a message was missed. Use seq, not block numbers, to detect missed messages. See connection lifecycle.

seq resets when you subscribe again, so it identifies position within a subscription, not a position in the chain. To resume, use block numbers.

Fill streams accept fromBlock to replay recent blocks after a reconnect; persist the last processed blockNumber and resubscribe from the next block. Book streams don't replay; their first message is always a fresh snapshot. Replay depth is limited (plan to reconnect within about 60 seconds), and older ranges return a gap message. See replay and recovery.

StreamIdentity
Fill streamstid plus user. Both sides of a trade share one tid.
Book streamsNo deduplication needed: a snapshot replaces state, and diffs apply in seq order.
Was this page helpful?