Top Traders & PnL
Solana API for top token traders by realized and unrealized PnL, volume, trade counts, and wallet labels across 1d, 7d, and 30d windows.
Find the top traders for any Solana token by realized and unrealized PnL (profit and loss), trading volume, and trade count.
Use this endpoint to rank wallets trading a specific Token-2022 or SPL token. Each result includes the trader address, optional wallet labels, realized PnL, unrealized PnL, buy and sell volume, and trade counts across a selected time window.
This data is ideal for token-level leaderboards, smart money discovery, whale analysis, and identifying which wallets are consistently profiting from a specific token.
Why Top Trader PnL Matters
Top trader analysis helps you answer questions like:
- Who is making money on this token? Rank wallets by realized PnL over
1d,7d, or30d. - Which wallets are still exposed? Compare realized PnL with unrealized PnL.
- Who is actively trading? Sort by
tradesCountortotalVolumeUsdto find high-activity wallets. - Are labeled entities involved? Use
name,labels, andlogoUrlwhen available to identify known traders or entities.
Vybe's token-level PnL data goes beyond raw trades. It aggregates wallet performance for a token so you can surface profitable traders without calculating every buy, sell, and open position yourself.
Endpoint
GET /v4/tokens/{mintAddress}/top-pnl-tradersParameters
| Parameter | Type | Default | Description |
|---|---|---|---|
mintAddress | string | — | Token mint public key. Required path parameter. |
resolution | string | 1d | PnL time window. Use 1d, 7d, or 30d. |
limit | number | 1000 | Maximum number of traders to return. Must not exceed 1000. |
page | number | 0 | Page number for pagination. |
sortByAsc | string | — | Sort ascending by a supported field. Do not use with sortByDesc. |
sortByDesc | string | — | Sort descending by a supported field. Do not use with sortByAsc. |
Resolution Options
| Option | Description |
|---|---|
1d | Last day |
7d | Last 7 days |
30d | Last 30 days |
Sort Options
| Option | Description |
|---|---|
traderAddress | By trader wallet address |
realizedPnlUsd | By realized PnL in USD |
totalVolumeUsd | By total trading volume in USD |
tradesCount | By total number of trades |
Example Request
curl "https://api.vybenetwork.xyz/v4/tokens/So11111111111111111111111111111111111111112/top-pnl-traders?resolution=7d&limit=100&page=0&sortByDesc=realizedPnlUsd" \
-H "X-API-Key: YOUR_API_KEY"Example Response
{
"data": [
{
"traderAddress": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM",
"name": "Example Trader",
"labels": ["KOL"],
"logoUrl": "https://example.com/logo.png",
"realizedPnlUsd": 12345.67,
"unrealizedPnlUsd": 890.12,
"buyVolumeUsd": 125000.45,
"sellVolumeUsd": 150000.89,
"totalVolumeUsd": 275001.34,
"buyCount": 18,
"sellCount": 24,
"tradesCount": 42
},
{
"traderAddress": "7Tar8QZTrRPwoGY5Ke9Vfwf6CmpBfekrNofERxgReza",
"name": null,
"labels": [],
"logoUrl": null,
"realizedPnlUsd": 9876.54,
"unrealizedPnlUsd": -321.09,
"buyVolumeUsd": 80000.12,
"sellVolumeUsd": 92500.34,
"totalVolumeUsd": 172500.46,
"buyCount": 12,
"sellCount": 15,
"tradesCount": 27
}
]
}Response Fields Explained
| Field | Description |
|---|---|
data | Array of ranked traders for the requested token. |
traderAddress | Trader wallet public key. |
name | Trader or entity name, if available. |
labels | Labels associated with the trader, if available. |
logoUrl | Trader or entity logo URL, if available. |
realizedPnlUsd | Realized profit and loss in USD for closed trading activity. |
unrealizedPnlUsd | Unrealized profit and loss in USD for open token exposure. |
buyVolumeUsd | Total buy volume in USD for the token. |
sellVolumeUsd | Total sell volume in USD for the token. |
totalVolumeUsd | Total buy and sell volume in USD for the token. |
buyCount | Total number of buy trades for the token. |
sellCount | Total number of sell trades for the token. |
tradesCount | Total number of buy and sell trades for the token. |
Common Use Cases
| Use Case | Implementation |
|---|---|
| Trader Leaderboard | Rank wallets by realizedPnlUsd for a specific token. |
| Smart Money Discovery | Find profitable wallets with high totalVolumeUsd. |
| Whale Trading Analysis | Track high-volume traders over 1d, 7d, or 30d. |
| Position Risk Analysis | Compare realizedPnlUsd and unrealizedPnlUsd. |
| Activity Filtering | Sort by tradesCount to find the most active token traders. |
| Entity Analysis | Use name, labels, and logoUrl to identify known traders. |
Trader Leaderboard Example
Build a leaderboard that ranks traders by realized PnL and shows their total PnL, volume, and trade count:
const API_KEY = process.env.VYBE_API_KEY;
const BASE_URL = "https://api.vybenetwork.xyz/v4";
async function fetchTopTraderLeaderboard(mintAddress) {
const url = new URL(`${BASE_URL}/tokens/${mintAddress}/top-pnl-traders`);
url.searchParams.set("resolution", "7d");
url.searchParams.set("limit", "25");
url.searchParams.set("page", "0");
url.searchParams.set("sortByDesc", "realizedPnlUsd");
const response = await fetch(url, {
headers: { "X-API-Key": API_KEY }
});
if (!response.ok) {
const error = await response.json().catch(() => ({}));
throw new Error(
`Vybe API error ${response.status}: ${error.message || "Request failed"}`
);
}
const { data } = await response.json();
return data.map((trader, index) => {
const realizedPnl = Number(trader.realizedPnlUsd);
const unrealizedPnl = Number(trader.unrealizedPnlUsd);
const totalPnl = realizedPnl + unrealizedPnl;
return {
rank: index + 1,
address: trader.traderAddress,
name: trader.name || "Unknown trader",
labels: trader.labels,
realizedPnlUsd: realizedPnl.toFixed(2),
unrealizedPnlUsd: unrealizedPnl.toFixed(2),
totalPnlUsd: totalPnl.toFixed(2),
totalVolumeUsd: Number(trader.totalVolumeUsd).toFixed(2),
tradesCount: trader.tradesCount
};
});
}
fetchTopTraderLeaderboard("So11111111111111111111111111111111111111112")
.then(console.table)
.catch((error) => {
console.error(error.message);
process.exitCode = 1;
});Successful output:
┌─────────┬──────┬────────────────────────────────────────────────┬──────────────────┬──────────┬────────────────┬──────────────────┬─────────────┬────────────────┬─────────────┐
│ (index) │ rank │ address │ name │ labels │ realizedPnlUsd │ unrealizedPnlUsd │ totalPnlUsd │ totalVolumeUsd │ tradesCount │
├─────────┼──────┼────────────────────────────────────────────────┼──────────────────┼──────────┼────────────────┼──────────────────┼─────────────┼────────────────┼─────────────┤
│ 0 │ 1 │ '9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM' │ 'Example Trader' │ [ 'KOL' ]│ '12345.67' │ '890.12' │ '13235.79' │ '275001.34' │ 42 │
└─────────┴──────┴────────────────────────────────────────────────┴──────────────────┴──────────┴────────────────┴──────────────────┴─────────────┴────────────────┴─────────────┘Smart Money Filter Example
Filter for traders that are profitable, active, and trading meaningful volume:
const API_KEY = process.env.VYBE_API_KEY;
const BASE_URL = "https://api.vybenetwork.xyz/v4";
async function findSmartMoneyTraders(mintAddress) {
const url = new URL(`${BASE_URL}/tokens/${mintAddress}/top-pnl-traders`);
url.searchParams.set("resolution", "30d");
url.searchParams.set("limit", "1000");
url.searchParams.set("sortByDesc", "totalVolumeUsd");
const response = await fetch(url, {
headers: { "X-API-Key": API_KEY }
});
if (!response.ok) {
const error = await response.json().catch(() => ({}));
return {
success: false,
status: response.status,
message: error.message || "Unable to fetch top traders",
errorId: error.id
};
}
const { data } = await response.json();
const traders = data
.map((trader) => ({
address: trader.traderAddress,
name: trader.name || "Unknown trader",
labels: trader.labels,
realizedPnlUsd: Number(trader.realizedPnlUsd),
unrealizedPnlUsd: Number(trader.unrealizedPnlUsd),
totalVolumeUsd: Number(trader.totalVolumeUsd),
tradesCount: trader.tradesCount
}))
.filter((trader) => trader.realizedPnlUsd > 0)
.filter((trader) => trader.totalVolumeUsd >= 10000)
.filter((trader) => trader.tradesCount >= 5)
.sort((a, b) => b.realizedPnlUsd - a.realizedPnlUsd);
return {
success: true,
count: traders.length,
traders
};
}Troubleshooting
| Status | Cause | Fix |
|---|---|---|
400 | Invalid query parameters. | Use 1d, 7d, or 30d for resolution, keep limit at 1000 or lower, and send only one sort parameter. |
403 | Missing or invalid API key. | Send your API key in the X-API-Key header. |
500 | Unexpected server error. | Retry the request. If it continues, include the returned id when contacting support. |
Related Endpoints
- Fetch Wallet PNLs - Analyze PnL for a specific wallet across tokens
- Fetch Historical Trades - Inspect token-level trade history
- Token Details - Token metadata and market metrics
- Labeled Wallets - Identify known wallets and entities
Updated about 4 hours ago