Designing a Digital Asset Market Data System: A Complete Technical Guide from Data Ingestion to Real-Time Display

    In cryptocurrency markets, market data is the most fundamental and critical information layer. This article walks through the full architecture of a production-grade market data system: layered design for ingestion, computation, and delivery; the engineering semantics and pitfalls of core indicators such as last price, 24-hour change, rolling high/low, and market cap; timestamp and data-consistency management; WebSocket-based real-time push strategies; tiered storage and caching; and data-quality safeguards including price-spike validation and multi-source cross-checking. Whether you are building a market data service from scratch or optimizing an existing pipeline, the methodology described here can be applied directly to your architecture.

    Designing a Digital Asset Market Data System: A Complete Technical Guide from Data Ingestion to Real-Time Display

    In the cryptocurrency market, market data is the most fundamental and important information carrier. A typical market data page displays structured data like this:

    1. {
    2. "symbol": "GLMUSDT",
    3. "market_type": "CRYPTO",
    4. "currency": "USD",
    5. "last_price": 0.09359,
    6. "change_24h": 0,
    7. "change_pct_24h": 0.000,
    8. "open_price": 0.09359,
    9. "high_24h": 0.09539,
    10. "low_24h": 0.09119,
    11. "market_cap": 93733100,
    12. "market_cap_rank": 164,
    13. "updated_at": "2026-12-01 19:54:36"
    14. }

    Behind this seemingly simple record lies a full pipeline: data ingestion, cleaning, aggregation, computation, storage, and delivery. This article dissects the technical implementation of a complete market data system from the ground up.

    1. Overall Architecture of a Market Data System

    A production-grade market data system typically adopts a layered architecture:

    1. Ingestion layer: Subscribes to real-time trade and order book data from multiple upstream sources (exchange public APIs, aggregated market data services, on-chain data nodes);
    2. Computation and aggregation layer: Cleans and deduplicates the raw trade stream, then computes derived indicators;
    3. Storage layer: Tiered storage — hot data in in-memory caches, time-series data in a time-series database;
    4. Delivery layer: Pushes incremental updates to clients via WebSocket or long polling;
    5. Presentation layer: Renders market lists, candlestick charts, and detail pages.

    The key goal of layering is decoupling: data sources can be unstable with varying latency, so the ingestion layer must isolate “data arrival” from “data consumption,” ensuring deterministic behavior for upper-layer logic.

    2. Engineering Semantics and Computation Logic of Core Indicators

    Every field on a market data page has a precise engineering definition, and each one is easy to get wrong. Let’s break them down.

    2.1 Last Price

    The last price is generally the price of the most recent trade — not the best bid or ask. Key considerations:

    • With multiple data sources, select the latest by source priority and trade timestamp, to avoid out-of-order data causing prices to jump backwards;
    • For illiquid trading pairs with long gaps between trades, the common industry practice is to display the “last traded price” along with the update time, rather than substituting the order book mid-price — otherwise you produce phantom price movements.

    2.2 24-Hour Change

    The percentage change is computed as:

    1. change_pct = (last_price - open_price_24h) / open_price_24h * 100

    Here open_price_24h is the reference price at the moment 24 hours ago. In practice there are two conventions:

    • Rolling window: Uses the trade price at “current time minus 24 hours” as the baseline. The window slides with time, so both the absolute change and percentage change keep updating;
    • Fixed convention: Uses the opening price at UTC midnight or another fixed point in time, resetting only once per day.

    The sample data — zero change, 0.000% change percentage, and opening price equal to last price — is the typical signature of the fixed convention. You must clearly define the convention and document it; otherwise, the frontend display won’t match what users calculate themselves.

    2.3 24-Hour High and Low

    The high and low depend on the trade records within a rolling window. The implementation typically avoids a full scan on every query, and instead maintains an aggregation structure based on time buckets:

    1. # Aggregate by minute bucket; merge the most recent 1440 buckets on query
    2. buckets = sorted_buckets[:1440]
    3. high_24h = max(b.high for b in buckets)
    4. low_24h = min(b.low for b in buckets)

    When a minute bucket slides entirely out of the 24-hour window, evict it — a low-cost way to maintain rolling indicators.

    2.4 Market Cap and Ranking

    Market cap is conventionally computed as circulating supply × last price:

    1. market_cap = circulating_supply * last_price

    The sample data shows a market cap of roughly $93.73 million and a rank of 164, indicating a mid-to-small cap asset. Two points deserve attention regarding ranking:

    • Circulating supply comes from on-chain data or project disclosures and may lag; different conventions (circulating vs. total supply) lead to different market caps, so the convention should be noted in the UI;
    • Ranking is a full-market sort. It’s best recomputed asynchronously on a schedule (e.g., every minute) rather than sorted in real time on every market update, to keep high-cardinality sorting overhead out of the write path.

    3. Data Consistency and Timestamps

    The updated_at field in the sample is often overlooked, yet it is critical to system trustworthiness. A market data system should distinguish three notions of time:

    • Event time: When the trade actually occurred, as reported by the upstream source;
    • Ingestion time: When your system received the data;
    • Publishing time: When the market data becomes externally visible.

    The differences between these represent end-to-end latency. In practice, monitor the P99 of “publishing time − event time” so that upstream failures or pipeline congestion trigger alerts promptly. Meanwhile, the frontend should degrade the display of stale market data, preventing users from making decisions based on outdated prices.

    4. Real-Time Push Design

    A typical push pipeline for market updates looks like this:

    1. Data source → Ingestion service → In-memory aggregation → Message queue → Push gateway → WebSocket client

    Key design points:

    1. Coalesced writes: High-frequency trading can produce thousands of price changes per second. The push gateway should coalesce updates per trading pair within a time window (e.g., batch the latest snapshot every 100–500 ms), dramatically reducing bandwidth and client-side rendering pressure;
    2. Subscription model: Clients subscribe per trading pair; the server maintains a reverse index of “user → trading pairs” and fans out updates along that index;
    3. Reconnection recovery: On reconnect, the client sends its latest local timestamp, and the server delivers snapshots after that moment rather than the full history — guaranteeing eventual consistency for data missed during disconnection;
    4. Snapshot plus delta: Deliver a full snapshot on first connection, then push only incremental fields afterward, reducing time-to-first-render.

    5. Storage and Caching Strategy

    • Hot data (latest snapshot): Stored in an in-memory or distributed cache, keyed by trading pair, with the value being the serialized market data object. The read path goes entirely through the cache; the database serves only as a fallback;
    • Time-series data (historical trades and minute-level candles): Stored in a time-series database partitioned by time, with downsampling (1 minute → 1 hour → 1 day) to support long-range chart queries;
    • Cold data archival: Historical market data used for backtesting and research can simply be archived into monthly partitions.

    The correct cache update pattern is “write cache first, persist to database asynchronously,” accepting a very small probability of lost writes. Market data is a high-write, brief-inconsistency-tolerant scenario — trading strong consistency for low latency is a sound engineering trade-off.

    6. Fault Tolerance and Data Quality

    The worst failure mode for a market data system is not slowness, but wrongness. Build the following validations into the pipeline:

    1. def validate(tick, prev_tick):
    2. # 1. Price spike check: flag for manual/automatic review if deviation exceeds a threshold (e.g., 50%)
    3. if abs(tick.price / prev_tick.price - 1) > 0.5:
    4. flag_for_review(tick)
    5. # 2. Timestamp regression check
    6. if tick.event_time < prev_tick.event_time:
    7. drop_or_reorder(tick)
    8. # 3. High/low range check: last price must fall within [low_24h, high_24h]
    9. assert tick.low_24h <= tick.price <= tick.high_24h

    Combined with cross-validation across multiple data sources (comparing price deviations for the same trading pair across different upstreams), the system can automatically degrade or circuit-break when an upstream source misbehaves, preventing dirty data from contaminating downstream display and computation.

    7. Summary

    A single, seemingly unremarkable market data record ties together the complete chain of data ingestion, indicator computation, real-time delivery, tiered storage, and data quality control. The core principles of building such a system boil down to four points:

    1. Define indicator conventions explicitly: The change baseline and market cap calculation method must be nailed down at design time;
    2. Layer and decouple: Ingestion, computation, storage, and delivery evolve independently without dragging each other down;
    3. Balance latency and cost: Coalesced writes and snapshot-plus-delta push strategies strike the optimum between real-time responsiveness and resource consumption;
    4. Treat data quality as a first-class citizen: Timestamp monitoring, price spike validation, and multi-source cross-checking are all indispensable.

    Whether you are building a market data display service from scratch or optimizing the market data pipeline of an existing trading system, the methodology above can be applied directly to your architecture design.