> ## 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.

# All Positions

> Fetch all user positions with filtering and pagination

Designed for analytics and streaming use cases - backfill historical position data or stream new updates as they come in.

<Tip>**Free & Unlimited.** This endpoint does not count toward your monthly usage limits on any plan.</Tip>

Use `min_block` / `max_block` or `min_timestamp` / `max_timestamp` to scope your query, and `pagination_key` to page through results.

| Constraint | Value               |
| ---------- | ------------------- |
| `limit`    | 1–200 (default 100) |


## OpenAPI

````yaml GET /v2/polymarket/positions
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/positions:
    get:
      tags:
        - polymarket
      summary: Get All Positions
      description: >-
        Fetch all user positions with filtering and pagination.


        Designed for analytics and streaming use cases where clients need to:

        - Backfill historical position data

        - Stream new position updates as they come in


        Use `min_block` to start from a specific block (for backfill).

        Use `order=asc` to get oldest first (for streaming/backfill).

        Use `order=desc` to get latest first (for recent data).


        The pagination cursor encodes the last position's block/timestamp and
        IDs,

        allowing efficient continuation from any point.
      operationId: get_all_positions_v2_polymarket_positions_get
      parameters:
        - name: order_by
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AllPositionsOrderBy'
            description: Order by block number or timestamp
            default: block
          description: Order by block number or timestamp
        - name: order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/OrderDirection'
            description: Sort order (desc for latest first, asc for streaming from oldest)
            default: desc
          description: Sort order (desc for latest first, asc for streaming from oldest)
        - name: min_block
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: Minimum block number (inclusive)
            title: Min Block
          description: Minimum block number (inclusive)
        - name: max_block
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: Maximum block number (inclusive)
            title: Max Block
          description: Maximum block number (inclusive)
        - name: min_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: Minimum timestamp in Unix seconds (inclusive)
            title: Min Timestamp
          description: Minimum timestamp in Unix seconds (inclusive)
        - name: max_timestamp
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: Maximum timestamp in Unix seconds (inclusive)
            title: Max Timestamp
          description: Maximum timestamp in Unix seconds (inclusive)
        - name: wallet
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by wallet address
            title: Wallet
          description: Filter by wallet address
        - name: token_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by token ID
            title: Token Id
          description: Filter by token ID
        - name: condition_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by market condition ID
            title: Condition Id
          description: Filter by market condition ID
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            description: Maximum positions per page (1-500)
            default: 100
            title: Limit
          description: Maximum positions per page (1-500)
        - 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/AllPositionsResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AllPositionsOrderBy:
      type: string
      enum:
        - block
        - timestamp
      title: AllPositionsOrderBy
      description: Order by options for all-user positions streaming endpoint.
    OrderDirection:
      type: string
      enum:
        - asc
        - desc
      title: OrderDirection
      description: Sort order direction enum.
    AllPositionsResponse:
      properties:
        positions:
          items:
            $ref: '#/components/schemas/AllUsersPosition'
          type: array
          title: Positions
          description: Position records
        pagination:
          $ref: '#/components/schemas/CursorPagination'
      type: object
      required:
        - positions
        - pagination
      title: AllPositionsResponse
      description: Response for all-user positions endpoint.
    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
    AllUsersPosition:
      properties:
        user:
          type: string
          title: User
          description: Wallet address
        market:
          $ref: '#/components/schemas/PositionMarketInfo'
        position:
          $ref: '#/components/schemas/PositionDetails'
        current:
          $ref: '#/components/schemas/PositionCurrentState'
        pnl:
          $ref: '#/components/schemas/PositionPnL'
        last_updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last Updated At
          description: Unix timestamp of last position update
        last_updated_block:
          anyOf:
            - type: integer
            - type: 'null'
          title: Last Updated Block
          description: Block number of last position update
      type: object
      required:
        - user
        - market
        - position
        - current
        - pnl
      title: AllUsersPosition
      description: >-
        Position with user info for all-users endpoint (same format as
        wallet/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

````