Skip to main content

Refresh rates and SLOs

QuantDesk treats the Postgres hub as the canonical cache boundary. APIs read the latest written state, and websockets fan out incremental updates as they arrive.

Expected cadences

SurfaceTypical cadenceNotes
market-stats hub rowEvent-driven, usually sub-30sUpdated by mark, trade, OI, and funding writers
candles1m base writes with rollupsHigher resolutions are rolled up on read
trade fanoutNear real-timeDerived from place_order_v2 fills
newsPoll-drivenDepends on RSS / API provider cadence
reference/perps~15s defaultConfigurable collector interval
data-healthSnapshot at request timeSummarizes collector freshness

Staleness thresholds

Asset classDefault thresholdWhy
Crypto30s24/7 market; prolonged silence is suspicious
TradFi index syntheticsConfigurable, session-awareOff-hours behavior follows market session policy
When a symbol exceeds its freshness threshold, /api/v2/data-health reports it as stale instead of hiding the condition. For TradFi index synthetics, stale evaluation is session-aware: off-hours US500-PERP / US100-PERP rows are not flagged stale by age alone when the cash session is closed.

Client pattern

  1. Load a snapshot with REST.
  2. Subscribe to market_stats_update over Socket.IO.
  3. Reconcile on reconnect by refetching the REST snapshot.
That model avoids using websockets as ledger truth while still keeping the UI current.

Operational notes

  • Collectors write heartbeats into hub_collector_status.
  • Backend health summaries aggregate collector status plus latest market-stat timestamps.
  • Dataset exports capture storage_format, storage_path, checksum_sha256, row count, and export timestamp for reproducibility.