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

# Wallet Positions

> Get open and historical positions for a wallet address

Fetch positions for a Polymarket wallet with cost basis, current value, and P\&L.

<Warning>
  **Rolling total PnL accuracy timeline** - Total PnL (realized + unrealized - net fees) uses rolling windows that need time to accumulate full data:

  * **All-time total PnL**: accurate immediately (February 10, 2026)
  * **1-day rolling total PnL**: fully accurate starting February 11, 2026
  * **7-day rolling total PnL**: fully accurate starting February 17, 2026
  * **30-day rolling total PnL**: fully accurate starting March 12, 2026
</Warning>

| Constraint       | Value                                                                                                                                          |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `limit`          | 1–200 (default 100)                                                                                                                            |
| `include_closed` | `false` by default - only open (non-zero-balance) positions are returned. Pass `include_closed=true` to include closed/zero-balance positions. |


## OpenAPI

````yaml GET /v2/polymarket/wallet/positions/{wallet}
openapi: 3.1.0
info:
  title: Predexon API
  description: Prediction market data aggregation and matching API
  version: 2.0.0
servers:
  - url: https://api.predexon.com
security:
  - apiKey: []
paths:
  /v2/polymarket/wallet/positions/{wallet}:
    get:
      tags:
        - polymarket
      summary: Get Wallet Positions
      description: >-
        Fetch current positions for a wallet address.


        Returns all open positions with cost basis, current market prices, and
        P&L calculations.

        Supports filtering by market_slug or condition_id.
      operationId: get_wallet_positions_v2_polymarket_wallet_positions__wallet__get
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
            description: Wallet address to fetch positions for
            title: Wallet
          description: Wallet address to fetch positions for
        - name: include_closed
          in: query
          required: false
          schema:
            type: boolean
            description: Include zero-balance (closed) positions
            default: false
            title: Include Closed
          description: Include zero-balance (closed) positions
        - name: min_shares
          in: query
          required: false
          schema:
            type: number
            minimum: 0
            description: Minimum number of shares to include
            default: 0
            title: Min Shares
          description: Minimum number of shares to include
        - name: market_slug
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by market slug
            title: Market Slug
          description: Filter by market slug
        - name: condition_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter to a specific market by condition ID
            title: Condition Id
          description: Filter to a specific market by condition ID
        - name: sort_by
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/PositionSortBy'
            description: Field to sort by
            default: value
          description: Field to sort by
        - name: order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/OrderDirection'
            description: 'Sort order: asc or desc'
            default: desc
          description: 'Sort order: asc or desc'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: Maximum number of positions to return (1-200)
            default: 100
            title: Limit
          description: Maximum number of positions to return (1-200)
        - name: pagination_key
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Cursor for pagination
            title: Pagination Key
          description: Cursor for pagination
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletPositionsResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    PositionSortBy:
      type: string
      enum:
        - value
        - unrealized_pnl
        - realized_pnl
        - cost
        - avg_price
        - current_price
        - entry_date
      title: PositionSortBy
      description: Sort options for positions.
    OrderDirection:
      type: string
      enum:
        - asc
        - desc
      title: OrderDirection
      description: Sort order direction enum.
    WalletPositionsResponse:
      properties:
        wallet_address:
          type: string
          title: Wallet Address
        positions:
          items:
            $ref: '#/components/schemas/Position'
          type: array
          title: Positions
        summary:
          $ref: '#/components/schemas/PositionsSummary'
        pagination:
          $ref: '#/components/schemas/CursorPagination'
      type: object
      required:
        - wallet_address
        - positions
        - summary
        - pagination
      title: WalletPositionsResponse
      description: Wallet positions endpoint response.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Position:
      properties:
        market:
          $ref: '#/components/schemas/PositionMarketInfo'
        position:
          $ref: '#/components/schemas/PositionDetails'
        current:
          $ref: '#/components/schemas/PositionCurrentState'
        pnl:
          $ref: '#/components/schemas/PositionPnL'
      type: object
      required:
        - market
        - position
        - current
        - pnl
      title: Position
      description: Individual position.
    PositionsSummary:
      properties:
        total_positions:
          type: integer
          title: Total Positions
        total_value_usd:
          type: number
          title: Total Value Usd
        total_cost_usd:
          type: number
          title: Total Cost Usd
        total_unrealized_pnl_usd:
          type: number
          title: Total Unrealized Pnl Usd
        total_realized_pnl_usd:
          type: number
          title: Total Realized Pnl Usd
        win_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Win Rate
        winning_positions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Winning Positions
        losing_positions:
          anyOf:
            - type: integer
            - type: 'null'
          title: Losing Positions
        fees_paid:
          anyOf:
            - type: number
            - type: 'null'
          title: Fees Paid
          description: Total taker fees paid (USD)
        fees_refunded:
          anyOf:
            - type: number
            - type: 'null'
          title: Fees Refunded
          description: 'DEPRECATED: always 0. Refunds are already netted into fees_paid.'
        net_fees:
          anyOf:
            - type: number
            - type: 'null'
          title: Net Fees
          description: Net fees paid (same as fees_paid, which is already net of refunds)
      type: object
      required:
        - total_positions
        - total_value_usd
        - total_cost_usd
        - total_unrealized_pnl_usd
        - total_realized_pnl_usd
      title: PositionsSummary
      description: Summary of all positions.
    CursorPagination:
      properties:
        limit:
          type: integer
          title: Limit
          description: Requested limit
        count:
          type: integer
          title: Count
          description: Number of items in current response
        pagination_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Pagination Key
          description: Base64-encoded cursor for next page
        has_more:
          type: boolean
          title: Has More
          description: Whether there are more items available
      type: object
      required:
        - limit
        - count
        - has_more
      title: CursorPagination
      description: Cursor-based pagination for endpoints that don't support offset.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PositionMarketInfo:
      properties:
        condition_id:
          type: string
          title: Condition Id
        market_slug:
          type: string
          title: Market Slug
        title:
          type: string
          title: Title
        side:
          $ref: '#/components/schemas/PositionSide'
        side_label:
          type: string
          title: Side Label
          description: Human-readable outcome label (e.g., 'Trump wins' instead of 'Yes')
        token_id:
          type: string
          title: Token Id
        status:
          $ref: '#/components/schemas/PositionMarketStatus'
          description: 'Market status: open, resolved_win, or resolved_loss'
      type: object
      required:
        - condition_id
        - market_slug
        - title
        - side
        - side_label
        - token_id
        - status
      title: PositionMarketInfo
      description: Market info for a position.
    PositionDetails:
      properties:
        shares:
          type: number
          title: Shares
          description: Number of shares currently held (0 for closed positions)
        total_shares_bought:
          type: number
          title: Total Shares Bought
          description: >-
            DEPRECATED — approximate for positions fully closed and reopened at
            a different price. Use total_bought_usd for the exact lifetime buy
            total
          deprecated: true
        total_bought_usd:
          type: number
          title: Total Bought Usd
          description: >-
            Total USD ever spent buying this position, lifetime cumulative
            (preserved even after redemption)
          default: 0
        avg_entry_price:
          type: number
          title: Avg Entry Price
          description: Average entry price (0-1)
        total_cost_usd:
          type: number
          title: Total Cost Usd
          description: Total cost basis in USD
        net_fees_usd:
          type: number
          title: Net Fees Usd
          description: Net taker fees for this position (charged minus refunded, USD)
          default: 0
      type: object
      required:
        - shares
        - total_shares_bought
        - avg_entry_price
        - total_cost_usd
      title: PositionDetails
      description: Position size and cost basis.
    PositionCurrentState:
      properties:
        price:
          type: number
          title: Price
          description: Current market price (0-1)
        value_usd:
          type: number
          title: Value Usd
          description: Current position value in USD
      type: object
      required:
        - price
        - value_usd
      title: PositionCurrentState
      description: Current market state for a position.
    PositionPnL:
      properties:
        unrealized_usd:
          type: number
          title: Unrealized Usd
          description: Unrealized P&L in USD
        unrealized_pct:
          type: number
          title: Unrealized Pct
          description: Unrealized P&L as percentage
        realized_usd:
          type: number
          title: Realized Usd
          description: Realized P&L in USD
      type: object
      required:
        - unrealized_usd
        - unrealized_pct
        - realized_usd
      title: PositionPnL
      description: Profit and loss for a position.
    PositionSide:
      type: string
      enum:
        - 'YES'
        - 'NO'
      title: PositionSide
      description: Position side (YES/NO).
    PositionMarketStatus:
      type: string
      enum:
        - open
        - resolved_win
        - resolved_loss
      title: PositionMarketStatus
      description: Market status for a position.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````