> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polynode.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Closed Positions

> Paginated list of closed positions with full metadata and P&L.

Returns closed positions for a wallet with market metadata (title, outcome, slug) and realized P\&L. Supports pagination and sorting.

<Note>
  **Data source — read before you integrate.** This endpoint uses Polymarket's own `data-api.polymarket.com/closed-positions` format and wraps it with pagination metadata. Row field names are Polymarket's names preserved as-is — so you'll see `asset` (not `token_id`), `proxy_wallet`, `cur_price`, `title` (not `market`). Coverage follows Polymarket's closed-position dataset; positions missing there won't appear here.

  For **onchain truth** with our own P\&L calculations and consistent field naming across the rest of the API, use [`/v2/wallets/{address}/positions/onchain`](/api-reference/wallets/onchain-positions) — that endpoint returns every position the wallet has ever held (open and closed), with `token_id`, `size`, `realized_pnl`, and `unrealized_pnl` in a shape consistent with the other `/v2/onchain/*` endpoints.
</Note>

## Request

```
GET /v2/wallets/{address}/closed-positions
```

| Parameter       | Type  | Default   | Description                                                          |
| --------------- | ----- | --------- | -------------------------------------------------------------------- |
| `address`       | path  |           | Wallet address (0x-prefixed)                                         |
| `limit`         | query | 10        | Results per page (max 50)                                            |
| `offset`        | query | 0         | Pagination offset                                                    |
| `sortBy`        | query | TIMESTAMP | Sort field: `REALIZEDPNL`, `AVGPRICE`, `PRICE`, `TITLE`, `TIMESTAMP` |
| `sortDirection` | query | DESC      | `ASC` or `DESC`                                                      |
| `market`        | query |           | Filter by market slug                                                |
| `title`         | query |           | Filter by title substring                                            |

## Response

```json theme={null}
{
  "wallet": "0xbddf61af533ff524d27154e589d2d7a81510c684",
  "count": 3,
  "offset": 0,
  "limit": 3,
  "positions": [
    {
      "proxy_wallet": "0xbddf61af533ff524d27154e589d2d7a81510c684",
      "asset": "34158857981196154020624191931838064546543114916900689904269497497174344049047",
      "condition_id": "0x5346538cbfc880da50fe6b269a47e4f7cd8a38b2b120d85b1bc392d8cde6ced4",
      "avg_price": 0.316481,
      "total_bought": 654236.312162,
      "realized_pnl": 447182.949852,
      "cur_price": 1,
      "title": "Nuggets vs. Warriors",
      "slug": "nba-den-gsw-2026-02-22",
      "icon": "https://polymarket-upload.s3.us-east-2.amazonaws.com/super+cool+basketball+in+red+and+blue+wow.png",
      "event_slug": "nba-den-gsw-2026-02-22",
      "outcome": "Warriors",
      "outcome_index": 1,
      "opposite_outcome": "Nuggets",
      "opposite_asset": "107945275283604973510604597780969572155224468096168425689613528391046536169017",
      "end_date": "2026-02-22T00:00:00Z",
      "timestamp": 1771817602
    }
  ]
}
```

| Field              | Description                                                                                                                  |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| `wallet`           | Queried wallet address (lowercased)                                                                                          |
| `count`            | Number of positions returned                                                                                                 |
| `offset`           | Current pagination offset                                                                                                    |
| `limit`            | Results per page                                                                                                             |
| `proxy_wallet`     | Polymarket proxy wallet address                                                                                              |
| `asset`            | Token ID for this position (called `token_id` on the [onchain positions](/api-reference/wallets/onchain-positions) endpoint) |
| `condition_id`     | CTF condition ID                                                                                                             |
| `avg_price`        | Volume-weighted average entry price                                                                                          |
| `total_bought`     | Total tokens acquired                                                                                                        |
| `realized_pnl`     | Profit or loss for this position in USDC                                                                                     |
| `cur_price`        | Current token price (1.0 for resolved winners, 0.0 for losers)                                                               |
| `title`            | Market title                                                                                                                 |
| `slug`             | Market slug                                                                                                                  |
| `icon`             | Market icon URL                                                                                                              |
| `event_slug`       | Parent event slug                                                                                                            |
| `outcome`          | Outcome name for this position                                                                                               |
| `outcome_index`    | Index of this outcome (0 or 1 for binary markets)                                                                            |
| `opposite_outcome` | Name of the other outcome                                                                                                    |
| `opposite_asset`   | Token ID of the other outcome                                                                                                |
| `end_date`         | Market end date (ISO 8601)                                                                                                   |
| `timestamp`        | Position timestamp (UNIX seconds)                                                                                            |

