thesalink

Feeds and staleness

Staleness checks and stale UI states for Thesalink.

Equity feeds pause off-hours. Every read needs a staleness check.

Rule

Check updatedAt against a per-feed max age on every read. If the check fails, mark the row stale and do not show a fresh price or a fresh total.

staleness gate
if (block.timestamp - updatedAt > maxAge) {
  state = STALE;
  price = none; // show badge, not a number
} else {
  state = FRESH;
  value = raw * price / 1e8;
}

UI states

  • Fresh: price, value, and timestamp shown.
  • Stale: badge shown, price blanked, row excluded from fresh totals.
  • Basket stale: shown when any constituent is stale.

Off-hours

About half of stock token trades happen when equity feeds are closed. Treat every off-hours view as stale until the feed updates.

On this page