Skip to main content
GET
/
v2
/
pnl
/
wallets
/
{wallet}
/
tokens
/
{token}
SDK
import { Client } from '@solana-tracker/data-api';

const client = new Client({ apiKey: 'YOUR_API_KEY' });

const data = await client.getPnlV2WalletTokenPosition('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');
curl --request GET \
--url https://data.solanatracker.io/v2/pnl/wallets/{wallet}/tokens/{token} \
--header 'x-api-key: <api-key>'
import requests

url = "https://data.solanatracker.io/v2/pnl/wallets/{wallet}/tokens/{token}"

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/v2/pnl/wallets/{wallet}/tokens/{token}', 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/v2/pnl/wallets/{wallet}/tokens/{token}",
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/v2/pnl/wallets/{wallet}/tokens/{token}"

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/v2/pnl/wallets/{wallet}/tokens/{token}")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://data.solanatracker.io/v2/pnl/wallets/{wallet}/tokens/{token}")

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
{
  "wallet": "CyaE1VxvBrahnPWkqm5VsdCvyS2QmNht2UFrKJHga54o",
  "identity": {
    "name": "Cented",
    "twitter": "@Cented7",
    "avatar": "https://kol-avatar.solanatracker.io/CyaE1VxvBrahnPWkqm5VsdCvyS2QmNht2UFrKJHga54o",
    "platforms": [
      "axiom",
      "bloom"
    ],
    "type": "kol",
    "tags": [
      "kol",
      "axiom",
      "bloom"
    ]
  },
  "pnlMode": "strict",
  "token": "41kjWDNs9gfJww2FtTUYKk3ZRLRvokSxHNhfXTsapump",
  "pnl": {
    "realized": 62.77,
    "realizedRaw": 62.77,
    "unrealized": 0,
    "total": 62.77
  },
  "invested": 305.23,
  "proceeds": 368,
  "roi": 20.56,
  "current": {
    "balance": 0,
    "costBasis": 0,
    "value": 0,
    "price": 0.000002870182480858,
    "avgCost": 0
  },
  "volume": {
    "tokensBought": 27789808.22406,
    "tokensSold": 27789808.22406,
    "buyUsd": 305.23,
    "sellUsd": 368
  },
  "averages": {
    "buy": 101.74,
    "sell": 368
  },
  "counts": {
    "buys": 3,
    "sells": 1,
    "total": 4
  },
  "timing": {
    "firstBuy": 1779724371752,
    "lastBuy": 1779724381730,
    "firstSell": 1779724398824,
    "lastSell": 1779724398824,
    "firstTrade": 1779724371752,
    "lastTrade": 1779724398824,
    "holdTimeSecs": 27
  },
  "meta": {
    "symbol": "T&J",
    "name": "Tom & Jerry",
    "price": 0.000002870182480858,
    "marketCap": 2870.18,
    "liquidity": 5620.34,
    "primaryMarket": "pumpfun"
  }
}
{
"error": "<string>"
}
{
"error": "<string>"
}

SDK Example

import { Client } from '@solana-tracker/data-api';

const client = new Client({ apiKey: 'YOUR_API_KEY' });

const data = await client.getPnlV2WalletTokenPosition('FbMxP3GVq8TQ36nbYgx4NP9iygMpwAwFWJwW81ioCiSF', '6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN');

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

wallet
string
required

Solana wallet address (base58, 32-44 characters).

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
token
string
required

Solana token mint address (base58, 32-44 characters).

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$

Query Parameters

pnlMode
enum<string>
default:strict

How to treat positions flagged by the invalid PnL heuristic. strict zeros them out, adjusted caps them to a cost-basis-aware value, and raw leaves realized PnL untouched. Aliases pnl_mode and mode are also accepted by the API.

Available options:
strict,
adjusted,
raw

Response

Successful response.

A single token position for a wallet.

wallet
string
identity
object

Unified wallet identity. Only fields with known values are returned; a wallet can carry multiple tags at once.

pnlMode
enum<string>
Available options:
strict,
adjusted,
raw
token
string

Token mint address (base58).

pnl
object

Realized, unrealized, and total profit/loss in USD.

invested
number | null

Total cost basis (USD spent buying this token).

proceeds
number | null

Total USD received from sales of this token.

roi
number | null

Return on investment percentage.

current
object
volume
object
averages
object
counts
object
timing
object
meta
object

Basic token metadata and current market data.

portfolioPercent
number | null

This position's value as a percentage of the wallet's total holdings value. Only present on the positions endpoint.