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

# Get Closed Positions

> Returns all closed positions for a wallet — outcome tokens held in markets that have since resolved, with final PnL and market metadata.



## OpenAPI

````yaml openapi.json GET /v1/trader/{address}/positions/closed
openapi: 3.1.0
info:
  title: Orbscan Open API
  description: >-
    REST endpoints for Polymarket trader activity, deposits & withdrawals, and
    per-transaction action details, sourced directly from on-chain data.
  version: 1.0.0
servers:
  - url: https://api.orbscan.com
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/trader/{address}/positions/closed:
    get:
      summary: Get closed positions
      description: >-
        Returns the trader's closed positions — outcome tokens the wallet
        previously held in markets that have since resolved. Ordered by market /
        most recent trade descending. Positions here have `balance: "0"` and
        `closed: true`.
      operationId: getClosedPositions
      parameters:
        - name: address
          in: path
          required: true
          description: Trader address, `0x` + 40 hex chars.
          schema:
            type: string
            example: '0x0484e64092ba4108c2786b61e6fc052d3bf41b1a'
        - name: limit
          in: query
          required: false
          description: Page size. Defaults to 20, maximum 100.
          schema:
            type: integer
            default: 20
            maximum: 100
            minimum: 1
        - name: cursor
          in: query
          required: false
          description: >-
            Pagination cursor from the previous response's `nextCursor`. Omit
            for the first page.
          schema:
            type: string
        - name: marketIds
          in: query
          required: false
          description: Comma-separated market IDs to filter to (e.g. `?marketIds=1,2`).
          schema:
            type: string
            example: 3658111,3657996
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: OK
                  status_code:
                    type: string
                    example: '1'
                  data:
                    type: object
                    properties:
                      items:
                        type: array
                        items:
                          $ref: '#/components/schemas/OpenPosition'
                      nextCursor:
                        type: string
                        nullable: true
              example:
                message: OK
                status_code: '1'
                data:
                  items:
                    - marketId: '3658111'
                      marketSlug: btc-updown-5m-1787036100
                      eventSlug: btc-updown-5m-1787036100
                      conditionId: >-
                        0xb8dd5113e94626f2d31209d00fb46596ed7dc397b472ba995a32048b4863024f
                      marketTitle: Bitcoin Up or Down - August 18, 2:55AM-3:00AM ET
                      logo: >-
                        https://polymarket-upload.s3.us-east-2.amazonaws.com/BTC+fullsize.png
                      closed: true
                      tokenId: >-
                        89557885051081542286903003624357156109233126349016624043674353363446112914315
                      positionSide: Up
                      outcomeIndex: 0
                      balance: '0'
                      avgPrice: '0.213749'
                      currentPrice: '1'
                      avgExit: '1'
                      totalInvested: '8.54996'
                      totalBought: '40'
                      value: '0'
                      unrealizedPnl: '0'
                      realizedPnl: '31.45004'
                      totalPnl: '31.45004'
                      percentPnl: null
                      closedAt: 1787036472
                  nextCursor: 3657217|1787033766|417536012314...
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    OpenPosition:
      type: object
      properties:
        marketId:
          type: string
          description: Market ID.
        marketSlug:
          type: string
          description: Market slug.
        eventSlug:
          type: string
          description: Event slug.
        conditionId:
          type: string
          description: Condition ID.
        marketTitle:
          type: string
          description: Market title.
        logo:
          type: string
          description: Market logo URL.
        closed:
          type: boolean
          description: Whether the position is closed.
        tokenId:
          type: string
          description: Token ID.
        positionSide:
          type: string
          description: >-
            Position side. Varies by market — e.g. `Yes` / `No` for binary
            markets, `Up` / `Down` for price direction markets.
          example: 'Yes'
        outcomeIndex:
          type: integer
          description: Outcome index.
          example: 0
        balance:
          type: string
          description: Remaining position balance (shares).
        avgPrice:
          type: string
          description: Average entry price, 0–1 scale.
        currentPrice:
          type: string
          description: Current price, 0–1 scale.
        avgExit:
          type: string
          description: Average exit price, 0–1 scale.
        totalInvested:
          type: string
          description: Total invested, in USD.
        totalBought:
          type: string
          description: Cumulative shares bought.
        value:
          type: string
          description: Current position value, in USD.
        unrealizedPnl:
          type: string
          description: Unrealized PnL, in USD.
        realizedPnl:
          type: string
          description: Realized PnL, in USD.
        totalPnl:
          type: string
          description: Realized + unrealized PnL, in USD.
        percentPnl:
          type: string
          nullable: true
          description: PnL as a percentage of cost basis.
        closedAt:
          type: integer
          format: int64
          nullable: true
          description: Closing block timestamp (Unix seconds); `null` while open.
  responses:
    Unauthorized:
      description: The API key is missing or invalid.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Missing or invalid API key
              status_code:
                type: string
                example: '0'
              data:
                type: 'null'
          example:
            message: Missing or invalid API key
            status_code: '0'
            data: null
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Pass your Orbscan API key as a Bearer token, formatted as `Bearer
        <your_api_key>`.

````