Crypto Asset Market Data: Structured Parsing and Risk Control Practices

    This article explains how to treat crypto market data as time-bounded, market-bounded, and quote-bounded financial snapshots rather than simple price values. It covers the calculation logic behind last price, 24-hour change, OHLC data, market capitalization, and rankings; discusses data quality controls such as freshness checks, anomaly detection, and multi-source consistency; and outlines user-facing display principles and a maintainable five-layer engineering architecture for market data services.

    1. Structuring Market Data

    A crypto asset market page may appear to show only price changes, but behind it are multiple stages: market data collection, data cleaning, aggregation, cache distribution, risk identification, and frontend display. For developers, a market data record should not be understood simply as the “current price.” It should be treated as a financial time-series snapshot with clear time boundaries, market boundaries, and quote-currency boundaries.

    Taking a crypto asset market record as an example, common fields usually include:

    • Asset code: uniquely identifies an asset;
    • Trading pair: defines the quote basis of the price, for example, an asset quoted against a stable quote currency;
    • Market type: distinguishes crypto assets, equities, foreign exchange, or other markets;
    • Asset name: a human-readable name for display;
    • Last price: the most recent traded price or aggregated quote at a given time;
    • Quote currency: specifies the price unit;
    • 24-hour change amount: the absolute change between the current price and the reference price 24 hours earlier;
    • 24-hour change percentage: the absolute change as a percentage of the reference price;
    • Open, high, and low prices: key prices within a specified statistical period;
    • Market capitalization: usually estimated from circulating supply and current price;
    • Market cap rank: relative position by market cap or a specific methodology;
    • Update time: when the snapshot was generated or synchronized.

    These fields should be treated as a whole. Discussing “price change” or “price level” without the statistical period, quote currency, update time, and data-source methodology usually lacks sufficient meaning.


    2. Calculation Logic for Key Fields

    2.1 Last Price and Quote Currency

    The last price represents the price corresponding to the latest trade, but engineering implementations must define what “latest” means. Different data sources may use the most recent trade price, the midpoint of the best bid and ask, a weighted average over a fixed time window, or an aggregated price across multiple markets.

    If a page shows an asset price of 0.09359 USD, it means that at the time of the data snapshot, the system provides the latest reference price for the asset using USD as the quote unit. Developers should avoid treating this as a guaranteed executable price across all markets and all moments.

    In server-side data models, price fields should use high-precision decimal types rather than binary floating-point types. Floating-point numbers can produce precision errors when representing decimals, especially for low-priced assets, fee calculations, and return statistics.

    A schematic data structure is shown below:

    1. {
    2. "asset_code": "ASSET",
    3. "quote_currency": "USD",
    4. "last_price": "0.09359",
    5. "updated_at": "2026-12-01T19:51:20Z"
    6. }

    Prices should preferably be transmitted through APIs as strings or fixed-point integers, with precision handling unified in the business layer. For example, prices can be scaled by a fixed number of decimal places before storage to avoid rounding deviations during calculations.

    2.2 24-Hour Change Amount

    The basic formula for the change amount is:

    1. change_amount = current_price - reference_price_24h_ago

    If the current price is 0.09359 and the change amount is positive, the current price is higher than the reference price at the start of the statistical period. If the change amount is negative, the current price is lower than the reference price.

    Note that the “reference price” from 24 hours earlier is not necessarily the price at midnight of a calendar day, nor is it necessarily the opening price of a fixed trading session. A common approach is to use a rolling 24-hour window, meaning the current moment minus 24 hours. This better matches real-time market data systems, but it also requires the data system to have a complete historical series and stable time alignment.

    2.3 24-Hour Change Percentage

    The formula for the change percentage is:

    1. change_percentage = (current_price - reference_price_24h_ago) / reference_price_24h_ago × 100%

    For example, if the change amount is 0.00009989 and the change percentage is 0.107%, the system must ensure that both values follow the same calculation methodology. In actual page display, the change amount and change percentage often differ slightly because of different retained decimal places. Therefore, the backend should retain full precision, and the frontend should perform formatting only at the display layer.

    For change percentage calculations, the following edge cases should also be handled:

    1. When the reference price is zero or missing, division must not be performed directly;
    2. When a newly listed asset lacks historical data from 24 hours earlier, the system should show “insufficient data” rather than output a misleading change percentage;
    3. When data sources are switched, data from different sources and different price methodologies should not be directly concatenated for calculation;
    4. When an obviously abnormal price appears, it should first enter a validation process and must not immediately be used as the change percentage baseline.

    3. Analytical Value of Open, High, and Low Prices

    Open, high, and low prices form the basic price range within a specified period. Suppose an asset has an open price of 0.09349, a high price of 0.09539, and a low price of 0.09119 during the statistical period. The following information can be derived:

    • The current price position relative to the open price;
    • The price fluctuation range within the period;
    • Whether the price is close to a stage high or low;
    • Whether the data contains abnormal jumps;
    • Whether the sensitivity of risk alert models should be increased.

    Amplitude can be used to measure the relative fluctuation of prices within a period:

    1. amplitude = (high_price - low_price) / open_price × 100%

    This indicator cannot represent risk on its own, but it can serve as an important auxiliary signal for observing volatility. For low-priced assets, even a small absolute price change may correspond to a high percentage fluctuation. Therefore, the display layer should present both absolute and relative changes so that users do not focus on only one form of expression.

    In engineering implementations, high and low prices should be maintained based on a strictly defined time window. Common approaches include:

    • Using stream processing to continuously update the current window extremes;
    • Using a time-series database to store raw or aggregated price points;
    • Setting window boundaries for fixed periods;
    • Reinitializing when the window rolls or recalculating extremes from historical data.

    If the system supports multiple periods such as minute, hour, and day at the same time, fields from different periods must not be mixed. For example, a daily open price cannot be directly combined with a rolling 24-hour high price, because this would cause inconsistent statistical methodologies.


    4. Market Cap and Rank Should Not Be Interpreted Simplistically

    Market capitalization can usually be estimated with the following formula:

    1. market_cap = current_price × circulating_supply

    The most easily overlooked part is the definition of “circulating supply.” Different data systems may use different methodologies for locked assets, burned assets, unreleased assets, and cross-chain mapped assets. Therefore, market cap is not a completely static or absolutely precise value; it is an estimate that depends on data rules.

    When a page shows a market cap of approximately ninety million USD and a rank below the top one hundred, the correct interpretation is that the asset falls within the corresponding relative market cap range under the current statistical rules and current price basis. It does not directly indicate the asset’s liquidity, actual trading depth, technical quality, or future returns.

    When designing a market cap module, developers should clearly label the following information:

    • The quote currency used for market cap statistics;
    • The data update time of circulating supply;
    • Whether the market cap is an estimate;
    • The coverage scope of the ranking;
    • The fallback strategy when data is missing or the supply value is abnormal.

    If circulating supply is temporarily unavailable, the system can display “market cap pending confirmation” or hide the ranking field, rather than replacing circulating supply with an unverified total supply.


    5. Data Quality Control for Market Data Services

    The core problem of a market data system is not “whether prices can be obtained,” but “whether trustworthy, explainable, and traceable prices can be provided continuously.” A reliable data quality system should cover at least the following aspects.

    5.1 Time Validity Checks

    Update time is an important basis for determining whether market data is usable. If a record has not been updated for a long time, its price may have lost reference value even if it appears normal.

    Hierarchical statuses can be defined according to business requirements:

    • Normal: the update time is within the allowed delay range;
    • Delayed: the data update time exceeds expectations but has not completely expired;
    • Stale: the maximum tolerated time has been exceeded, and real-time change results should stop being displayed;
    • Recovering: after the data source recovers, the system waits for multiple consecutive valid points to confirm stability.

    Future timestamps and timestamps that are significantly earlier than the current system time should also be validated. Time handling should use a standard time zone for storage, and the frontend should convert display according to the user’s region.

    5.2 Price Anomaly Detection

    Price anomalies may come from data source errors, unit errors, repeated decimal places, extreme trades caused by insufficient liquidity, or collection pipeline delays. Basic detection rules may include:

    • The current price changes beyond a threshold relative to the previous valid price;
    • The current price falls outside a reasonable range around the short-period average;
    • The last price is higher than the high price or lower than the low price;
    • The high price is lower than the low price;
    • The change amount and change percentage cannot validate each other;
    • The product of price and circulating supply deviates too much from the market cap.

    Schematic pseudocode is shown below:

    1. if high_price < low_price:
    2. mark_as_invalid("Invalid price range")
    3. if last_price < low_price or last_price > high_price:
    4. mark_as_suspect("Last price outside range")
    5. if abs(calculated_change_percent - reported_change_percent) > tolerance:
    6. mark_as_suspect("Change percentage validation failed")
    7. if now - updated_at > max_delay:
    8. mark_as_stale("Market data delayed")

    Thresholds should not be hard-coded as a single value. Different assets have different price levels, historical volatility, and trading activity. Anomaly strategies should be dynamically adjusted based on the asset’s own historical characteristics whenever possible.

    5.3 Consistency Handling Across Multiple Data Sources

    When a system has multiple market data input sources, it cannot simply rely on “the last data to arrive.” A unified normalization layer should be established to normalize asset codes, quote currencies, timestamp precision, price decimal places, and volume units.

    For multiple candidate price values, the following strategies can be used:

    • Remove outliers that clearly deviate from the median;
    • Prefer data with a more recent update time;
    • Assign higher weights to data with higher liquidity or credibility;
    • Pause updates and trigger alerts when data divergence is too large;
    • Retain raw data for later auditing and issue tracing.

    6. User-Facing Display and Interaction Principles

    The goal of a market data page is not to create complexity, but to help users understand data accurately. Information should be divided into three layers.

    The first layer displays core status, including last price, quote currency, 24-hour change percentage, and update time. After entering the page, users should be able to quickly judge the price level, short-term direction, and data freshness.

    The second layer displays range information, including open, high, low, amplitude, and trading-related statistics. This layer is suitable for users who want to understand short-period fluctuations.

    The third layer displays foundational indicators, including market cap, rank, circulating supply notes, data methodology, and risk disclosures. This layer helps reduce the risk of users making incorrect judgments based on a single price indicator.

    For color design, directional visual indicators are commonly used for price changes, but information should not be conveyed by color alone. Positive and negative signs, arrows, or text explanations should also be displayed to support different display environments and accessibility needs.

    In addition, price formatting should account for differences in order of magnitude:

    • High-priced assets may retain fewer decimal places;
    • Low-priced assets should retain sufficient precision;
    • Excessive truncation should not cause the direction of price change to conflict with the displayed price;
    • Market cap may use readable unit abbreviations, but the detail page should retain full values or calculation notes.

    7. Engineering Recommendations for a Maintainable Market Data System

    A market data system that can be maintained over the long term can be designed in five layers: collection, processing, storage, distribution, and monitoring.

    7.1 Collection Layer

    The collection layer is responsible for obtaining raw quotes and basic asset information. Its focus is fault tolerance, deduplication, rate limiting, and time synchronization. Raw data should retain key fields as completely as possible, and information should not be discarded prematurely during collection.

    7.2 Processing Layer

    The processing layer is responsible for normalizing asset identifiers, unifying precision, calculating change percentages, maintaining high and low prices, estimating market cap, and performing anomaly detection. This layer should be idempotent so that duplicate messages do not cause cumulative calculation errors.

    7.3 Storage Layer

    Real-time queries and historical analysis usually have different requirements. Real-time data is suitable for low-latency caches or in-memory storage, while historical data is suitable for time-series storage. Regardless of the storage mechanism used, necessary timestamps, source markers, and calculation versions should be retained.

    7.4 Distribution Layer

    The distribution layer is responsible for providing unified data to web pages, mobile clients, or internal services. API responses should include status fields such as normal, delayed, anomalous, or insufficient data, so that callers do not mistake all values as fully trustworthy.

    7.5 Monitoring Layer

    Monitoring should not focus only on whether services are reachable; it should also focus on whether business data is trustworthy. For example:

    • An asset has not been updated for a long time;
    • A large number of assets simultaneously show zero prices;
    • Price fluctuations cluster beyond anomaly thresholds;
    • Market cap rankings change dramatically at scale;
    • Data processing latency continues to rise;
    • The difference between raw data and aggregated results expands.

    When anomalies occur, diagnostic context should be retained, including raw input, calculation results, time window, matched rules, and processing pipeline status, to support rapid troubleshooting.


    8. Conclusion

    Crypto asset market data is inherently financial data with high-frequency changes, strong timeliness requirements, and strong dependency on methodology. Although last price, change percentage, high and low prices, market cap, and rank are all common fields, each field requires clear calculation rules, time ranges, and quality control mechanisms.

    For developers, building market data capabilities should prioritize data consistency, time validity, anomaly identifiability, and calculation traceability. For business users, judgments should not be based solely on a single price or a single change percentage. Only by integrating data sources, statistical periods, display precision, risk status, and monitoring mechanisms can a stable, transparent, and maintainable market data service be established.