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

# Get collateral holders

> Fetches a list of users and total balances for one or more specified collateral mints.



## OpenAPI

````yaml post /markets/collateral/holders
openapi: 3.1.0
info:
  title: Loopscale API
  version: 0.1.0
servers:
  - url: https://tars.loopscale.com/v1
    description: Loopscale Production Server
security: []
paths:
  /markets/collateral/holders:
    post:
      tags:
        - stats
      summary: Get collateral holders
      description: >-
        Fetches a list of users and total balances for one or more specified
        collateral mints.
      operationId: query_get_active_collateral_summary
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HolderFilter'
        required: true
      responses:
        '200':
          description: Active collateral holder summary
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CollateralHolderStats'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    HolderFilter:
      type: object
      description: asset filter
      required:
        - mints
      properties:
        group:
          type: boolean
          description: >-
            If true, additionally return a nested `userDepositsByPda` breakdown
            of

            `borrower → { loan PDA → amount }` alongside the flat `userDeposits`

            map. Mutually exclusive with `pdas`.
        mints:
          type: array
          items:
            type: string
          description: assets
        pdas:
          type: boolean
          description: Return the PDAs holding the assets, if false it returns the borrower
    CollateralHolderStats:
      type: object
      description: |-
        Active-holder summary for one collateral mint: total deposits plus a
        per-holder (wallet → amount) breakdown.

        When the request sets `group: true`, `user_deposits_by_pda` additionally
        carries a nested `borrower → { loan PDA → amount }` breakdown; otherwise
        it is omitted. `user_deposits` is always present.
      required:
        - collateralMint
        - totalDeposits
        - userDeposits
      properties:
        collateralMint:
          type: string
        totalDeposits:
          type: number
          format: double
        userDeposits:
          type: object
          additionalProperties:
            type: number
            format: double
          propertyNames:
            type: string
        userDepositsByPda:
          type:
            - object
            - 'null'
          additionalProperties:
            type: object
            additionalProperties:
              type: number
              format: double
            propertyNames:
              type: string
          propertyNames:
            type: string
    ErrorResponse:
      type: object
      description: |-
        Canonical error envelope for every endpoint. The `x-request-id` response
        header carries the correlation id for the failing request.
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetails'
          description: error detail
    ErrorDetails:
      type: object
      description: Inner detail of the [`ErrorResponse`] envelope.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code, mirrored in the response status line
          example: 400
          minimum: 0
        message:
          type: string
          description: human-readable, client-safe message (sensitive data redacted)
          example: Request could not be processed.
        simulation:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/SimulationDebug'
              description: >-
                Populated on transaction-generation endpoints when the
                build-path

                simulation reverts. Absent on all other error paths.
    SimulationDebug:
      type: object
      description: >-
        Diagnostics attached to a build-path simulation revert so clients can
        inspect

        the exact txn that would have failed on-chain. Only populated for
        txn-gen

        endpoints; other 4xx/5xx responses omit this field.
      required:
        - decoded
        - logs
      properties:
        decoded:
          type: string
          description: >-
            Human-readable decoded error (Anchor "Error Message: ..." when
            available,

            otherwise the raw program error code or `TransactionError` debug
            form).
        logs:
          type: array
          items:
            type: string
          description: Program logs from the reverting simulation, in order.
        serializedTransaction:
          type:
            - string
            - 'null'
          description: >-
            Base64-encoded, bincode-serialized `VersionedTransaction` that was

            simulated (signatures zeroed for sig-verify-disabled simulation).

            Decode with
            `bincode::deserialize::<VersionedTransaction>(&base64_decode(..))`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.