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

# Closed Market Holder

> User-level holders of closed (exited) market positions.



## OpenAPI

````yaml /openapi.json post /api/v1/market-holders/closed
openapi: 3.0.3
info:
  title: DataDash Analytics API
  version: 1.0.0
servers: []
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /api/v1/market-holders/closed:
    post:
      tags:
        - Holders
      summary: Closed Market Holder
      description: User-level holders of closed (exited) market positions.
      operationId: listMarketHoldersClosed
      requestBody:
        content:
          application/json:
            schema:
              properties:
                filter:
                  $ref: '#/components/schemas/ClosedMarketHolderFilter'
                orderBy:
                  description: >-
                    Sort keys in priority order; the first is the primary sort.
                    Defaults to the table's configured ranking when omitted.
                  items:
                    properties:
                      direction:
                        default: asc
                        enum:
                          - asc
                          - desc
                        type: string
                      field:
                        enum:
                          - userId
                          - outcomes
                          - invested
                          - totalPnl
                          - pnlPercentage
                          - tokenMetadata
                          - volume
                        type: string
                    required:
                      - field
                    type: object
                  type: array
                page:
                  $ref: '#/components/schemas/PageInput'
              required:
                - page
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ClosedMarketHolderRow'
                type: array
          description: List of Closed Market Holder rows
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            invalid request (malformed body, unknown field, or failed
            validation)
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: missing or invalid credentials
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: credentials lack access to this resource
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: internal error
components:
  schemas:
    ClosedMarketHolderFilter:
      description: Filters to apply, combined with AND. Use a group for OR.
      items:
        $ref: '#/components/schemas/ClosedMarketHolderFilterNode'
      minItems: 1
      type: array
    PageInput:
      properties:
        limit:
          minimum: 1
          type: integer
        offset:
          minimum: 0
          type: integer
      required:
        - limit
      type: object
    ClosedMarketHolderRow:
      properties:
        invested:
          description: Realized cost basis of the sold shares.
          format: double
          title: Invested
          type: number
        outcomes:
          description: Number of distinct token outcomes
          format: int64
          title: Outcomes
          type: integer
        pnlPercentage:
          description: Realized PnL as percentage of realized cost basis
          format: double
          title: Pnl Percentage
          type: number
        tokenMetadata:
          description: Nested token-level position details as JSON
          items:
            properties:
              avgBuyingPrice:
                type: string
              invested:
                type: string
              isYesToken:
                type: string
              marketClosed:
                type: string
              marketId:
                type: string
              pnlPercentage:
                type: string
              tokenName:
                type: string
              totalPnl:
                type: string
              total_bought_shares:
                type: string
              volume:
                type: string
            type: object
          title: Token Metadata
          type: array
        totalPnl:
          description: Realized PNL
          format: double
          title: Pnl
          type: number
        userId:
          description: User wallet address
          title: Wallet
          type: string
        volume:
          description: Total trading volume
          format: double
          title: Volume
          type: number
      type: object
    Error:
      properties:
        code:
          description: machine-readable error code
          type: string
        message:
          description: human-readable description
          type: string
      required:
        - code
        - message
      type: object
    ClosedMarketHolderFilterNode:
      description: A single condition, or a group combining conditions with AND/OR.
      oneOf:
        - $ref: '#/components/schemas/ClosedMarketHolderCondition'
        - $ref: '#/components/schemas/ClosedMarketHolderFilterGroup'
    ClosedMarketHolderCondition:
      description: >-
        A single field condition. in/notIn take an array of values;
        matches/notMatches take one search term.
      oneOf:
        - $ref: '#/components/schemas/ClosedMarketHolderNumericCondition'
        - $ref: '#/components/schemas/ClosedMarketHolderIdCondition'
        - $ref: '#/components/schemas/ClosedMarketHolderAddressCondition'
    ClosedMarketHolderFilterGroup:
      description: >-
        A group of conditions and nested groups, combined with the group's
        operator.
      properties:
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/ClosedMarketHolderCondition'
              - $ref: '#/components/schemas/ClosedMarketHolderFilterInnerGroup'
          minItems: 1
          type: array
        operator:
          enum:
            - AND
            - OR
          type: string
      required:
        - operator
        - filters
      type: object
    ClosedMarketHolderNumericCondition:
      properties:
        field:
          enum:
            - invested
            - totalPnl
            - pnlPercentage
            - volume
            - userRank
          type: string
        operator:
          enum:
            - eq
            - neq
            - lt
            - lte
            - gt
            - gte
          type: string
        value:
          oneOf:
            - format: double
              type: number
            - items:
                format: double
                type: number
              minItems: 1
              type: array
      required:
        - field
        - operator
        - value
      type: object
    ClosedMarketHolderIdCondition:
      properties:
        field:
          enum:
            - eventId
            - positionId
          type: string
        operator:
          enum:
            - in
            - notIn
          type: string
        value:
          oneOf:
            - format: int32
              type: integer
            - items:
                format: int32
                type: integer
              minItems: 1
              type: array
      required:
        - field
        - operator
        - value
      type: object
    ClosedMarketHolderAddressCondition:
      description: inCohort/notInCohort take cohort ids instead of addresses.
      properties:
        field:
          enum:
            - userId
          type: string
        operator:
          enum:
            - in
            - notIn
            - matches
            - notMatches
            - inCohort
            - notInCohort
          type: string
        value:
          oneOf:
            - type: string
            - items:
                type: string
              minItems: 1
              type: array
      required:
        - field
        - operator
        - value
      type: object
    ClosedMarketHolderFilterInnerGroup:
      description: >-
        A nested group. Its members must be conditions, which bounds grouping at
        two levels.
      properties:
        filters:
          items:
            $ref: '#/components/schemas/ClosedMarketHolderCondition'
          minItems: 1
          type: array
        operator:
          enum:
            - AND
            - OR
          type: string
      required:
        - operator
        - filters
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: API key issued for programmatic access.
      in: header
      name: X-Api-Key
      type: apiKey
    BearerAuth:
      bearerFormat: JWT
      description: User access token.
      scheme: bearer
      type: http

````