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

# Every KLend position of the wallets tagged with a memo code

> KLend only. A capital flow counts for a code only when its own transaction carried that code as a memo (same rule as KVault distributors). USD is the capital flow value at transaction time (Multiply netting kept); unpriced flows are left out of sums and counted in unpricedFlowCount. newWalletsOnly and newWallets mean no recorded capital flow on any product before the first tagged flow (historyStatus no-prior-recorded). A UTC start and end are required (at most 90 days); unknown parameters are ignored. Load protection: 120 requests a minute per credential (429), and database queries wait up to 5 s for a free slot (503 with Retry-After when they cannot start or hit the timeout; a timed-out request is answered with 503 for 60 s). Private (authorized) API access only, please add a basic auth header to your request.



## OpenAPI

````yaml /kamino-api.json get /klend/distributors/{code}/positions
openapi: 3.1.0
info:
  version: 1.0.0
  title: Kamino Public API
  description: >
    The Kamino API provides a comprehensive way to interact with Kamino without
    reading directly from the blockchain.


    The API also provides the ability to fetch data that might not be available
    from just reading the chain.


    The API is rate-limited for unauthenticated users. If you feel you need to
    make more requests or run into rate-limit issues, please reach out.
servers:
  - url: https://api.kamino.finance
security: []
paths:
  /klend/distributors/{code}/positions:
    get:
      tags:
        - Distributors
      summary: Every KLend position of the wallets tagged with a memo code
      description: >-
        KLend only. A capital flow counts for a code only when its own
        transaction carried that code as a memo (same rule as KVault
        distributors). USD is the capital flow value at transaction time
        (Multiply netting kept); unpriced flows are left out of sums and counted
        in unpricedFlowCount. newWalletsOnly and newWallets mean no recorded
        capital flow on any product before the first tagged flow (historyStatus
        no-prior-recorded). A UTC start and end are required (at most 90 days);
        unknown parameters are ignored. Load protection: 120 requests a minute
        per credential (429), and database queries wait up to 5 s for a free
        slot (503 with Retry-After when they cannot start or hit the timeout; a
        timed-out request is answered with 503 for 60 s). Private (authorized)
        API access only, please add a basic auth header to your request.
      parameters:
        - schema:
            type: string
            minLength: 5
            maxLength: 5
            description: Distributor code, matched case-insensitively
            example: ex4mp
          required: true
          description: Distributor code, matched case-insensitively
          name: code
          in: path
        - schema:
            type: string
            description: >-
              Only wallets with no recorded capital flow on any product before
              their first flow tagged with this code (historyStatus
              no-prior-recorded). Also accepts other truthy/falsy strings such
              as "1"/"0", "yes"/"no", "on"/"off".
            enum:
              - 'true'
              - 'false'
            default: 'false'
          required: false
          description: >-
            Only wallets with no recorded capital flow on any product before
            their first flow tagged with this code (historyStatus
            no-prior-recorded). Also accepts other truthy/falsy strings such as
            "1"/"0", "yes"/"no", "on"/"off".
          name: newWalletsOnly
          in: query
        - schema:
            type: string
            description: >-
              /wallets only: add firstRecordedFlows, each wallet's first
              recorded flow per product. It reads the wallet's whole flow
              history, so limit is at most 25. Also accepts other truthy/falsy
              strings such as "1"/"0", "yes"/"no", "on"/"off".
            enum:
              - 'true'
              - 'false'
            default: 'false'
          required: false
          description: >-
            /wallets only: add firstRecordedFlows, each wallet's first recorded
            flow per product. It reads the wallet's whole flow history, so limit
            is at most 25. Also accepts other truthy/falsy strings such as
            "1"/"0", "yes"/"no", "on"/"off".
          name: includeFirstRecordedFlows
          in: query
        - schema:
            $ref: '#/components/schemas/AddressBase58'
          required: false
          description: Valid base58-encoded address
          name: wallet
          in: query
        - schema:
            type: string
            enum:
              - day
              - week
              - month
              - market
              - kind
            default: day
          required: false
          name: groupBy
          in: query
        - schema:
            type:
              - number
              - 'null'
            minimum: 0
          required: false
          name: minDepositUsd
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          required: false
          name: limit
          in: query
        - schema:
            type: string
            maxLength: 2048
          required: false
          name: paginationToken
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
            example: 2020-01-01T00:00Z
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: start
          in: query
        - schema:
            anyOf:
              - type: string
              - type: number
            description: Date input (ISO 8601 string or epoch in ms)
            examples:
              - '2024-01-01T00:00:00.000Z'
              - 1704067200000
            example: 2020-02-01T00:00Z
          required: false
          description: Date input (ISO 8601 string or epoch in ms)
          name: end
          in: query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        wallet:
                          type: string
                        obligation:
                          type: string
                        market:
                          type: string
                        obligationType:
                          type:
                            - string
                            - 'null'
                        firstTaggedFlowAt:
                          type:
                            - string
                            - 'null'
                        initObligationAt:
                          type:
                            - string
                            - 'null'
                        firstFlowAt:
                          type:
                            - string
                            - 'null'
                        lastFlowAt:
                          type:
                            - string
                            - 'null'
                        isClosed:
                          type:
                            - boolean
                            - 'null'
                        closedAt:
                          type:
                            - string
                            - 'null'
                        depositedUsd:
                          type:
                            - string
                            - 'null'
                        borrowedUsd:
                          type:
                            - string
                            - 'null'
                        valuesRefreshedAt:
                          type:
                            - string
                            - 'null'
                      required:
                        - wallet
                        - obligation
                        - market
                        - obligationType
                        - firstTaggedFlowAt
                        - initObligationAt
                        - firstFlowAt
                        - lastFlowAt
                        - isClosed
                        - closedAt
                        - depositedUsd
                        - borrowedUsd
                        - valuesRefreshedAt
                  paginationToken:
                    type: string
                required:
                  - result
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: High-level error message describing the failure
                    example: Invalid query params
                  details:
                    type: array
                    items:
                      type: object
                      additionalProperties: {}
                    description: >-
                      Detailed validation issues (present only for validation
                      errors)
                required:
                  - error
                description: Bad request response (400)
                example:
                  error: Invalid query request
                  details:
                    - code: invalid_union
                      errors:
                        - - code: custom
                            path: []
                            message: Invalid date string
                        - - expected: number
                            code: invalid_type
                            path: []
                            message: 'Invalid input: expected number, received string'
                      path:
                        - start
                      message: Invalid input
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message describing why it was not authorized
                    example: >-
                      Not authorized for this request. Please include the basic
                      auth headers.
                required:
                  - error
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  metadata:
                    type: string
                    description: Error message describing why it was not found
                    example: Account could not be found
                required:
                  - metadata
        '429':
          description: >-
            Request budget of this credential is used up; retry after the
            indicated delay.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
components:
  schemas:
    AddressBase58:
      type: string
      description: Valid base58-encoded address
      example: VEG1EMtttdHunMbSza8uoms1R18VXmYSph2bBpHcSJd
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message for internal server failure
          example: An internal error occurred
      required:
        - error
      description: Internal server error response (500)
      example:
        error: An internal error occurred

````

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