curl "https://api.pmx.trade/v2/clob/positions?pubkey=7xKXabc123..."
{
"positions": [
{
"id": "d4e5f6a7-...",
"marketId": "550e8400-...",
"ownerPubkey": "7xKXabc123...",
"outcome": "yes",
"netQuantity": "50000000",
"avgEntryPrice": 5500,
"totalCost": "27500000",
"totalProceeds": "0",
"totalFees": "550000",
"realizedPnl": "0",
"unrealizedPnl": "2500000",
"currentPrice": 6000,
"marketSlug": "btc-100k-2025",
"marketTitle": "Will BTC hit $100K?",
"marketStatus": "active",
"updatedAt": "2025-01-15T12:05:00.000Z"
}
]
}
Get positions and P&L for a wallet, optionally filtered by market.
curl "https://api.pmx.trade/v2/clob/positions?pubkey=7xKXabc123..."
{
"positions": [
{
"id": "d4e5f6a7-...",
"marketId": "550e8400-...",
"ownerPubkey": "7xKXabc123...",
"outcome": "yes",
"netQuantity": "50000000",
"avgEntryPrice": 5500,
"totalCost": "27500000",
"totalProceeds": "0",
"totalFees": "550000",
"realizedPnl": "0",
"unrealizedPnl": "2500000",
"currentPrice": 6000,
"marketSlug": "btc-100k-2025",
"marketTitle": "Will BTC hit $100K?",
"marketStatus": "active",
"updatedAt": "2025-01-15T12:05:00.000Z"
}
]
}
Show Position object
yes or no.null if no price available.null if no liquidity.null.null.active, paused, resolved), or null.curl "https://api.pmx.trade/v2/clob/positions?pubkey=7xKXabc123..."
{
"positions": [
{
"id": "d4e5f6a7-...",
"marketId": "550e8400-...",
"ownerPubkey": "7xKXabc123...",
"outcome": "yes",
"netQuantity": "50000000",
"avgEntryPrice": 5500,
"totalCost": "27500000",
"totalProceeds": "0",
"totalFees": "550000",
"realizedPnl": "0",
"unrealizedPnl": "2500000",
"currentPrice": 6000,
"marketSlug": "btc-100k-2025",
"marketTitle": "Will BTC hit $100K?",
"marketStatus": "active",
"updatedAt": "2025-01-15T12:05:00.000Z"
}
]
}
(netQuantity × currentPrice / 10000) - totalCost. It uses the orderbook mid-price (average of best bid and best ask). If only one side has liquidity, that price is used. Returns null if no orders exist.Realized P&L accumulates each time you sell tokens. On each sell, the engine computes proceeds - proportionalCostBasis - fees using weighted average cost.