Real-Time Digital Asset Market Data: An Architecture for Collection, Processing, and Storage

    A practical guide to building a real-time digital asset market data system. It explains how to model a market data snapshot with attention to numeric precision, raw-versus-derived fields, and time semantics; how to choose between polling and streaming collection modes; how to standardize heterogeneous sources and derive indicators in a processing layer backed by a message queue; how to store data with a hot/warm/cold tiering strategy; and how to build observability through monitoring and alerting. Readers will learn a general, layered architecture pattern for turning high-frequency, heterogeneous, and time-sensitive market data into a stable and trustworthy service.

    1. Background: Why You Need a Dedicated Market Data System

    In digital asset trading, “market data” is essentially a high-frequency snapshot of market state. A typical quote record contains basic identifiers (asset code, trading pair, market type), price information (last price, open price, high price, low price), derived indicators (24-hour change amount and change percentage), scale information (market cap, market cap rank), and a timestamp. These fields look simple, but turning them into a stable, real-time, trustworthy service requires a complete pipeline of collection, processing, storage, and presentation.

    In practice, a market data system faces three typical challenges. The first is high-frequency updates: major markets can produce new quotes every second. The second is heterogeneous multi-source data: different sources differ in protocol, field naming, and precision. The third is time sensitivity: the value of market data decays rapidly over time, so latency effectively means error. Around these three points, this article presents a clearly layered and easily extensible technical solution.

    2. Data Modeling: First, Define What “a Quote” Is

    Every system design should start with the data model. Abstracting the fields described above into a generic market snapshot structure lets us ignore specific market differences and focus on data processing itself:

    1. {
    2. "asset_code": "GLM",
    3. "trading_pair": "GLMUSDT",
    4. "market_type": "CRYPTO",
    5. "asset_name": "Golem",
    6. "last_price": 0.08879,
    7. "currency": "USD",
    8. "price_change_24h": 0.0004994,
    9. "change_percent_24h": 0.566,
    10. "open_price": 0.08829,
    11. "high_price": 0.09268,
    12. "low_price": 0.08759,
    13. "market_cap": 88870800,
    14. "rank": 168,
    15. "update_time": "2026-11-24 11:58:39"
    16. }

    Several key conventions are worth emphasizing when modeling:

    • Precision: price fields should not be stored or computed directly as floating-point types. Floating-point errors get amplified indefinitely in financial scenarios; it is better to use fixed-point numbers (such as integers representing the smallest price unit) or a high-precision decimal fixed-point type.
    • Separating derived from raw data: price_change_24h and change_percent_24h are derived values computed from historical prices. The model should retain the raw price series, and derived indicators should be generated uniformly by the computation layer to avoid inconsistent definitions across data sources.
    • Time semantics: update_time represents the business time point of the data, which should be recorded separately from the ingestion time (when the record is written to storage). The difference between the two is the data pipeline latency — one of the core monitoring indicators.

    3. Collection Layer: Polling and Streaming

    Obtaining market data usually relies on two mainstream methods, each suited to different scenarios.

    Polling mode obtains full or incremental snapshots through scheduled API requests. It is simple to implement and easy to scale horizontally, but involves a trade-off between latency and request cost. Too short an interval triggers rate limiting, while too long an interval loses timeliness. In practice, an adaptive strategy is often used: shorten the interval for highly volatile assets and relax it for stable ones. Exponential backoff retry and rate-limit protection must also be implemented to avoid a request storm when a data source becomes unstable.

    Streaming mode continuously receives pushes through a long-lived connection. It offers the best timeliness but places higher demands on connection management, heartbeat keep-alive, and reconnection handling. Key design points include:

    1. Maintain a state machine for each connection (connecting, ready, reconnecting);
    2. Use heartbeat probes to detect dead connections and avoid “zombie connections” occupying resources;
    3. Reconnect with a jittered backoff strategy after a disconnection, to prevent overwhelming the server the moment it recovers;
    4. Deduplicate and correct out-of-order messages in the received sequence.

    Whichever mode is used, the collection layer should be a stateless service, orchestrated and auto-scaled by a container platform. Collection instances are only responsible for fetching data and performing initial validation, then delivering standardized data downstream — thereby decoupling collection from processing.

    4. Processing Layer: Standardization and Metric Derivation

    Field naming, precision, and units often differ across data sources. The processing layer needs to do three things:

    • Field mapping and cleansing: normalize heterogeneous source data into the unified model defined in Section 2, handling missing values and anomalies (such as negative prices or jump data).
    • Metric derivation: compute values such as high/low ranges and 24-hour change percentages from the collected price series. Taking the change percentage as an example, it is essentially the ratio of the current price’s change relative to a base price:
    1. change_percent = (last_price - base_price) / base_price * 100
    • Real-time validation: perform sanity checks on derived results. For example, the high price should be greater than or equal to the last price, and the low price should be less than or equal to the last price. Records that violate these constraints should be intercepted and trigger alerts rather than being written directly to storage and polluting the data.

    It is recommended to implement the processing logic in a stream-computing style, backed by a message queue as a buffer. Here the message queue plays three roles: smoothing traffic spikes, decoupling upstream and downstream, and supporting parallel processing by multiple consumers. The collection layer only needs to guarantee that data is written to the queue, and the processing layer’s consumption capacity can be scaled independently.

    5. Storage Layer: Time-Series Data and Hot/Cold Tiering

    Market data has very distinct read/write characteristics: high-frequency writes, time-ordered appends, and reads primarily within time windows. For these characteristics, a hot/warm/cold tiered storage strategy is recommended:

    • Hot data: recent high-frequency data (such as the last few minutes) kept in an in-memory cache to support real-time display and low-latency queries, with a reasonable expiration time set.
    • Warm data: medium-timespan detailed data stored in a time-series-oriented store, partitioned by time to accelerate range queries and expiration cleanup.
    • Cold data: long-cycle aggregated or archived data written to object storage for low-cost long-term retention, used for offline analysis and replay.

    For presentation-layer aggregate queries (such as candlestick charts for a given time period), pre-aggregation should be done at write time or in scheduled jobs, avoiding large-scale scans at query time. Archiving jobs should be physically isolated from online services to prevent reprocessing of historical data from competing for online resources.

    6. Observability: Making the System “Visible”

    A production-grade market data system cannot do without comprehensive monitoring and alerting. Use a log service to centrally collect runtime logs from each layer, and monitoring and alerting to build a metrics system that covers at least:

    Metric category Focus
    Data latency Difference between collection time and business time; reflects pipeline timeliness
    Collection success rate Request/connection failure rate; identifies data source anomalies
    Data quality Number of validation interceptions; reveals sources of anomalous data
    Resource utilization CPU, memory, and connection counts; supports capacity planning
    Consumer backlog Message queue accumulation; indicates processing-layer bottlenecks

    When latency exceeds the threshold, the success rate drops sharply, or the queue keeps backing up, tiered alerts should be triggered. Reasonable alerting needs a supporting convergence strategy to avoid an alert storm during incidents drowning out key information.

    7. Architecture Summary

    Stringing the layers together, a clear market data flow emerges: the collection layer obtains multi-source data through polling or streaming and performs initial validation, writing to the message queue; the processing layer consumes the queue, completes standardization and metric derivation, writes hot data to the in-memory cache, warm data to the time-series store, and cold data to object storage; the presentation layer reads and renders from the cache and the time-series store; and the observability system monitors timeliness and quality across the entire flow. Each layer is deployed stateless on a container platform and scaled elastically on demand.

    Back to the original question: the core value of a market data system does not lie in any specific data source, but in turning high-frequency, heterogeneous, and time-sensitive data into a stable and trustworthy service capability. Once you master this general paradigm of data modeling, layered collection, stream processing, hot/cold storage, and end-to-end monitoring, you can quickly build a rigorous and easily evolving architecture for any real-time data scenario — which is the core idea this solution aims to convey.