Skip to main content
Room ID: polymarket_trader_pnl_exits
Endpoint: wss://api.struct.to/ws
Rate: 0.025 credits per message
Stream one marker per position close for tracked traders, batched per block. Each marker captures the realized PnL and the reason a position closed, so you can overlay exits directly onto a PnL chart.
Related guide: PnL chart with exit markers plots realized PnL and annotates each close with its exit reason.

Exit reasons

ReasonMeaning
resolved_winHeld to market resolution and won by verdict
resolved_lossHeld to market resolution and lost by verdict
sold_winClosed before resolution with positive realized PnL
sold_lossClosed before resolution with negative realized PnL

Subscribe

The traders filter is required.

Filters

FilterTypeRequiredDescription
tradersstring[]YesEVM wallet addresses (0x-prefixed), non-empty
reasonsstring[]NoSubset of ["resolved_win","resolved_loss","sold_win","sold_loss"], or ["all"]

Example

{
  "type": "join_room",
  "payload": {
    "room_id": "polymarket_trader_pnl_exits"
  }
}
{
  "type": "room_message",
  "payload": {
    "room_id": "polymarket_trader_pnl_exits",
    "message": {
      "action": "subscribe",
      "traders": ["0x1234567890abcdef1234567890abcdef12345678"]
    }
  }
}

Response

{
  "type": "trader_exit_markers_stream_subscribe_response",
  "room_id": "polymarket_trader_pnl_exits",
  "data": {
    "traders": ["0x1234567890abcdef1234567890abcdef12345678"],
    "rejected": [],
    "error": null
  }
}

Events

trader_exit_marker_batch

One marker per position close.
{
  "type": "trader_exit_marker_batch",
  "room_id": "polymarket_trader_pnl_exits",
  "block": 68420001,
  "data": [
    {
      "trader": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
      "position_id": "12345678901234567",
      "condition_id": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
      "event_slug": "bitcoin-price-markets",
      "market_slug": "will-bitcoin-hit-100k",
      "title": "Will Bitcoin hit $100k?",
      "question": "Will Bitcoin hit $100k by end of year?",
      "image_url": "https://polymarket.com/images/market.png",
      "outcome": "Yes",
      "outcome_index": 0,
      "pnl_usd": 350.25,
      "pnl_pct": 35.9,
      "cost_basis_usd": 975.0,
      "reason": "sold_win",
      "block": 68420001,
      "ts": 1743500000
    }
  ]
}
FieldTypeDescription
traderstringWallet address
position_idstringERC-1155 token ID (decimal string)
condition_idstringCondition ID
event_slugstringOwning event slug
market_slugstringMarket slug
titlestringMarket title
questionstringMarket question
image_urlstringMarket image URL
outcomestringOutcome label (for example Yes)
outcome_indexint | nullOutcome index
pnl_usdnumberRealized PnL at exit, in USD
pnl_pctnumberRealized PnL as a percentage
cost_basis_usdnumberCost basis of the closed position, in USD
reasonstringExit reason (see taxonomy above)
blockint64Block of the exit
tsint64Exit timestamp (Unix seconds)
Last modified on June 13, 2026