Get Portfolio (PREDICTION_TRADE)
API Description
Get the authenticated user's prediction portfolio overview including active positions count, aggregated PnL, and full position list.
HTTP Request
GET /sapi/v1/w3w/wallet/prediction/pnl/portfolio
Request Weight(IP)
200
Request Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| walletAddress | STRING | YES | User's prediction wallet address |
| tokenId | STRING | NO | Filter by prediction token ID |
| marketId | LONG | NO | Filter by market ID. Must be > 0 |
| marketTopicId | LONG | NO | Filter by market topic ID. Must be > 0 |
| activeOnly | BOOLEAN | NO | If true, return only active (unresolved) positions |
Response Example
{
"chainId": "56",
"walletAddress": "0x12e32db8817e292508c34111cbc4b23340df542c",
"activePositionsCount": 3,
"totalRealizedPnl": "120.50",
"totalUnrealizedPnl": "15.30",
"totalPnl": "135.80",
"totalCostBasis": "450.00",
"totalCurrentValue": "465.30",
"positions": [
{
"id": 10001,
"chainId": "56",
"userId": 100103755893,
"walletAddress": "0x12e32db8817e292508c34111cbc4b23340df542c",
"marketTopicId": 4229564,
"marketId": 5567895,
"marketOutcomeId": 10001,
"tokenId": "112233",
"conditionId": "0xabc123",
"vendor": "PREDICT_FUN",
"collateralType": 1,
"currentShares": "1923.07",
"avgPrice": "0.52",
"currentPrice": "0.55",
"buyCount": 2,
"buyShares": "1923.07",
"buyAmtUsd": "1.00",
"sellCount": 0,
"sellShares": "0.00",
"sellAmtUsd": "0.00",
"redeemCount": 0,
"redeemShares": "0.00",
"redeemPayoutUsd": "0.00",
"buyFeeShares": "0.00",
"sellFeeUsd": "0.00",
"totalFeeUsd": "0.02",
"realizedPnl": "0.00",
"unrealizedPnl": "0.06",
"totalPnl": "0.06",
"pnlPercentage": "6.00",
"isResolved": false,
"isWinner": null,
"lastEventTime": 1748132000000,
"lastEventTxHash": null,
"blockNumber": 12345678
}
]
}