## Example

```bash theme={null}
# Top 5 closed positions by realized P&L
curl "https://api.polynode.dev/v2/wallets/0xbddf61af533ff524d27154e589d2d7a81510c684/closed-positions?limit=5&sortBy=REALIZEDPNL&sortDirection=DESC" \
  -H "x-api-key: YOUR_KEY"
```


## OpenAPI

````yaml GET /v2/wallets/{address}/closed-positions
openapi: 3.1.0
info:
  title: PolyNode API
  description: >-
    Real-time Polymarket data API with decoded mempool settlements, OHLCV
    candles, and full Polygon JSON-RPC proxy.
  contact:
    name: PolyNode
    url: https://polynode.dev
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.polynode.dev
    description: Production
security:
  - api_key: []
paths:
  /v2/wallets/{address}/closed-positions:
    get:
      tags:
        - Wallets
      summary: Closed positions with metadata
      description: >-
        Returns closed positions for a wallet with full market metadata (title,
        outcome, slug) and realized P&L. Supports pagination and sorting.


        Complements the onchain positions endpoint. The onchain endpoint returns
        all positions with accurate P&L but no market metadata. This endpoint
        returns closed positions with metadata.
      operationId: get_wallet_closed_positions
      parameters:
        - name: address
          in: path
          description: Wallet address (0x-prefixed)
          required: true
          schema:
            type: string
          example: '0xbddf61af533ff524d27154e589d2d7a81510c684'
        - name: limit
          in: query
          description: Results per page (max 50)
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 50
        - name: offset
          in: query
          description: Pagination offset
          schema:
            type: integer
            default: 0
            minimum: 0
        - name: sortBy
          in: query
          description: Sort field
          schema:
            type: string
            enum:
              - REALIZEDPNL
              - AVGPRICE
              - PRICE
              - TITLE
              - TIMESTAMP
            default: TIMESTAMP
        - name: sortDirection
          in: query
          description: Sort direction
          schema:
            type: string
            enum:
              - ASC
              - DESC
            default: DESC
        - name: market
          in: query
          description: Filter by market slug
          schema:
            type: string
        - name: title
          in: query
          description: Filter by title substring
          schema:
            type: string
      responses:
        '200':
          description: Closed positions with metadata
          content:
            application/json:
              example:
                wallet: '0xbddf61af533ff524d27154e589d2d7a81510c684'
                count: 1
                offset: 0
                limit: 1
                positions:
                  - proxy_wallet: '0xbddf61af533ff524d27154e589d2d7a81510c684'
                    asset: >-
                      34158857981196154020624191931838064546543114916900689904269497497174344049047
                    condition_id: >-
                      0x5346538cbfc880da50fe6b269a47e4f7cd8a38b2b120d85b1bc392d8cde6ced4
                    avg_price: 0.316481
                    total_bought: 654236.312162
                    realized_pnl: 447182.949852
                    cur_price: 1
                    title: Nuggets vs. Warriors
                    slug: nba-den-gsw-2026-02-22
                    icon: >-
                      https://polymarket-upload.s3.us-east-2.amazonaws.com/super+cool+basketball+in+red+and+blue+wow.png
                    event_slug: nba-den-gsw-2026-02-22
                    outcome: Warriors
                    outcome_index: 1
                    opposite_outcome: Nuggets
                    opposite_asset: >-
                      107945275283604973510604597780969572155224468096168425689613528391046536169017
                    end_date: '2026-02-22T00:00:00Z'
                    timestamp: 1771817602
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              example:
                error: API key required. Get one at polynode.dev
        '404':
          description: Wallet not found
          content:
            application/json:
              example:
                error: Not found.
components:
  securitySchemes:
    api_key:
      type: apiKey
      in: header
      name: x-api-key

````