Fetch Wallet PNLs
Get realized and unrealized PnL, win rate, trade volume, and per-token performance for any Solana wallet. All metrics are derived from vetted markets only—no junk pools or wash trading—so your copy-trading dashboards and portfolio analytics stay accurate.
Why This Endpoint?
Wallet PnL answers: "How is this wallet performing?"
The Vybe PnL endpoint provides:
- Realized and unrealized PnL in USD over 1d, 7d, 30d, or full history
- Win rate and trade counts (winning vs losing trades)
- Per-token breakdown: buys/sells, volume, PnL per token
- Best and worst performing tokens for the period
- Optional PnL trend (e.g. 7-day series) for charts
Use it for copy-trading leaderboards, portfolio reviews, trader leaderboards, and any app that needs trusted wallet performance metrics.
Endpoint
GET /v4/wallets/{accountAddress}/pnl
Replaces: GET /account/pnl/{ownerAddress}
Parameters
| Parameter | Type | Description |
|---|---|---|
accountAddress | string | Wallet public key (path, required) |
resolution | string | Time window: 1d, 7d, 30d, or Full. Default 1d |
mintAddress | string | Filter results to a single token (optional) |
sortByAsc | string | Sort ascending: e.g. realizedPnlUsd, tokenSymbol, tradesVolumeUsd |
sortByDesc | string | Sort descending (same fields). Only one of sortByAsc/sortByDesc |
limit | number | Entries per page (max 1000). Default 1000 |
page | number | Page number (0-indexed) |
Example Request
curl "https://api.vybenetwork.com/v4/wallets/7Tar8QZTrRPwoGY5Ke9Vfwf6CmpBfekrNofERxgReza/pnl?resolution=7d&sortByDesc=realizedPnlUsd&limit=10" \
-H "X-API-Key: YOUR_API_KEY"Example Response
{
"summary": {
"winRate": 0.62,
"realizedPnlUsd": "1234.56",
"unrealizedPnlUsd": "89.12",
"uniqueTokensTraded": 12,
"averageTradeUsd": "456.78",
"tradesCount": 84,
"winningTradesCount": 52,
"losingTradesCount": 32,
"tradesVolumeUsd": "38369.52",
"bestPerformingToken": { "mintAddress": "...", "symbol": "BONK", "realizedPnlUsd": "890.00" },
"worstPerformingToken": { "mintAddress": "...", "symbol": "XYZ", "realizedPnlUsd": "-120.00" },
"pnlTrendSevenDays": []
},
"tokenMetrics": [
{
"mintAddress": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"tokenSymbol": "BONK",
"buysTransactionCount": 5,
"buysTokenAmount": "1000000",
"buysVolumeUsd": "25.50",
"sellsTransactionCount": 3,
"sellsTokenAmount": "600000",
"sellsVolumeUsd": "18.20",
"realizedPnlUsd": "2.45",
"unrealizedPnlUsd": "1.10"
}
]
}Response Fields Explained
Summary
| Field | Description |
|---|---|
winRate | Fraction of trades that were profitable (0–1) |
realizedPnlUsd | Realized profit/loss in USD for the period |
unrealizedPnlUsd | Unrealized PnL on current holdings |
uniqueTokensTraded | Number of distinct tokens traded |
tradesCount | Total number of trades |
winningTradesCount / losingTradesCount | Counts of profitable vs losing trades |
tradesVolumeUsd | Total USD volume of trades |
bestPerformingToken / worstPerformingToken | Token with highest/lowest realized PnL |
pnlTrendSevenDays | Optional time series for PnL-over-time charts |
tokenMetrics (per token)
| Field | Description |
|---|---|
mintAddress | Token mint public key |
tokenSymbol | Token ticker |
buysTransactionCount / sellsTransactionCount | Buy/sell trade counts |
buysVolumeUsd / sellsVolumeUsd | Buy/sell volume in USD |
realizedPnlUsd / unrealizedPnlUsd | Realized and unrealized PnL for this token |
Common Use Cases
| Use Case | Implementation |
|---|---|
| Copy-trading dashboard | Show PnL and win rate for leaderboard wallets |
| Portfolio review | Aggregate realized/unrealized PnL for a connected wallet |
| Token-level analysis | Filter by mintAddress or sort by realizedPnlUsd |
| Top traders feed | Combine with Top Traders for rankings |
| Tax / reporting | Use resolution=Full and export tokenMetrics |
Best Practices
Choose the right resolution
- 1d – Daily performance, leaderboards
- 7d – Weekly recap, short-term copy trading
- 30d – Monthly reports
- Full – All-time stats, tax or long-term analysis
Filter to one token
When building a “PnL for this token” view, pass mintAddress:
?v4/wallets/{address}/pnl?resolution=30d&mintAddress=DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
Sort for leaderboards
Sort by realized PnL descending to show top performers:
?resolution=7d&sortByDesc=realizedPnlUsd&limit=20
Related Endpoints
- Realtime Wallet Balances – Current token holdings and values
- Historical Wallet Balances – Portfolio value over time
- Top Traders – Leaderboard by PnL
- Token Balances – Combine PnL with current balances for a full wallet view
Updated about 6 hours ago