Crypto Market Data Fields Explained: Engineering Practices for Reliable Quotes
Market data may look like a few numbers, but reliable systems must handle data definitions, time semantics, precision, collection stability, and compliance boundaries. This article explains the fields in a crypto asset quote snapshot, including last price, change, change percentage, open, high, low, market cap, market cap rank, and update time. It covers basis conventions, amplitude and range position, market cap estimation, UTC time semantics, validation rules, collection and storage architecture, and metric calculation examples. The methods can be adapted to equities, FX, commodities, and other market data scenarios.
1. Background and Problem Definition
Market data may look like just a few numbers, but from an engineering perspective it involves data definitions, time semantics, precision handling, collection stability, and compliance boundaries. A typical quote record usually contains the asset symbol, quote currency, last price, change, change percentage, open price, high price, low price, market cap, market cap rank, and update time. If these fields are displayed as-is, inconsistent definitions, time zone errors, or delayed data can lead to misjudgment.
This article discusses a quote snapshot for a crypto asset. The fields are explained according to common industry definitions, and all example values are fictitious. Readers can apply the methods here to other market data scenarios such as equities, FX, and commodities.
2. Meaning and Calculation Conventions of Core Fields
| Field | Common meaning | Typical calculation | Engineering notes |
|---|---|---|---|
| Last price | Price of the most recent trade or most recent quote | Taken from matching or aggregation results | Must record the data timestamp alongside it |
| Change | Absolute change of the last price relative to a basis price | Last price minus basis price | The basis price convention must be explicit |
| Change percentage | Change as a proportion of the basis price | Change divided by basis price, then multiplied by 100% | Store enough decimal places |
| Open price | Price at the start of the statistical period | First trade price in the period | Period definition depends on time zone |
| High and low | Price extremes within the statistical period | Maximum and minimum trade prices in the period | Abnormal trades may push the extremes up or down |
| Market cap | Product of unit price and circulating supply; an estimate | Unit price multiplied by circulating supply | The circulating supply definition may change over time |
| Market cap rank | Rank obtained by sorting market cap in descending order | Sort within a consistent asset universe | Rank changes in real time with price |
| Update time | Time when the data was generated | Record in a consistent time zone | Distinguish generation time from receipt time |
2.1 The Basis Problem for Change Percentage
The denominator of change percentage determines the meaning of the result. Suppose an asset has a last price of 1.20 and a basis price of 1.00 from 24 hours ago. The change is 0.20, and the change percentage is 20%. If the same data uses the open price as the basis, the result may differ. Some pages use the open price as the basis, while others use the price at the start of a rolling window.
Therefore, engineering systems should explicitly record the basis type in data metadata, for example base_type = open or base_type = rolling_24h, rather than relying on an implicit convention. The frontend should also note the convention next to the displayed value to avoid misinterpretation.
2.2 Amplitude and Range Position
Amplitude reflects the price movement range within the statistical period. Common formulas are:
- Amplitude = (High − Low) ÷ Open × 100%
- Range position = (Last − Low) ÷ (High − Low)
Range position ranges from 0 to 1. A value close to 1 means the price is near the upper end of the range, while a value close to 0 means it is near the lower end. When high equals low, the denominator is zero and must be handled separately.
2.3 The Estimated Nature of Market Cap
Market cap is usually calculated as unit price multiplied by circulating supply. The circulating supply may come from a data provider’s statistics or from on-chain or other public information aggregation, and definitions may differ across sources. Therefore, market cap should be treated as an estimate. Market cap rank also depends on the asset universe used for sorting, and changes to that universe directly change the rank. When displaying it externally, state the ranking scope and update frequency.
2.4 Time Semantics
Update time is a key field for judging data quality. A system should distinguish at least three timestamps: source generation time, system receipt time, and storage time. Store them in UTC and convert to the user’s time zone for display. If the raw data does not include time zone information, define its time zone explicitly at the ingestion layer and document it; otherwise, cross-time-zone comparisons will produce errors.
3. Data Quality Validation
Quote data may encounter missing fields, misaligned values, inconsistent units, or stale timestamps during transmission and transformation. The following checks can intercept most anomalies before storage:
- Completeness: Required fields exist and are non-empty.
- Price relationships: High should be no less than open and last; low should be no greater than open and last.
- Derived field consistency: Change and change percentage should match the basis price within an allowed tolerance.
- Timeliness: If the difference between the current time and update time exceeds a threshold, mark the data as stale.
- Outliers: If the last price deviates from a recent mean by more than a configured number of standard deviations, trigger manual review.
Example validation logic (pseudocode):
function validate_quote(q, base_type):errors = []required = [symbol, last, change, change_pct, open, high, low, updated_at]for f in required:if q[f] is missing or empty:errors.append("missing " + f)if q.high < max(q.open, q.last) or q.low > min(q.open, q.last):errors.append("price range inconsistent")base = (base_type == "open") ? q.open : q.prev_closeif abs(q.change - (q.last - base)) > CHANGE_TOLERANCE:errors.append("change mismatch")if abs(q.change_pct - q.change / base * 100) > PCT_TOLERANCE:errors.append("pct mismatch")if now_utc() - parse_utc(q.updated_at) > STALE_SECONDS:errors.append("stale data")return errors
Tolerance should be set according to the quote precision of the asset. If floating-point numbers are used for comparison, rounding errors on small prices may cause false positives. Therefore, fixed-point decimals or decimal types are recommended for storage and calculation.
4. Collection and Storage Pipeline Design
A reliable market data service usually consists of multiple layers. Clear responsibility boundaries at each layer make it easier to locate problems quickly when a component fails.
- Collection layer: Obtain data through scheduled pulls or subscription pushes. Set timeouts, retries, exponential backoff, and request rate limiting to avoid being blocked because of excessive pressure on the data source.
- Validation layer: Run the checks in Section 3 and write failed records to an exception queue instead of discarding them.
- Message queue: Decouple collection from computation and handle data bursts and mismatches in downstream processing speed.
- Cache layer: Store the latest snapshot for each asset for low-latency queries and set a reasonable expiration time.
- Time-series storage: Store historical series partitioned by asset and time to support range queries and backtesting.
- Query service: Responses must include the data timestamp, basis type, and source description.
- Monitoring and alerting: Span all layers and track collection success rate, end-to-end latency, and validation failure rate.
Pipeline diagram:
Data source → Collector → Validation → Message queue → Computation → Cache (latest snapshot)└→ Time-series storage (historical series) → Query serviceMonitoring and alerting span all stages above
Storage design must also consider precision. For low-priced assets, quotes may contain many decimal places. If storage precision is insufficient, change percentage and amplitude calculations will be distorted. Retain enough decimal places according to the asset’s minimum quote unit, and record precision information in the data model.
5. Metric Calculation Example
On validated data, derived metrics can be calculated. The following pseudocode outlines change percentage, amplitude, and range position, with division-by-zero handling:
function compute_metrics(q):change_pct = (q.last - q.open) / q.open * 100 // basis: open priceamplitude = (q.high - q.low) / q.open * 100range = q.high - q.lowif range ...
