curl --request GET \
--url 'https://uk.raze.sh/api/sol/wallets/{address}/pnl?apiKey='{
"success": true,
"address": "<string>",
"mode": "fifo",
"data": {
"totalRealizedPnlSol": 123,
"totalRealizedPnlUsd": 123,
"totalUnrealizedCostSol": 123,
"totalUnrealizedCostUsd": 123,
"tokenCount": 123,
"tokens": [
{
"mint": "<string>",
"realizedPnlSol": 123,
"totalCostBasis": 123,
"unrealizedCostSol": 123,
"unrealizedTokens": 123,
"unrealizedLots": 123,
"totalBuys": 123,
"totalSells": 123
}
]
},
"tradesProcessed": 123,
"truncated": true,
"solPriceUsd": 123,
"timestamp": "2023-11-07T05:31:56Z"
}Computes per-token realized PnL using FIFO (First In, First Out) cost-basis accounting. Each sell is matched against the oldest remaining buy lots to determine the exact cost basis consumed. Returns per-token breakdown plus aggregated totals in SOL and USD.
curl --request GET \
--url 'https://uk.raze.sh/api/sol/wallets/{address}/pnl?apiKey='{
"success": true,
"address": "<string>",
"mode": "fifo",
"data": {
"totalRealizedPnlSol": 123,
"totalRealizedPnlUsd": 123,
"totalUnrealizedCostSol": 123,
"totalUnrealizedCostUsd": 123,
"tokenCount": 123,
"tokens": [
{
"mint": "<string>",
"realizedPnlSol": 123,
"totalCostBasis": 123,
"unrealizedCostSol": 123,
"unrealizedTokens": 123,
"unrealizedLots": 123,
"totalBuys": 123,
"totalSells": 123
}
]
},
"tradesProcessed": 123,
"truncated": true,
"solPriceUsd": 123,
"timestamp": "2023-11-07T05:31:56Z"
}Start timestamp (Unix seconds). If older than 30 days, queries full history from cold storage.
End timestamp (Unix seconds)
Maximum number of trades to process for FIFO calculation
x <= 50000