Skip to content

Trading Behavior Trend

Description

Returns trading statistics for a specified address and token on the blockchain. Supports querying on-chain trading activity over a time range by specifying the token, chain, and time period.

Use cases:

  • Track trading activity for a specific address
  • Analyze buy/sell behavior and trading frequency

Update frequency: Updated once per day

Endpoint

  • Method: POST
  • Path: /open/v1/chain/trade/token/tradeCountTrend

Credits

  • Cost: 2

Prerequisites

Obtain vsTokenId

ConditionDescriptionHow to obtain
vsTokenId availableUse cached vsTokenId; no repeat lookupAuto-extracted from context
vsTokenId missingCall POST /vs-token/listPrerequisite API call

Obtain coinKey

ConditionDescriptionHow to obtain
coinKey availableUse cached coinKey; no repeat lookupAuto-extracted from context
coinKey missingCall POST /vs-token/detail to get coinKey for each chainPrerequisite API call

Obtain address

ConditionDescriptionHow to obtain
address availableUse known holding addressUser input
address missingCall POST /chain/trade/token/holdPage to query holding address listPrerequisite API call

Request parameters

Parameters are sent as JSON in the request body.

FieldTypeRequiredDescription
vsTokenIdlongYesToken ID
coinKeystringYesToken coinKey (chain + contract address); obtain from token details
addressstringYesAddress
startTimelongNoStart time (millisecond timestamp)
endTimelongYesEnd time (millisecond timestamp)

Response fields

Structure of each object in the data array:

FieldTypeSerializedDescription
vsTokenIdlongstringToken ID
symbolstringstringToken symbol
namestringstringToken name
datelonglongTime (millisecond timestamp)
fromCountintegerstringOutbound transaction count
toCountintegerstringInbound transaction count
fromAmountnumberstringOutbound amount
toAmountnumberstringInbound amount
pricenumberstringToken price

Field semantics

FieldMeaningTip
fromCountOutbound transaction countReflects selling activity of the address
toCountInbound transaction countReflects buying activity of the address
fromAmountOutbound amountPositive value means funds leaving the address
toAmountInbound amountPositive value means funds entering the address

Example

json
{
    "vsTokenId": 1,                         // Token ID
    "coinKey": "BTC_BTC",                    // Token coinKey (chain + contract address); obtain from token details
    "address": "3M219KR5vEneNb47ewrPfWyb5jQ2DjxRP6", // Address
    "endTime": 1773479265534                  // End time
}

cURL (Linux/macOS)

bash
curl --location --request POST 'http://${host}/api/open/v1/chain/trade/token/tradeCountTrend' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: xxxxx' \
--header 'X-TIMESTAMP: xxxxx' \
--header 'X-SIGN: xxxxx' \
--header 'Accept: */*' \
--data-raw '{
    "vsTokenId": 1,
    "coinKey": "BTC_BTC",
    "address": "3M219KR5vEneNb47ewrPfWyb5jQ2DjxRP6",
    "endTime": 1773479265534
}'

cURL (Windows CMD)

cmd
curl --location --request POST "http://${host}/api/open/v1/chain/trade/token/tradeCountTrend" ^
--header "Content-Type: application/json" ^
--header "X-API-KEY: xxxxx" ^
--header "X-TIMESTAMP: xxxxx" ^
--header "X-SIGN: xxxxx" ^
--header "Accept: */*" ^
--data-raw "{    \"vsTokenId\": 1,    \"coinKey\": \"BTC_BTC\",    \"address\": \"3M219KR5vEneNb47ewrPfWyb5jQ2DjxRP6\",    \"endTime\": 1773479265534}"

Success response example

json
{
    "code": 200,
    "message": "success",
    "data": [
        {
            "vsTokenId": "1",           // Token ID
            "symbol": "BTC",             // Token symbol
            "name": "Bitcoin",           // Token name
            "date": 1542038400000,       // Time
            "fromCount": "1",             // Outbound transaction count
            "toCount": "1",               // Inbound transaction count
            "fromAmount": "0.01",         // Outbound amount
            "toAmount": "0.01",           // Inbound amount
            "price": "6359.49"            // Token price
        },
        {
            "vsTokenId": "1",
            "symbol": "BTC",
            "name": "Bitcoin",
            "date": 1542124800000,
            "fromCount": "0",
            "toCount": "1",
            "fromAmount": "0",
            "toAmount": "1",
            "price": "5738.35"
        },
        {
            "vsTokenId": "1",
            "symbol": "BTC",
            "name": "Bitcoin",
            "date": 1542211200000,
            "fromCount": "2",
            "toCount": "1",
            "fromAmount": "20001",
            "toAmount": "20000",
            "price": "5648.03"
        }
        // ... more data omitted
    ],
    "requestId": "xxx-xxx-xxx"
}