Capital snapshot
API description
Query a point-in-time capital snapshot for a given token. The response contains snapshot data across multiple statistical windows (5 minutes, 15 minutes, 30 minutes, �?24 hours) at that instant.
Data retention (important)
The system keeps the latest 100 time points for each statistical window (e.g. 5 minutes, 15 minutes, 24 hours).
- 5-minute window: the latest 100 whole 5-minute instants (~8.33 hours)
- 24-hour window: the latest 100 days (one point per day)
- Other windows follow the same rule.
Implications:
- If the requested instant is outside the 100-point range for that window (e.g. using the 5-minute window for a time more than ~8.33 hours ago, or a date more than 100 days back on the daily window), the API cannot return exact data.
- The system returns the nearest valid data point before that time (e.g. if 9:50 is unavailable, 9:45 is returned) and does not force a same-day 08:00 cumulative.
Why this design?
For performance and traceability we only retain the latest 100 detailed points per window. For older history, use a larger window (e.g. daily data).
Endpoint
- Method:
POST - Path:
/open/v1/trade/getCoinTradeSnapshot
Points
- Points per call:
3
Prerequisites
Getting
vsTokenId
| Case | Note | How |
|---|---|---|
Already have vsTokenId | Use the cached id; no need to query again | Auto from context |
No vsTokenId | Call POST /vs-token/list | Prerequisite API call |
Request body (JSON)
Parameters are sent in the body as JSON.
| Field | Type | Required | Description |
|---|---|---|---|
| vsTokenId | integer | Yes | Token id |
| date | long | Yes | Target date (epoch ms) |
Response �?data
Only fields inside data:
| Field | Type | Serialized | Description |
|---|---|---|---|
| updateTime | integer | long | Updated at (ms) |
| vsTokenId | integer | string | Token id |
| symbol | string | string | Ticker |
| name | string | string | Name |
| hasSpotGoods | boolean | boolean | Has spot data |
| spotMaxInflow | number | string | Spot major-fund accumulation |
| spotGoodsList | array | array | Spot series |
| timeRange | string | string | Window label |
| timeParticleEnum | integer | integer | Statistical granularity |
| tradeInflow | number | string | Net inflow (USD) |
| tradeAmount | number | string | Volume (USD) |
| hasContract | boolean | boolean | Has derivatives data |
| contractMaxInflow | number | string | Derivatives major-fund accumulation |
| contractList | array | array | Derivatives series |
| timeRange | string | string | Window label |
| timeParticleEnum | integer | integer | Statistical granularity |
| tradeInflow | number | string | Net inflow (USD) |
| tradeAmount | number | string | Volume (USD) |
Field semantics
| Field | Meaning | Guidance |
|---|---|---|
| spotMaxInflow | Spot major accumulation | Major fund = max net inflow across all spot windows; accumulation = per-window series |
| contractMaxInflow | Derivatives major accumulation | Major fund = max net inflow across all spot windows; accumulation = per-window series |
| date | Snapshot date | Historical instant queried; minimum step 5 minutes |
Example
{
"vsTokenId": 1,
// Token id
"date": 1773654600000
// Target date (timestamp)
}cURL (Linux / macOS)
curl --location --request POST 'http://${host}/api/open/v1/trade/getCoinTradeSnapshot' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: xxxxx' \
--header 'X-TIMESTAMP: xxxxx' \
--header 'X-SIGN: xxxxx' \
--header 'Accept: */*' \
--data-raw '{
"vsTokenId": 1,
"date": 1773654600000
}'cURL (Windows CMD)
curl --location --request POST "http://${host}/api/open/v1/trade/getCoinTradeSnapshot" ^
--header "Content-Type: application/json" ^
--header "X-API-KEY: xxxxx" ^
--header "X-TIMESTAMP: xxxxx" ^
--header "X-SIGN: xxxxx" ^
--header "Accept: */*" ^
--data-raw "{ \"vsTokenId\": 1, \"date\": 1773654600000}"Sample success
{
"code": 200,
"message": "success",
"data": {
"updateTime": 1773654600000,
// Updated at
"vsTokenId": "1",
// Token id
"symbol": "BTC",
// Ticker
"name": "Bitcoin",
// Name
"hasSpotGoods": true,
// Has spot data
"spotMaxInflow": "173206257.989364",
// Spot major-fund accumulation
"spotGoodsList": [
{
"timeRange": "m5",
// Window
"timeParticleEnum": 5,
// Statistical granularity
"tradeInflow": "973669.0454980996",
// Net inflow (USD)
"tradeAmount": "4176136.897351299"
// Volume (USD)
},
{
"timeRange": "m15",
"timeParticleEnum": 15,
"tradeInflow": "1531287.2033347988",
"tradeAmount": "11822696.069185598"
},
{
"timeRange": "m30",
"timeParticleEnum": 30,
"tradeInflow": "2668474.962980899",
"tradeAmount": "25890934.620040294"
}
// ... more rows omitted
],
"hasContract": true,
// Has derivatives data
"contractMaxInflow": "5115857220.793299",
// Derivatives major-fund accumulation
"contractList": [
{
"timeRange": "m5",
// Window
"timeParticleEnum": 5,
// Statistical granularity
"tradeInflow": "7412113.461600001",
// Net inflow (USD)
"tradeAmount": "33097685.519799992"
// Volume (USD)
},
{
"timeRange": "m15",
"timeParticleEnum": 15,
"tradeInflow": "5682104.7779",
"tradeAmount": "69809754.7091"
},
{
"timeRange": "m30",
"timeParticleEnum": 30,
"tradeInflow": "-6355722.267499994",
"tradeAmount": "183233913.60549998"
}
// ... more rows omitted
]
},
"requestId": "xxx-xxx-xxx"
}Important notes
Retention
- Each window keeps only the latest 100 points.
- If the query is out of range (e.g. >100 days on the daily window), the nearest earlier valid point is returned.
Time alignment
Your
dateis floored to the nearest whole 5 minutes (e.g. 15:16 �?15:15).Timezone
All times use UTC+8.
FAQ
Q: I query Apr 1 18:16 but get Apr 1 18:15 �?why?
A: Times align to the nearest 5-minute boundary (18:16 �?18:15). If 18:15 is within retention, that point is returned.
Q: What if I query data from 100 days ago?
A: If the instant is outside the 100-point range for that window, the system returns the nearest valid point before that time. For example, the 5-minute window only covers ~8.33 hours; querying earlier returns the point at the 8.33-hour boundary; the 24-hour window keeps 100 days �?querying day 101 may return empty.
Q: Why do I get same-day 08:00 for Apr 1 18:16?
A: If the instant is outside the 100-point window, the system returns the nearest earlier valid point, up to that calendar day.