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

# Get trader position exits

> Position exit markers for a trader.



## OpenAPI

````yaml https://api.struct.to/openapi.json get /polymarket/trader/pnl/{address}/exits
openapi: 3.1.0
info:
  title: Polymarket API
  description: >-
    RESTful API for querying Polymarket prediction markets data including
    events, markets, traders, holders, and real-time metrics
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.struct.to/v1
security: []
paths:
  /polymarket/trader/pnl/{address}/exits:
    get:
      tags:
        - Trader
      summary: Get trader position exits
      description: Position exit markers for a trader.
      operationId: get_trader_pnl_exits
      parameters:
        - name: address
          in: path
          description: Trader wallet address
          required: true
          schema:
            type: string
        - name: timeframe
          in: query
          description: 'Default: lifetime'
          required: false
          schema:
            $ref: '#/components/schemas/PnlCandleTimeframe'
        - name: from
          in: query
          description: Start unix seconds. Overrides the timeframe lower bound.
          required: false
          schema:
            type: integer
            format: int64
        - name: to
          in: query
          description: End unix seconds
          required: false
          schema:
            type: integer
            format: int64
        - name: reason
          in: query
          description: Return only exits with this reason
          required: false
          schema:
            $ref: '#/components/schemas/PnlExitReason'
        - name: category
          in: query
          description: Return only exits in this market category
          required: false
          schema:
            $ref: '#/components/schemas/PolymarketCategory'
        - name: count_back
          in: query
          description: Maximum exits to return. Default 500, max 2500.
          required: false
          schema:
            type: integer
            format: int32
        - name: limit
          in: query
          description: Alias for count_back. Default 500, max 2500.
          required: false
          schema:
            type: integer
            format: int32
        - name: sort_by
          in: query
          description: >-
            Sort field. Default exit_time. Includes the fee-excluded
            `raw_pnl_usd` / `raw_pnl_pct` metrics.
          required: false
          schema:
            $ref: '#/components/schemas/PositionExitPnlSortBy'
        - name: sort_direction
          in: query
          description: Sort direction for sort_by. Default desc.
          required: false
          schema:
            $ref: '#/components/schemas/SortDirection'
        - name: profitability
          in: query
          description: 'Shortcut: highest or lowest. Sorts by pnl_pct desc/asc.'
          required: false
          schema:
            type: string
        - name: min_pnl_usd
          in: query
          description: Minimum realized PnL USD to include.
          required: false
          schema:
            type: number
            format: double
        - name: max_pnl_usd
          in: query
          description: Maximum realized PnL USD to include.
          required: false
          schema:
            type: number
            format: double
        - name: min_pnl_pct
          in: query
          description: Minimum realized PnL percent to include.
          required: false
          schema:
            type: number
            format: double
        - name: max_pnl_pct
          in: query
          description: Maximum realized PnL percent to include.
          required: false
          schema:
            type: number
            format: double
        - name: offset
          in: query
          description: Offset for ranked sort pagination. Max 3500.
          required: false
          schema:
            type: integer
            format: int32
        - name: pagination_key
          in: query
          description: Cursor from a previous response
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Trader position exits
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PnlExitMarker'
        '400':
          description: Invalid params or endpoint disabled
components:
  schemas:
    PnlCandleTimeframe:
      type: string
      enum:
        - 1d
        - 7d
        - 30d
        - lifetime
    PnlExitReason:
      type: string
      description: 'Reason a position closed: a 2×2 of resolved-vs-sold and win-vs-loss.'
      enum:
        - resolved_win
        - resolved_loss
        - sold_win
        - sold_loss
    PolymarketCategory:
      type: string
      description: Polymarket UI category.
      enum:
        - Politics
        - Sports
        - Crypto
        - Finance
        - Culture
        - Mentions
        - Weather
        - Economics
        - Tech
    PositionExitPnlSortBy:
      type: string
      description: |-
        Sort field for trader position exits. Includes fee-excluded exit PnL
        metrics.
      enum:
        - exit_time
        - pnl_usd
        - pnl_pct
        - raw_pnl_usd
        - raw_pnl_pct
        - cost_basis_usd
    SortDirection:
      type: string
      enum:
        - asc
        - desc
    PnlExitMarker:
      type: object
      description: A single position exit, sized and labelled for overlay on the PnL chart.
      required:
        - t
        - block
        - condition
        - position
        - event_slug
        - market_slug
        - title
        - question
        - image_url
        - outcome
        - category
        - pnl_usd
        - pnl_pct
        - cost_basis_usd
        - reason
      properties:
        t:
          type: integer
          format: int64
          description: Exit time in unix seconds.
          minimum: 0
        block:
          type: integer
          format: int64
          description: Block number the exit was recorded at.
        condition:
          type: string
          description: Market condition ID.
        position:
          type: string
          description: Outcome token ID.
        event_slug:
          type: string
          description: Event slug.
        market_slug:
          type: string
          description: Market slug.
        title:
          type: string
          description: Market title.
        question:
          type: string
          description: Market question.
        image_url:
          type: string
          description: Market image URL.
        outcome:
          type: string
          description: Outcome name.
        outcome_index:
          type:
            - integer
            - 'null'
          format: int32
          description: Outcome index within the market, when known.
          minimum: 0
        category:
          type: string
          description: |-
            Polymarket top-level category (e.g. "Politics"). Empty when the
            market's tags hadn't resolved to a category at exit time.
        pnl_usd:
          type: number
          format: double
          description: Realized PnL in USD for the position at exit.
        pnl_pct:
          type: number
          format: double
          description: Realized PnL percent for the position at exit.
        cost_basis_usd:
          type: number
          format: double
          description: Amount paid into the position, in USD.
        reason:
          $ref: '#/components/schemas/PnlExitReason'
          description: Why the position closed.

````