curl --request GET \
--url https://public-api.birdeye.so/wallet/v2/pnl \
--header 'X-API-KEY: <api-key>'import requests
url = "https://public-api.birdeye.so/wallet/v2/pnl"
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://public-api.birdeye.so/wallet/v2/pnl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"meta": {
"address": "4mwReoK1x668B6KuuSAbGm2tUQULSTHGgTpCa2jUMXtD",
"currency": "usd",
"holding_check": false,
"time": "2025-08-27T14:06:48.987054346Z"
},
"tokens": {
"So11111111111111111111111111111111111111112": {
"symbol": "SOL",
"decimals": 9,
"counts": {
"total_buy": 236570,
"total_sell": 236570,
"total_trade": 473140
},
"quantity": {
"total_bought_amount": 12092390.76837637,
"total_sold_amount": 0.00047313999999776897,
"holding": 0
},
"cashflow_usd": {
"cost_of_quantity_sold": 0.07608073802599198,
"total_invested": 1944451989.1810136,
"total_sold": 0.07602689546632857,
"current_value": 0
},
"pnl": {
"realized_profit_usd": -0.00005384255966340998,
"realized_profit_percent": -0.0707702909572399,
"unrealized_usd": 523529777.302561,
"unrealized_percent": 26.92428407777512,
"total_usd": 523529777.30250716,
"total_percent": 26.92428407671888,
"avg_profit_per_trade_usd": -2.275967352724774e-10
},
"pricing": {
"current_price": 204.09378209627866,
"avg_buy_cost": 160.79963229984938,
"avg_sell_cost": 160.6858339322126
}
},
"pumpsAkNcb1nZs89Uees3DyRzUGxjqThuzF3A8LVVfn": {
"symbol": "PUMP",
"decimals": 9,
"counts": {
"total_buy": 236570,
"total_sell": 236570,
"total_trade": 473140
},
"quantity": {
"total_bought_amount": 1.9012623099995465,
"total_sold_amount": 128820503932.7875,
"holding": 880839335.5814558
},
"cashflow_usd": {
"cost_of_quantity_sold": 5151221341.162621,
"total_invested": 0.07602689546632857,
"total_sold": 1944451989.1810136,
"current_value": 7.5417466875590655
},
"pnl": {
"realized_profit_usd": -0.04732872112474718,
"realized_profit_percent": -62.25260262759055,
"unrealized_usd": 0,
"unrealized_percent": 0,
"total_usd": -0.04732872112474718,
"total_percent": -62.25260262759055,
"avg_profit_per_trade_usd": -2.0006222735235735e-7
},
"pricing": {
"current_price": 8.562000336395786e-9,
"avg_buy_cost": 0.03998758880690519,
"avg_sell_cost": 0.015094274046587626
}
}
}
}
}{
"success": false,
"message": "Bad request"
}{
"success": false,
"message": "Unauthorized"
}{
"success": false,
"message": "Access Denied"
}{
"success": false,
"message": "Too many requests"
}{
"success": false,
"message": "Internal Server Error"
}Wallet - PnL (Per Token)
Retrieve all-time trading, holdings, cash flow, PnL, and pricing metrics for each specified token in a given wallet.
curl --request GET \
--url https://public-api.birdeye.so/wallet/v2/pnl \
--header 'X-API-KEY: <api-key>'import requests
url = "https://public-api.birdeye.so/wallet/v2/pnl"
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://public-api.birdeye.so/wallet/v2/pnl', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"meta": {
"address": "4mwReoK1x668B6KuuSAbGm2tUQULSTHGgTpCa2jUMXtD",
"currency": "usd",
"holding_check": false,
"time": "2025-08-27T14:06:48.987054346Z"
},
"tokens": {
"So11111111111111111111111111111111111111112": {
"symbol": "SOL",
"decimals": 9,
"counts": {
"total_buy": 236570,
"total_sell": 236570,
"total_trade": 473140
},
"quantity": {
"total_bought_amount": 12092390.76837637,
"total_sold_amount": 0.00047313999999776897,
"holding": 0
},
"cashflow_usd": {
"cost_of_quantity_sold": 0.07608073802599198,
"total_invested": 1944451989.1810136,
"total_sold": 0.07602689546632857,
"current_value": 0
},
"pnl": {
"realized_profit_usd": -0.00005384255966340998,
"realized_profit_percent": -0.0707702909572399,
"unrealized_usd": 523529777.302561,
"unrealized_percent": 26.92428407777512,
"total_usd": 523529777.30250716,
"total_percent": 26.92428407671888,
"avg_profit_per_trade_usd": -2.275967352724774e-10
},
"pricing": {
"current_price": 204.09378209627866,
"avg_buy_cost": 160.79963229984938,
"avg_sell_cost": 160.6858339322126
}
},
"pumpsAkNcb1nZs89Uees3DyRzUGxjqThuzF3A8LVVfn": {
"symbol": "PUMP",
"decimals": 9,
"counts": {
"total_buy": 236570,
"total_sell": 236570,
"total_trade": 473140
},
"quantity": {
"total_bought_amount": 1.9012623099995465,
"total_sold_amount": 128820503932.7875,
"holding": 880839335.5814558
},
"cashflow_usd": {
"cost_of_quantity_sold": 5151221341.162621,
"total_invested": 0.07602689546632857,
"total_sold": 1944451989.1810136,
"current_value": 7.5417466875590655
},
"pnl": {
"realized_profit_usd": -0.04732872112474718,
"realized_profit_percent": -62.25260262759055,
"unrealized_usd": 0,
"unrealized_percent": 0,
"total_usd": -0.04732872112474718,
"total_percent": -62.25260262759055,
"avg_profit_per_trade_usd": -2.0006222735235735e-7
},
"pricing": {
"current_price": 8.562000336395786e-9,
"avg_buy_cost": 0.03998758880690519,
"avg_sell_cost": 0.015094274046587626
}
}
}
}
}{
"success": false,
"message": "Bad request"
}{
"success": false,
"message": "Unauthorized"
}{
"success": false,
"message": "Access Denied"
}{
"success": false,
"message": "Too many requests"
}{
"success": false,
"message": "Internal Server Error"
}- Usage Note
- Accessibility
- Chain Supported
Per-token wallet PnL.
- Maximum number of tokens per request is
50. - Notes on data: trade data per protocol aren’t backfilled and might affect the calculation of PnL.
pnl_methodsupportsnetcashandwacso you can align the response with your accounting method.meta:address: wallet address.currency: the currency in which PnL is calculated, such as USD.tokens[<token_address>]includes counts, quantity, cashflow, PnL, and pricing blocks for each token.- Insights in the response:
counts:total_buy: Total number of buy trades.total_sell: Total number of sell trades.total_trade: Combined total of buys and sells.total_win: Total trades have profit. Only account for fully realized tokens.total_loss: Total trades in loss. Only account for fully realized tokens.win_rate: Winning rate. Only account for fully realized tokens.cashflow_usd:total_invested: USD spent on all buys.total_sold: USD received from sales.current_value: Current position value in USD.pnl:realized_profit_usd: Profit/loss from completed trades.realized_profit_percent: % gain/loss relative to sold cost basis.unrealized_usd: Profit/loss of current holdings (mark-to-market).total_usd: Sum of realized + unrealized profit in USD.avg_profit_per_trade_usd: Average profit/loss per trade.- Quantity fields are already normalized by token decimals.
- Lite
- Starter
- Premium
- Business
- Enterprise
SVM ⛓️ ✨
EVM ⛓️ ✨
Compute Unit ⚙️
Compute Unit ⚙️
- Batch CU is calculated as
ceil(10 * wallet_count^0.8).
Use Cases 💡
Use Cases 💡
- Break a wallet’s PnL down token by token.
- Identify which assets drove gains, losses, and current unrealized exposure.
- Power wallet analytics views that need realized and unrealized PnL per holding.
How to Use 🛠️
How to Use 🛠️
- Set the supported PnL chain in
x-chain. - Pass the wallet address in
wallet. - Pass up to
50token addresses intoken_addresses. - Set
pnl_methodexplicitly when the output needs to match another reporting workflow or PnL view. - Read
pricing,cashflow_usd, andpnltogether to understand both execution and current exposure.
Best Practices ✅
Best Practices ✅
- Use this endpoint when you already know which token set you want to evaluate.
- Compare
current_valuewithtotal_investedandtotal_soldto separate realized outcomes from open positions. - Treat this endpoint as deprecated over time and prefer newer summary/detail flows where they better fit the product.
Authorizations
API key for authentication
Headers
The chain support PNL data.
solana, ethereum, arbitrum, avalanche, bsc, optimism, polygon, base, zksync, monad, hyperevm, mantle, megaeth, robinhood Query Parameters
The wallet of the account.
List of token address.
PNL calculation method. wac (Weighted Average Cost): calculates PNL for each sell against the average cost of the position held at the time of the sell. Buys only re-average the cost of the remaining inventory, and previously realized sell PNL is not affected by later trades. netcash (Net Cash): calculates PNL across the full trade history using the spread between cumulative average sell price and cumulative average buy price. The buy average includes all buys and is not reduced by sells, so later buys can change the reported PNL.
wac, net_cash Was this page helpful?

