Trade Statistics
Retrieve instant trade analytics and performance metrics for one or more Solana SPL tokens. The endpoint returns buy/sell volume breakdowns, trade counts, and USD values over a configurable timeframe, along with a buy-to-sell ratio for quick market sentiment analysis.
GET
https://api.cambrian.org/solana/trade-statistics
Parameters
token_addresses* (string)
Comma-separated token addresses
timeframe* (string)
Time interval: 1h, 4h, 12h, 24h, 7d
Responses
Code
Description
200
Successful response
Media type: application/vnd.cambrian.table.v1.0.0+json
[
{
"columns": [
{
"name": "tokenAddress",
"type": "String"
},
{
"name": "timeframe",
"type": "String"
},
{
"name": "buyCount",
"type": "UInt64"
},
{
"name": "sellCount",
"type": "UInt64"
},
{
"name": "totalTradeCount",
"type": "UInt64"
},
{
"name": "volumeBuy",
"type": "Float64"
},
{
"name": "volumeSell",
"type": "Float64"
},
{
"name": "totalVolume",
"type": "Float64"
},
{
"name": "volumeBuyUSD",
"type": "Float64"
},
{
"name": "volumeSellUSD",
"type": "Float64"
},
{
"name": "totalVolumeUSD",
"type": "Float64"
},
{
"name": "buyToSellRatio",
"type": "Nullable(Float64)"
}
],
"data": [
[
"So11111111111111111111111111111111111111112",
"24h",
9461678,
14059850,
23521528,
39080876.11428526,
39379760.06464342,
78460636.17892867,
2895566611.65415,
2917711416.8239617,
5813278028.478111,
0.9924
]
],
"rows": 1
}
]
400
Bad Request: Invalid request parameters or malformed request.
401
Unauthorized: Missing or invalid API key. Include X-API-Key header with your request.
403
Forbidden: Invalid API key or insufficient permissions to access this resource.
404
Not Found: Endpoint or resource does not exist.
408
Request Timeout: Request took too long to process. Try again.
500
Internal Server Error: An unexpected error occurred while processing your request.
503
Service Unavailable: The server is temporarily unable to handle the request. Please try again later.
Examples
1. Single Token Trade Statistics (24h)
Retrieve 24-hour trade statistics for Wrapped SOL to assess recent trading activity.
curl
curl -X GET "https://api.cambrian.org/solana/trade-statistics?token_addresses=So11111111111111111111111111111111111111112&timeframe=24h" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
JSON
1[
2 {
3 "columns": [
4 {
5 "name": "tokenAddress",
6 "type": "String"
7 },
8 {
9 "name": "timeframe",
10 "type": "String"
11 },
12 {
13 "name": "buyCount",
14 "type": "UInt64"
15 },
16 {
17 "name": "sellCount",
18 "type": "UInt64"
19 },
20 {
21 "name": "totalTradeCount",
22 "type": "UInt64"
23 },
24 {
25 "name": "volumeBuy",
26 "type": "Float64"
27 },
28 {
29 "name": "volumeSell",
30 "type": "Float64"
31 },
32 {
33 "name": "totalVolume",
34 "type": "Float64"
35 },
36 {
37 "name": "volumeBuyUSD",
38 "type": "Float64"
39 },
40 {
41 "name": "volumeSellUSD",
42 "type": "Float64"
43 },
44 {
45 "name": "totalVolumeUSD",
46 "type": "Float64"
47 },
48 {
49 "name": "buyToSellRatio",
50 "type": "Nullable(Float64)"
51 }
52 ],
53 "data": [
54 [
55 "So11111111111111111111111111111111111111112",
56 "24h",
57 9461678,
58 14059850,
59 23521528,
60 39080876.11428526,
61 39379760.06464342,
62 78460636.17892867,
63 2895566611.65415,
64 2917711416.8239617,
65 5813278028.478111,
66 0.9924
67 ]
68 ],
69 "rows": 1
70 }
71]
2 {
3 "columns": [
4 {
5 "name": "tokenAddress",
6 "type": "String"
7 },
8 {
9 "name": "timeframe",
10 "type": "String"
11 },
12 {
13 "name": "buyCount",
14 "type": "UInt64"
15 },
16 {
17 "name": "sellCount",
18 "type": "UInt64"
19 },
20 {
21 "name": "totalTradeCount",
22 "type": "UInt64"
23 },
24 {
25 "name": "volumeBuy",
26 "type": "Float64"
27 },
28 {
29 "name": "volumeSell",
30 "type": "Float64"
31 },
32 {
33 "name": "totalVolume",
34 "type": "Float64"
35 },
36 {
37 "name": "volumeBuyUSD",
38 "type": "Float64"
39 },
40 {
41 "name": "volumeSellUSD",
42 "type": "Float64"
43 },
44 {
45 "name": "totalVolumeUSD",
46 "type": "Float64"
47 },
48 {
49 "name": "buyToSellRatio",
50 "type": "Nullable(Float64)"
51 }
52 ],
53 "data": [
54 [
55 "So11111111111111111111111111111111111111112",
56 "24h",
57 9461678,
58 14059850,
59 23521528,
60 39080876.11428526,
61 39379760.06464342,
62 78460636.17892867,
63 2895566611.65415,
64 2917711416.8239617,
65 5813278028.478111,
66 0.9924
67 ]
68 ],
69 "rows": 1
70 }
71]
2. Multi-Token Trade Statistics (1h)
Compare short-term trading activity between Wrapped SOL and USDC in a single request.
curl
curl -X GET "https://api.cambrian.org/solana/trade-statistics?token_addresses=So11111111111111111111111111111111111111112%2CEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&timeframe=1h" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
JSON
1[
2 {
3 "columns": [
4 {
5 "name": "tokenAddress",
6 "type": "String"
7 },
8 {
9 "name": "timeframe",
10 "type": "String"
11 },
12 {
13 "name": "buyCount",
14 "type": "UInt64"
15 },
16 {
17 "name": "sellCount",
18 "type": "UInt64"
19 },
20 {
21 "name": "totalTradeCount",
22 "type": "UInt64"
23 },
24 {
25 "name": "volumeBuy",
26 "type": "Float64"
27 },
28 {
29 "name": "volumeSell",
30 "type": "Float64"
31 },
32 {
33 "name": "totalVolume",
34 "type": "Float64"
35 },
36 {
37 "name": "volumeBuyUSD",
38 "type": "Float64"
39 },
40 {
41 "name": "volumeSellUSD",
42 "type": "Float64"
43 },
44 {
45 "name": "totalVolumeUSD",
46 "type": "Float64"
47 },
48 {
49 "name": "buyToSellRatio",
50 "type": "Nullable(Float64)"
51 }
52 ],
53 "data": [
54 [
55 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
56 "1h",
57 10002,
58 10583,
59 20585,
60 3874949.065586,
61 3855149.96228,
62 7730099.027866,
63 3874949.065586,
64 3855149.96228,
65 7730099.027866,
66 1.0051
67 ],
68 [
69 "So11111111111111111111111111111111111111112",
70 "1h",
71 403707,
72 623668,
73 1027375,
74 1469929.681518283,
75 1486747.432879488,
76 2956677.1143977707,
77 108845430.57028665,
78 110090752.30992499,
79 218936182.88021165,
80 0.9887
81 ]
82 ],
83 "rows": 2
84 }
85]
2 {
3 "columns": [
4 {
5 "name": "tokenAddress",
6 "type": "String"
7 },
8 {
9 "name": "timeframe",
10 "type": "String"
11 },
12 {
13 "name": "buyCount",
14 "type": "UInt64"
15 },
16 {
17 "name": "sellCount",
18 "type": "UInt64"
19 },
20 {
21 "name": "totalTradeCount",
22 "type": "UInt64"
23 },
24 {
25 "name": "volumeBuy",
26 "type": "Float64"
27 },
28 {
29 "name": "volumeSell",
30 "type": "Float64"
31 },
32 {
33 "name": "totalVolume",
34 "type": "Float64"
35 },
36 {
37 "name": "volumeBuyUSD",
38 "type": "Float64"
39 },
40 {
41 "name": "volumeSellUSD",
42 "type": "Float64"
43 },
44 {
45 "name": "totalVolumeUSD",
46 "type": "Float64"
47 },
48 {
49 "name": "buyToSellRatio",
50 "type": "Nullable(Float64)"
51 }
52 ],
53 "data": [
54 [
55 "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
56 "1h",
57 10002,
58 10583,
59 20585,
60 3874949.065586,
61 3855149.96228,
62 7730099.027866,
63 3874949.065586,
64 3855149.96228,
65 7730099.027866,
66 1.0051
67 ],
68 [
69 "So11111111111111111111111111111111111111112",
70 "1h",
71 403707,
72 623668,
73 1027375,
74 1469929.681518283,
75 1486747.432879488,
76 2956677.1143977707,
77 108845430.57028665,
78 110090752.30992499,
79 218936182.88021165,
80 0.9887
81 ]
82 ],
83 "rows": 2
84 }
85]
x402 Payment Option
This endpoint supports pay-per-use access via the x402 payment protocol (v2): pay $0.05 USDC per request using blockchain micropayments. No API key required.
Quickstart (Typescript)
bash
npm install @x402/fetch @x402/evm viem
TypeScript
1import { x402Client } from "@x402/core/client";
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/solana/trade-statistics"
11);
12const data = await response.json();
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/solana/trade-statistics"
11);
12const data = await response.json();
Quickstart (Python)
bash
pip install "x402[httpx]"
Python
1import asyncio, os
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/solana/trade-statistics")
13 print(response.json())
14asyncio.run(main())
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/solana/trade-statistics")
13 print(response.json())
14asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns 402 Payment Required with payment details
- The x402 SDK automatically signs a payment authorization with your wallet
- The SDK resubmits the request with the signed payment
- Server verifies payment and returns the API response
The x402 SDK handles steps 2 through 5 automatically.
Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request