Missing Block Timestamps and Candle Integrity

Missing Block Timestamps and Candle Integrity


When a block timestamp is missing, its trades cannot be placed reliably in time-based candles; on BNB Smart Chain, the expected block interval is now 0.45 seconds, but actual timestamps still come from block headers. For treasury reporting, recover the header timestamp before finalising affected candles, or mark those periods incomplete rather than silently assigning estimated times.

  • Bucket trades by the block header’s Unix timestamp, not by block number or indexer arrival time.
  • Recover absent timestamps from canonical block headers; interpolation is an estimate, not accounting evidence.
  • Rebuild every candle touched by a recovered block, including open, high, low, close and volume.

A candle is only as trustworthy as the time assignment behind it. Teams checking recurring BNB Chain transfers may compare activity with a token’s price history; a PooCoin wallet tracker is one way to inspect wallet activity and token prices, but a chart should not replace the event-level records used for treasury reconciliation.

Missing timestamps change which candle receives a trade

A candle aggregates trades within a fixed time window, commonly 1 minute, 5 minutes or 1 hour. For a trade with block timestamp t and interval Δ, the candle start is usually floor(t / Δ) × Δ, with timestamps represented in Unix seconds; price and volume then aggregate from the trades assigned to that interval.

If a data pipeline drops the timestamp, the trade still has a block number and log position, but its candle assignment is unknown. Assigning the previous known timestamp can shift it into an earlier interval, while using ingestion time can place it minutes late during an RPC or indexing backlog. Either choice can distort candle extrema, close price and volume.

BNB Chain’s BEP-619 sets a 0.45-second target block interval, following earlier 1.5- and 0.75-second phases. That cadence is useful for estimating how much data might be affected, but it is not a substitute for reading each header: block production can lag, and timestamp boundaries do not necessarily align with candle boundaries.

Recover the canonical header before rebuilding candles

For each affected trade, retain its block number, transaction index and log index. Query the canonical block header by number with eth_getBlockByNumber and read the returned timestamp; BNB Chain’s JSON-RPC documentation describes its compatibility with the Go-Ethereum API. Convert the hexadecimal quantity to an integer, confirm whether the pipeline stores seconds or milliseconds, then reassign and reaggregate affected trades.

Consider a 5-minute candle beginning at 12:00 UTC. A trade in block 42,000,000 appears in an indexer export with no timestamp, and the next observed block’s timestamp is 12:05:00. Copying that next value moves the trade across the boundary and may change both candle close and volume; the correct header could put it on either side. Rebuild both adjacent candles after recovery.

For large gaps, fetch distinct block numbers in batches supported by the RPC provider, persist the block number, block hash and returned timestamp, and retry missing responses. A hash check helps detect data associated with a different canonical block after a reorganisation. Don’t treat a null, zero or parse failure as a real time; flag it as unresolved and keep the affected candle provisional.

Interpolation is useful for triage, not settlement

Linear interpolation between surrounding timestamps can estimate where a gap lies for a temporary visualisation, but it assumes regular block spacing. Even with a 0.45-second target, a delayed block or a network upgrade makes block-number arithmetic an unreliable clock. Never use an imputed timestamp as proof that a payout occurred in a particular reporting interval.

Keep a timestamp provenance field such as header, estimated or missing, plus a rebuild status. Freeze an accounting export only when every included trade has a recovered header time and the relevant blocks meet the team’s finality policy; make that policy explicit because operational finality and a charting interval answer different questions.

Reconcile price candles with transfer records

A token candle measures observed market trades, not the value or completion of a treasury transfer. For a regular payout run, reconcile transaction receipts and token transfer logs by transaction hash and block, then use the recovered block timestamp to assign the event to the reporting day. Price charts can support valuation, while a wallet tracker such as PooCoin can help inspect the address’s activity; preserve the underlying transaction data for the ledger.

In practice, I would keep an affected interval visibly provisional until header recovery and candle rebuilding finish. The practical tip: persist block number and block hash alongside every indexed trade so a missing timestamp can be repaired without guessing.

Report Page