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

# Estimated share of a memo code in each KLend withdrawal, newest first

> KLend only. Estimate of the part of each withdrawal that is this code's money, including withdrawals without a memo. Per position (obligation and token), each deposit goes to the bucket of its transaction's code (or to no code); a withdrawal with a code takes from its own bucket first, the rest is split pro-rata over all buckets; a withdrawal of the whole recorded balance empties every bucket, and the part above it goes to no code. share is this code's part (0..1); estimatedUsd = share x withdrawnUsd. Computed from token amounts by a consumer job that runs every 15 minutes: a withdrawal usually appears within about 20 minutes of its block time, later when a run fails. Liquidations shrink the buckets but are not listed. Totals and each group are rounded to 6 decimals on their own, so the groups can differ from the totals in the last decimal. Counts, walletCount and the withdrawal list include only rows with share > 0 (a tagged withdrawal from an empty bucket of its own code has share 0). estimatedTaggedWithdrawUsd is the estimated part of the withdrawals that carried this code, not their full value (that is outflowUsd on /summary). Unpriced withdrawals are left out of USD sums and counted in unpricedWithdrawalCount. groupBy kind is rejected (every row is a withdrawal). newWalletsOnly and minDepositUsd do not apply. 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}/estimated-withdrawals
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}/estimated-withdrawals:
    get:
      tags:
        - Distributors
      summary: Estimated share of a memo code in each KLend withdrawal, newest first
      description: >-
        KLend only. Estimate of the part of each withdrawal that is this code's
        money, including withdrawals without a memo. Per position (obligation
        and token), each deposit goes to the bucket of its transaction's code
        (or to no code); a withdrawal with a code takes from its own bucket
        first, the rest is split pro-rata over all buckets; a withdrawal of the
        whole recorded balance empties every bucket, and the part above it goes
        to no code. share is this code's part (0..1); estimatedUsd = share x
        withdrawnUsd. Computed from token amounts by a consumer job that runs
        every 15 minutes: a withdrawal usually appears within about 20 minutes
        of its block time, later when a run fails. Liquidations shrink the
        buckets but are not listed. Totals and each group are rounded to 6
        decimals on their own, so the groups can differ from the totals in the
        last decimal. Counts, walletCount and the withdrawal list include only
        rows with share > 0 (a tagged withdrawal from an empty bucket of its own
        code has share 0). estimatedTaggedWithdrawUsd is the estimated part of
        the withdrawals that carried this code, not their full value (that is
        outflowUsd on /summary). Unpriced withdrawals are left out of USD sums
        and counted in unpricedWithdrawalCount. groupBy kind is rejected (every
        row is a withdrawal). newWalletsOnly and minDepositUsd do not apply. 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:
                        createdOn:
                          type: string
                        tx:
                          type: string
                        rawInstructionId:
                          type: string
                        eventOrdinal:
                          type: number
                        wallet:
                          type: string
                        obligation:
                          type: string
                        market:
                          type: string
                        tokenMint:
                          type:
                            - string
                            - 'null'
                        withdrawnTokenAmount:
                          type: string
                        withdrawnUsd:
                          type:
                            - string
                            - 'null'
                        share:
                          type: string
                        estimatedTokenAmount:
                          type: string
                        estimatedUsd:
                          type:
                            - string
                            - 'null'
                        tagged:
                          type: boolean
                      required:
                        - createdOn
                        - tx
                        - rawInstructionId
                        - eventOrdinal
                        - wallet
                        - obligation
                        - market
                        - tokenMint
                        - withdrawnTokenAmount
                        - withdrawnUsd
                        - share
                        - estimatedTokenAmount
                        - estimatedUsd
                        - tagged
                  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.