Skip to content

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

CaseNoteHow
Already have vsTokenIdUse the cached id; no need to query againAuto from context
No vsTokenIdCall POST /vs-token/listPrerequisite API call

Request body (JSON)

Parameters are sent in the body as JSON.

FieldTypeRequiredDescription
vsTokenIdintegerYesToken id
datelongYesTarget date (epoch ms)

Response �?data

Only fields inside data:

FieldTypeSerializedDescription
updateTimeintegerlongUpdated at (ms)
vsTokenIdintegerstringToken id
symbolstringstringTicker
namestringstringName
hasSpotGoodsbooleanbooleanHas spot data
spotMaxInflownumberstringSpot major-fund accumulation
spotGoodsListarrayarraySpot series
    timeRangestringstringWindow label
    timeParticleEnumintegerintegerStatistical granularity
    tradeInflownumberstringNet inflow (USD)
    tradeAmountnumberstringVolume (USD)
hasContractbooleanbooleanHas derivatives data
contractMaxInflownumberstringDerivatives major-fund accumulation
contractListarrayarrayDerivatives series
    timeRangestringstringWindow label
    timeParticleEnumintegerintegerStatistical granularity
    tradeInflownumberstringNet inflow (USD)
    tradeAmountnumberstringVolume (USD)

Field semantics

FieldMeaningGuidance
spotMaxInflowSpot major accumulationMajor fund = max net inflow across all spot windows; accumulation = per-window series
contractMaxInflowDerivatives major accumulationMajor fund = max net inflow across all spot windows; accumulation = per-window series
dateSnapshot dateHistorical instant queried; minimum step 5 minutes

Example

json
{
  "vsTokenId": 1,
  // Token id
  "date": 1773654600000
  // Target date (timestamp)
}

cURL (Linux / macOS)

bash
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)

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

json
{
  "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

  1. 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.
  2. Time alignment

    Your date is floored to the nearest whole 5 minutes (e.g. 15:16 �?15:15).

  3. 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.