即時資金累積
介面描述
取得指定代幣在中心化交易所交易產生的即時資金資料(即即時淨流入資料),以及當日的主力資金累積資料,包括代幣的現貨和合約交易。
使用情境:
- 適用於檢視資金在當日不同時間点時,在不同時間窗口的累積情況監控
- 適用於主力資金行為追蹤
使用提示:
- 查詢日內主力資金時看24h(小時)內的淨流入最大值,查詢主力資金時看90d(天)內淨流入最大值。
- 淨流入為正,表示表示主力流入,利多。淨流入為负,表示主力卖出,利空
- 自然語言查詢主力資金(未指定交易類型)時需要提供現貨和合約的資金資料
- 自然語言查詢主力分析、主力情況等綜合語言需要調此介面
資料更新頻率:每5分鐘更新一次
請求 URL
- 方法:
POST - 路徑:
/open/v1/trade/getCoinTrade
點數消耗
- 消耗點數:
4
前置條件
取得 vsTokenId
| 條件 | 說明 | 取得方式 |
|---|---|---|
| 已有 vsTokenId | 直接使用快取的 vsTokenId,無需重複查詢 | 上下文自動提取 |
| 未有 vsTokenId | 呼叫 POST /vs-token/list 介面取得 | 前置介面呼叫 |
請求參數
參數透過請求體(Body)以 JSON 格式傳遞。
| 參數名 | 類型 | 必需 | 描述 |
|---|---|---|---|
| vsTokenId | long | 是 | 代幣 ID |
回應欄位
僅展示 data 物件內的欄位結構:
| 欄位 | 類型 | 實際回傳類型 | 描述 |
|---|---|---|---|
| updateTime | long | long | 更新時間(毫秒時間戳) |
| vsTokenId | long | string | 代幣ID |
| symbol | string | string | 代幣符號 |
| name | string | string | 代幣名稱 |
| coinPrice | number | string | 幣價 (USD) |
| marketCap | number | string | 市值 (USD) |
| hasSpotGoods | boolean | boolean | 是否存在現貨資料 |
| spotMaxInflow | number | number | 現貨主力資金累積 (USD) |
| spotGoodsList | array | array | 現貨資料列表 |
| timeRange | string | string | 時間範圍 |
| timeParticleEnum | integer | integer | 統計時間粒度 |
| tradeInflow | number | string | 交易淨流入金額 (USD) |
| tradeAmount | number | string | 交易量 (USD) |
| tradeInflowChange | double | number | 交易淨流入變化率 |
| tradeOut | number | string | 交易流出金額 (USD) |
| tradeIn | number | string | 交易流入金額 (USD) |
| hasContract | boolean | boolean | 是否存在合約資料 |
| contractMaxInflow | number | number | 合約主力資金累積 (USD) |
| contractList | array | array | 合約資料列表 |
| timeRange | string | string | 時間範圍 |
| timeParticleEnum | integer | integer | 統計時間粒度 |
| tradeInflow | number | string | 交易淨流入金額 (USD) |
| tradeAmount | number | string | 交易量 (USD) |
| tradeInflowChange | double | number | 交易淨流入變化率 |
| tradeOut | number | string | 交易流出金額 (USD) |
| tradeIn | number | string | 交易流入金額 (USD) |
欄位業務含義
| 欄位 | 業務含義 | 使用建議 |
|---|---|---|
| spotMaxInflow | 現貨主力累積 | 現貨主力資金為現貨交易的90d(天)內各時間窗口中,資金淨流入的最大值 |
| contractMaxInflow | 合約主力累積 | 合約主力資金為合約交易的90d(天)內各時間窗口中,資金淨流入的最大值 |
| hasSpotGoods | 現貨資料識別 | true表示有現貨資料,false表示無現貨資料,無時間要求時預設給90d以內的全部時間週期資料 |
| hasContract | 合約資料識別 | true表示有合約資料,false表示無合約資料,非時間要求時預設給90d以內的全部時間週期資料 |
| tradeInflowChange | 淨流入變化率 | 當前時間週期的資金與上個時間週期的資金對比 |
請求範例
json
{
"vsTokenId": 1 // 代币ID
}cURL 範例(Linux/macOS)
bash
curl --location --request POST 'http://${host}/api/open/v1/trade/getCoinTrade' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: xxxxx' \
--header 'X-TIMESTAMP: xxxxx' \
--header 'X-SIGN: xxxxx' \
--header 'Accept: */*' \
--data-raw '{
"vsTokenId": 1
}'cURL 範例(Windows CMD)
cmd
curl --location --request POST "http://${host}/api/open/v1/trade/getCoinTrade" ^
--header "Content-Type: application/json" ^
--header "X-API-KEY: xxxxx" ^
--header "X-TIMESTAMP: xxxxx" ^
--header "X-SIGN: xxxxx" ^
--header "Accept: */*" ^
--data-raw "{ \"vsTokenId\": 1}"成功回應範例
json
{
"code": 200,
"message": "success",
"data": {
"updateTime": 1773220800000, // 更新时间
"vsTokenId": "1", // 代币 ID
"symbol": "BTC", // 代币符号
"name": "Bitcoin", // 代币名称
"coinPrice": "70559.18", // 币价 (USD)
"marketCap": "1412725749093.2734", // 市值 (USD)
"hasSpotGoods": true, // 是否存在现货数据
"spotMaxInflow": 2588472.3329447997, // 现货主力资金积累 (USD)
"spotGoodsList": [
{
"timeRange": "5m", // 时间范围
"timeParticleEnum": 5, // 统计时间粒度
"tradeInflow": "1914106.2828805007", // 交易净流入金额 (USD)
"tradeAmount": "4389778.5824913", // 交易量 (USD)
"tradeInflowChange": 373.39, // 交易净流入变化率
"tradeOut": "2475814.5678", // 交易流出金额 (USD)
"tradeIn": "4389920.8506" // 交易流入金额 (USD)
},
{
"timeRange": "15m", // 时间范围
"timeParticleEnum": 15, // 统计时间粒度
"tradeInflow": "2588472.3329447997", // 交易净流入金额 (USD)
"tradeAmount": "8590968.535904001", // 交易量 (USD)
"tradeInflowChange": 2.06, // 交易净流入变化率
"tradeOut": "6002496.2029", // 交易流出金额 (USD)
"tradeIn": "8590968.5359" // 交易流入金额 (USD)
},
{
"timeRange": "30m", // 时间范围
"timeParticleEnum": 30, // 统计时间粒度
"tradeInflow": "137283.75568691065", // 交易净流入金额 (USD)
"tradeAmount": "33263896.482198115", // 交易量 (USD)
"tradeInflowChange": -0.95, // 交易净流入变化率
"tradeOut": "33126612.7265", // 交易流出金额 (USD)
"tradeIn": "33263896.4822" // 交易流入金额 (USD)
}
// ... 更多数据省略
],
"hasContract": true, // 是否存在合约数据
"contractMaxInflow": 17609356.027199995, // 合约主力资金积累 (USD)
"contractList": [
{
"timeRange": "5m", // 时间范围
"timeParticleEnum": 5, // 统计时间粒度
"tradeInflow": "9098861.077599995", // 交易净流入金额 (USD)
"tradeAmount": "32832991.129399996", // 交易量 (USD)
"tradeInflowChange": 3.18, // 交易净流入变化率
"tradeOut": "23734130.0518", // 交易流出金额 (USD)
"tradeIn": "32832991.1294" // 交易流入金额 (USD)
},
{
"timeRange": "15m", // 时间范围
"timeParticleEnum": 15, // 统计时间粒度
"tradeInflow": "13098330.522699993", // 交易净流入金额 (USD)
"tradeAmount": "72156543.4141", // 交易量 (USD)
"tradeInflowChange": 1.9, // 交易净流入变化率
"tradeOut": "59058212.8914", // 交易流出金额 (USD)
"tradeIn": "72156543.4141" // 交易流入金额 (USD)
},
{
"timeRange": "30m", // 时间范围
"timeParticleEnum": 30, // 统计时间粒度
"tradeInflow": "17609356.027199995", // 交易净流入金额 (USD)
"tradeAmount": "162089903.7944", // 交易量 (USD)
"tradeInflowChange": 3.33, // 交易净流入变化率
"tradeOut": "144480547.7672", // 交易流出金额 (USD)
"tradeIn": "162089903.7944" // 交易流入金额 (USD)
}
// ... 更多数据省略
]
},
"requestId": "xxx-xxx-xxx"
}