Crypto Market Snapshot: Field Definitions and Metric Calculation Practices
This article explores best practices for processing crypto market data snapshots, focusing on field definitions, metric calculations, and common engineering challenges. It details how to handle identifier, price, volatility, scale, and time fields accurately to avoid common pitfalls related to data semantics, precision, timezones, and calculation baselines.
I. Background and Problem Definition
Market pages typically display the current status of a crypto asset using a set of numbers, including the latest price, daily range, market capitalization, ranking, and update time. For visitors, these numbers represent a one-time snapshot. For developers, they serve as a data source that must be collected, validated, computed, and then distributed to downstream systems such as dashboards, alerts, or reports.
In practice, market data errors usually stem not from arithmetic mistakes, but from field definitions (semantics), precision, and time. For example, a “price change” metric can vary depending on whether the baseline price is the previous calendar day’s close or the starting price of a rolling window. Similarly, “market cap” can differ significantly depending on whether it is calculated using circulating supply or total supply. This article provides a practical, ready-to-implement solution, organized by field meanings, calculation methods, engineering implementation, common pitfalls, and launch checks.
Disclaimer: This article discusses data processing methods and does not constitute financial advice or promise any returns.
II. Market Field Meanings and Definitions
2.1 Identifier Fields
The symbol is the field that uniquely identifies a trading pair or asset within a data source. Multiple assets might share the same name, so mapping relationships should use the symbol as the primary key. Quote currency and market type indicate what currency the price is measured in and the category of the market. Prices of the same asset in different quote currencies cannot be directly compared. The name is intended for display purposes only and should not be used as a join key, as names can be duplicated or changed.
2.2 Price Fields
The latest price is the price of the most recent transaction or sampling point, serving as the foundation for all derived metrics. The open price is the price at the start of the statistical window. If the window is a rolling 24-hour period, the open price refers to the window’s start time, not midnight of the calendar day. The documentation must clearly specify the window definition.
The high and low prices are the extreme values within the statistical window. They are affected by the sampling frequency; low-frequency sampling may miss instantaneous extremes, resulting in a smaller amplitude.
2.3 Volatility Fields
Price change amount and price change percentage represent the absolute and percentage changes relative to the baseline price. The choice of the baseline price determines the meaning of the result, which is detailed in Section 3.1. Amplitude is the fluctuation range within the window, used to measure the strength of intraday volatility.
2.4 Scale Fields
Market cap is typically calculated as the latest price multiplied by the circulating supply. Some data sources use total supply, so it is necessary to confirm the definition before integration. The table below compares three common definitions:
| Definition | Meaning | Typical Use Case | Usage Risk |
|---|---|---|---|
| Circulating Supply | The amount currently in circulation | Ranking, market size comparison | Locking or unlocking changes the value |
| Total Supply | All issued and unburned amount | Estimating fully issued scale | Includes non-circulating parts, overestimates actual market cap |
| Fully Diluted Valuation (FDV) | Estimated by maximum possible supply | Long-term valuation reference | Relies on future issuance plans, deviates from current trading |
Market cap ranking is the position obtained by sorting all assets in the same data source in descending order by market cap. Rankings change in real-time with prices and should only be compared with other data from the exact same moment.
2.5 Time Fields
The update time determines whether the snapshot is valid. It should include the date, time, and timezone. If a data source only provides local time without a timezone, the system must convert it to Coordinated Universal Time (UTC) before storage and retain the original timezone information for troubleshooting.
Example: A data source returns “2026-11-01 01:30” without a timezone. If this is US Eastern time, 01:30 AM on that day occurs twice at the end of Daylight Saving Time. Relying solely on local time cannot distinguish between these two occurrences; it requires the offset provided by the data source or a monotonically increasing sequence number. Beijing time (UTC+8) does not observe DST, making conversion simpler, but the offset should still be explicitly written to avoid confusion when integrating data sources from other timezones.
III. Core Metric Calculation Methods
Let the baseline price be P0, the latest price be P, the window high be H, and the window…
