Liquidity events
curl --get "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}" \
--header "x-api-key: YOUR_API_KEY" \
--data-urlencode "events=liquidity" \
--data-urlencode "enrich=identity" \
--data-urlencode "limit=50"import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getUserTokenTradeHistory('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN', 'FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', {
events: 'all', // Use 'liquidity' for LP adds/removes only, or 'trades' for swaps.
enrich: 'identity',
currency: 'usd', // Adds a per-token price to each swap: 'usd', 'eur' or 'sol'.
marketCap: true,
limit: 100,
sortDirection: 'DESC',
});
import requests
url = "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"trades": [
{
"tx": "5V4apVkgHf49J5acYPiuh5rB89EGsF8ocSysgnD9vFfZsTtDamhN3MFDKJSq7Dn7Z6Y5XhjghuVYuvvYWnSFpnvW",
"amount": 90,
"priceUsd": 6,
"volume": 540,
"volumeSol": 3,
"type": "sell",
"wallet": "F7R61te4Ac8xZ4pfkJUdF6iaaHy9tnM8nVRUPv8H8EMi",
"time": 1789722000000,
"program": "pumpfun-amm",
"pools": [
"9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2"
]
}
],
"nextCursor": null,
"hasNextPage": false,
"sortDirection": "DESC"
}Trades
Solana 钱包单币交易记录 API
获取某个钱包对某个 Solana 代币的活动记录。端点:GET /trades//by-wallet/。
GET
/
trades
/
{tokenAddress}
/
by-wallet
/
{owner}
Liquidity events
curl --get "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}" \
--header "x-api-key: YOUR_API_KEY" \
--data-urlencode "events=liquidity" \
--data-urlencode "enrich=identity" \
--data-urlencode "limit=50"import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getUserTokenTradeHistory('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN', 'FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', {
events: 'all', // Use 'liquidity' for LP adds/removes only, or 'trades' for swaps.
enrich: 'identity',
currency: 'usd', // Adds a per-token price to each swap: 'usd', 'eur' or 'sol'.
marketCap: true,
limit: 100,
sortDirection: 'DESC',
});
import requests
url = "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/trades/{tokenAddress}/by-wallet/{owner}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"trades": [
{
"tx": "5V4apVkgHf49J5acYPiuh5rB89EGsF8ocSysgnD9vFfZsTtDamhN3MFDKJSq7Dn7Z6Y5XhjghuVYuvvYWnSFpnvW",
"amount": 90,
"priceUsd": 6,
"volume": 540,
"volumeSol": 3,
"type": "sell",
"wallet": "F7R61te4Ac8xZ4pfkJUdF6iaaHy9tnM8nVRUPv8H8EMi",
"time": 1789722000000,
"program": "pumpfun-amm",
"pools": [
"9d9mb8kooFfaD3SctgZtkxQypkshx6ezhbKio89ixyy2"
]
}
],
"nextCursor": null,
"hasNextPage": false,
"sortDirection": "DESC"
}在此端点的代币、池和钱包范围内查询活动。使用
events=all 合并兑换交易与流动性增减,或使用 events=liquidity 仅获取流动性。省略 events 则保持仅返回兑换交易的行为。添加 enrich=identity 可获取两类记录的钱包身份。
流动性记录的类型为 add_liquidity 或 remove_liquidity,包含单个 pool 和 tokens[] 中的精确字符串数量,不含兑换价格、成交量或 PnL。REST 示例、分页和实时订阅请参阅流动性指南。
SDK Example
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getUserTokenTradeHistory('6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN', 'FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', {
events: 'all', // Use 'liquidity' for LP adds/removes only, or 'trades' for swaps.
enrich: 'identity',
currency: 'usd', // Adds a per-token price to each swap: 'usd', 'eur' or 'sol'.
marketCap: true,
limit: 100,
sortDirection: 'DESC',
});
查询参数
响应
Successful response
此页面对您有帮助吗?