> For the complete documentation index, see [llms.txt](https://docs.lyslabs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lyslabs.ai/contextualized-data/real-time-aggregations/token-snapshot.md).

# Token Snapshot

### Overview

The `TradeActivityStats` class represents comprehensive trade and volume statistics for cryptocurrency tokens over configurable time windows.&#x20;

This immutable data model captures OHLCV candle data, transaction metrics, volume analytics, and unique participant tracking.

### Field Reference

#### **Time Window Fields**

| Field                | Type   | Description                                                 |
| -------------------- | ------ | ----------------------------------------------------------- |
| mintId               | String | Token mint identifier                                       |
| windowStart          | long   | Window start timestamp (epoch milliseconds)                 |
| windowEnd            | long   | Window end timestamp (epoch milliseconds)                   |
| windowDurationMillis | long   | Explicit window duration in milliseconds                    |
| windowLabel          | String | Human-readable window label (e.g., "1m", "5m", "1h", "24h") |

#### **OHLCV Price Data**

| Field      | Type   | Description                           |
| ---------- | ------ | ------------------------------------- |
| openPrice  | double | Opening price (first trade in window) |
| highPrice  | double | Highest price traded in the window    |
| lowPrice   | double | Lowest price traded in the window     |
| closePrice | double | Closing price (last trade in window)  |

#### **Volume Metrics - Token Units**

| Field       | Type   | Description                       |
| ----------- | ------ | --------------------------------- |
| totalVolume | double | Total trade volume in token units |
| buyVolume   | double | Buy-side volume in token units    |
| sellVolume  | double | Sell-side volume in token units   |

#### **Volume Metrics - Quote Currency**

| Field            | Type   | Description                               |
| ---------------- | ------ | ----------------------------------------- |
| totalVolumeQuote | double | Total volume in quote currency (USDT/SOL) |
| buyVolumeQuote   | double | Buy-side volume in quote currency         |
| sellVolumeQuote  | double | Sell-side volume in quote currency        |

#### **Volume Ratios**

| Field                | Type   | Description                                |
| -------------------- | ------ | ------------------------------------------ |
| buyVolumePercentage  | double | Buy volume as percentage of total (0-100)  |
| sellVolumePercentage | double | Sell volume as percentage of total (0-100) |

#### **Transaction Counts**

| Field        | Type | Description                                 |
| ------------ | ---- | ------------------------------------------- |
| totalTxCount | int  | Total number of transactions (buys + sells) |
| buyTxCount   | int  | Number of buy transactions                  |
| sellTxCount  | int  | Number of sell transactions                 |

#### **Transaction Ratios**

| Field               | Type   | Description                              |
| ------------------- | ------ | ---------------------------------------- |
| buySellCountRatio   | double | Ratio of buy to sell transaction counts  |
| buyCountPercentage  | double | Buy transactions as percentage of total  |
| sellCountPercentage | double | Sell transactions as percentage of total |

#### **Unique Participants**

| Field             | Type         | Description                           |
| ----------------- | ------------ | ------------------------------------- |
| uniqueBuyers      | Set\<String> | Set of unique buyer wallet IDs        |
| uniqueSellers     | Set\<String> | Set of unique seller wallet IDs       |
| uniqueBuyerCount  | int          | Count of unique buyers in the window  |
| uniqueSellerCount | int          | Count of unique sellers in the window |

#### Transaction References

| Field            | Type   | Description                           |
| ---------------- | ------ | ------------------------------------- |
| openTxSignature  | String | Transaction hash of the opening trade |
| closeTxSignature | String | Transaction hash of the closing trade |

### Field Categories Summary

* Time Window: 5 fields defining the temporal scope
* OHLCV Data: 4 fields for candlestick price information
* Volume Metrics: 9 fields covering token and quote currency volumes with ratios
* Transaction Metrics: 6 fields for transaction counts and ratios
* Participants: 4 fields tracking unique buyers and sellers
* References: 2 fields linking to boundary transactions

Total Fields: 30 fields providing comprehensive trading analytics data

### Usage Notes

* All price and volume fields use double precision for accurate financial calculations
* Transaction counts use int type, suitable for typical trading volumes
* Unique participant tracking uses Set\<String> for efficient deduplication
* Timestamps are stored as epoch milliseconds (long) for precise time tracking
* The class is immutable and uses the builder pattern for construction
