Market Data Parsing and Real-Time System Design for Decentralized Computing Tokens

    This article explores the core market data fields of decentralized computing tokens and details the architectural design of a real-time market data system. It covers the data collection and calculation pipeline, including multi-source aggregation, rolling window calculations, time-series storage, and WebSocket push mechanisms. Additionally, it outlines engineering best practices for ensuring data quality, such as out-of-order processing, outlier filtering, and precision consistency, providing a universal methodology for building reliable crypto market services.

    1. Starting with Typical Market Data

    In the digital asset space, the market data page of any token is backed by a set of structured real-time data. Taking a decentralized computing network token as an example, its market snapshot at a given moment includes the following core fields: trading symbol and pair (e.g., symbol GLM, pair GLMUSDT), market type (CRYPTO), last price of $0.09149, 24-hour change amount of $0.002797, 24-hour change rate of 3.153%, open price of $0.08869, highest price of $0.09368, lowest price of $0.08759, market capitalization of approximately $90.54 million, and a market cap ranking of 168. While these fields may seem simple, they actually constitute the minimal data model for a market system and serve as the foundation for all subsequent indicator calculations and visualization displays.

    2. Interpreting Core Market Data Fields

    1. Last Price and Trading Pair: The last price is the most recent transaction price of the token on a specified trading pair. Trading pairs are typically named in the format of “base currency + quote currency.” GLMUSDT represents a base currency token priced in a stablecoin, which is the mainstream way to convert market data into USD-denominated values.

    2. Open Price and 24-Hour Statistics: The 24-hour change amount and rate generally use the price from exactly 24 hours prior to the current time as the baseline, rather than the open price of a natural calendar day. In the provided example, the open price of 0.08869 and last price of 0.09149 correspond to a gain of approximately 3.153%, indicating a mild upward trend for the token within the statistical window.

    3. Highest and Lowest Prices: The 24-hour high of 0.09368 and low of 0.08759 form a fluctuation range, yielding an amplitude of approximately 6.88%. The amplitude indicator is often used to measure short-term volatility and serves as an important reference for risk control and position management.

    4. Market Cap and Ranking: Market capitalization is calculated as circulating supply multiplied by the last price. With a market cap of approximately $90.54 million and a rank of 168, this is a small-to-mid-cap token. Small and mid-cap assets have relatively limited liquidity, making their prices more sensitive to large individual orders. This is why market cap scale must be considered when interpreting market data.

    3. Market Data Collection and Calculation Pipeline

    A reliable market system typically consists of four layers:

    1. Data Collection Layer: By subscribing to public market APIs of exchanges or aggregation services, it obtains trade streams and order book snapshots. To prevent anomalies from a single data source, multi-source redundancy is usually employed, with each source tagged with a timestamp and sequence number.

    2. Calculation and Aggregation Layer: Based on the trade stream, it calculates the last price, rolling 24-hour high/low, and change rate. The rolling window calculation can be implemented using a sliding window algorithm, as shown in the example below:

    1. def rolling_24h_stats(trades):
    2. cutoff = trades[-1].ts - 24 * 3600
    3. window = [t for t in trades if t.ts >= cutoff]
    4. open_px = window[0].price
    5. last_px = window[-1].price
    6. return {
    7. "high": max(t.price for t in window),
    8. "low": min(t.price for t in window),
    9. "change_pct": (last_px - open_px) / open_px * 100,
    10. }

    3. Storage Layer: Market data is characterized by heavy writes and reads, as well as time-based queries. Time-series databases are typically used to store historical K-lines, paired with caching services to handle high-frequency read requests for hot data like the last price.

    4. Push Layer: Incremental updates are pushed to clients via persistent connections (such as WebSocket). Compared to polling APIs, this significantly reduces latency and server-side pressure.

    4. Data Quality and Engineering Best Practices

    1. Clock and Out-of-Order Processing: When aggregating data across multiple sources, clock deviations and message out-of-order delivery must be addressed. It is recommended to use event time and pair it with a watermark mechanism to discard outdated data.

    2. Outlier Filtering: Individual trades with an excessive deviation (e.g., exceeding several standard deviations of the recent average price) should be flagged or discarded to prevent fake trades from distorting market indicators.

    3. Precision Consistency: Price fields should consistently use high-precision decimal types rather than floating-point numbers to avoid cumulative errors. On the frontend, values should be formatted according to token precision rules.

    4. Degradation and Disaster Recovery: When upstream data sources are delayed or interrupted, the system should degrade to display the last reliable snapshot and clearly mark the update time (e.g., 2026-11-24 14:28:28 as shown in the example) to prevent users from mistaking stale data for real-time prices.

    5. Conclusion

    Market data serves as the “dashboard” of the digital asset world. Understanding the statistical methodology and calculation logic behind each field is a prerequisite for building a reliable market system. Whether dealing with small-to-mid-cap computing tokens or mainstream assets, the market data pipeline shares a high degree of engineering commonality: multi-source collection, rolling window calculation, time-series storage, and real-time pushing. Once developers master this universal methodology, they can quickly build market services to support their own business needs while making more rational judgments through derived indicators such as volatility, amplitude, and market cap ranking.