Skip to content

实时资金积累

接口描述

获取指定代币在中心化交易所交易产生的实时资金数据(即实时净流入数据),以及当日的主力资金积累数据,包括代币的现货和合约交易。

使用场景

  • 适用于查看资金在当日不同时间点时,在不同时间窗口的积累情况监控
  • 适用于主力资金行为追踪

使用提示:

  • 查询日内主力资金时看24h(小时)内的净流入最大值,查询主力资金时看90d(天)内净流入最大值。
  • 净流入为正,表示表示主力流入,利多。净流入为负,表示主力卖出,利空
  • 自然语言查询主力资金(未指定交易类型)时需要提供现货和合约的资金数据
  • 自然语言查询主力分析、主力情况等综合语言需要调此接口

数据更新频率:每5分钟更新一次

请求URL

  • 方法POST
  • 路径/open/v1/trade/getCoinTrade

积分消耗

  • 消耗积分3

前置条件

获取 vsTokenId

条件说明获取方式
已有 vsTokenId直接使用缓存的 vsTokenId,无需重复查询上下文自动提取
未有 vsTokenId调用 POST /vs-token/list 接口获取前置接口调用

请求参数

参数通过请求体(Body)以 JSON 格式传递。

参数名类型必需描述
vsTokenIdlong代币 ID

响应字段

仅展示 data 对象内的字段结构:

字段类型实际返回类型描述
updateTimelonglong更新时间(毫秒时间戳)
vsTokenIdlongstring代币ID
symbolstringstring代币符号
namestringstring代币名称
hasSpotGoodsbooleanboolean是否存在现货数据
spotMaxInflownumbernumber现货主力资金积累 (USD)
spotGoodsListarrayarray现货数据列表
    timeRangestringstring时间范围
    timeParticleEnumintegerinteger统计时间粒度
    tradeInflownumberstring交易净流入金额 (USD)
    tradeAmountnumberstring交易量 (USD)
    tradeInflowChangedoublenumber交易净流入变化率
    tradeOutnumberstring交易流出金额 (USD)
    tradeInnumberstring交易流入金额 (USD)
hasContractbooleanboolean是否存在合约数据
contractMaxInflownumbernumber合约主力资金积累 (USD)
contractListarrayarray合约数据列表
    timeRangestringstring时间范围
    timeParticleEnumintegerinteger统计时间粒度
    tradeInflownumberstring交易净流入金额 (USD)
    tradeAmountnumberstring交易量 (USD)
    tradeInflowChangedoublenumber交易净流入变化率
    tradeOutnumberstring交易流出金额 (USD)
    tradeInnumberstring交易流入金额 (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",                           // 代币名称
        "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"
}