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
| Condition | Description | How to obtain |
|---|---|---|
| vsTokenId available | Use cached vsTokenId; no repeat lookup | Auto-extracted from context |
| vsTokenId missing | Call POST /vs-token/list | Prerequisite API call |
Obtain coinKey
| Condition | Description | How to obtain |
|---|---|---|
| coinKey available | Use cached coinKey; no repeat lookup | Auto-extracted from context |
| coinKey missing | Call POST /vs-token/detail to get coinKey for each chain | Prerequisite API call |
Obtain address
| Condition | Description | How to obtain |
|---|---|---|
| address available | Use known holding address | User input |
| address missing | Call POST /chain/trade/token/holdPage to query holding address list | Prerequisite API call |
Request parameters
Parameters are sent as JSON in the request body.
| Field | Type | Required | Description |
|---|---|---|---|
| vsTokenId | long | Yes | Token ID |
| coinKey | string | Yes | Token coinKey (chain + contract address); obtain from token details |
| address | string | Yes | Address |
| startTime | long | No | Start time (millisecond timestamp) |
| endTime | long | Yes | End time (millisecond timestamp) |
Response fields
Structure of each object in the data array:
| Field | Type | Serialized | Description |
|---|---|---|---|
| vsTokenId | long | string | Token ID |
| symbol | string | string | Token symbol |
| name | string | string | Token name |
| date | long | long | Time (millisecond timestamp) |
| fromCount | integer | string | Outbound transaction count |
| toCount | integer | string | Inbound transaction count |
| fromAmount | number | string | Outbound amount |
| toAmount | number | string | Inbound amount |
| price | number | string | Token price |
Field semantics
| Field | Meaning | Tip |
|---|---|---|
| fromCount | Outbound transaction count | Reflects selling activity of the address |
| toCount | Inbound transaction count | Reflects buying activity of the address |
| fromAmount | Outbound amount | Positive value means funds leaving the address |
| toAmount | Inbound amount | Positive 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"
}