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

# Get Earn Withdrawal Queue

> Returns open withdrawal requests, filterable by vault (`address` or `vaultAddresses`) and `wallet`, with queue depth in shares. Set `includeClosed` to also return claimed and cancelled requests. `sortDirection` is `0` ascending, `1` descending.



## OpenAPI

````yaml post /markets/earn/vaults/queue
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/earn/vaults/queue:
    post:
      tags:
        - earn_data
      summary: Get Earn Withdrawal Queue
      description: >-
        Returns open withdrawal requests, filterable by vault (`address` or
        `vaultAddresses`) and `wallet`, with queue depth in shares. Set
        `includeClosed` to also return claimed and cancelled requests.
        `sortDirection` is `0` ascending, `1` descending.
      operationId: query_get_earn_queue
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EarnQueueRequest'
        required: true
      responses:
        '200':
          description: Paged withdrawal requests plus queue depth
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EarnQueueResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    EarnQueueRequest:
      type: object
      properties:
        address:
          type:
            - string
            - 'null'
        includeClosed:
          type: boolean
        page:
          type: integer
          format: int64
          minimum: 0
        pageSize:
          type: integer
          format: int64
          minimum: 0
        sortDirection:
          type:
            - integer
            - 'null'
          format: int32
          description: 'Sort direction: `0` = ascending, `1` = descending.'
          minimum: 0
        vaultAddresses:
          type: array
          items:
            type: string
        wallet:
          type:
            - string
            - 'null'
    EarnQueueResponse:
      type: object
      required:
        - openRequests
        - pageInfo
        - depthShares
        - fulfilledUnclaimedShares
      properties:
        depthShares:
          type: string
        fulfilledUnclaimedShares:
          type: string
        openRequests:
          type: array
          items:
            $ref: '#/components/schemas/EarnWithdrawalRequest'
          description: Open withdrawal requests in the vault's queue.
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
    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
    EarnWithdrawalRequest:
      type: object
      description: Cached Earn withdrawal-request lifecycle state.
      required:
        - onChainRequestAddr
        - earnVaultAddress
        - userWallet
        - sharesRequested
        - sharesFilled
        - sharesClaimed
        - requestedAt
        - status
      properties:
        cancelledAt:
          type:
            - string
            - 'null'
          description: cancellation timestamp
        earnVaultAddress:
          type: string
          description: vault address
        fulfilledAt:
          type:
            - string
            - 'null'
          description: full-fill timestamp
        onChainRequestAddr:
          type: string
          description: withdrawal request PDA
        requestedAt:
          type: string
          description: request creation timestamp
        sharesClaimed:
          type: string
          description: claimed shares
        sharesFilled:
          type: string
          description: filled shares
        sharesRequested:
          type: string
          description: requested shares
        status:
          type: integer
          format: int32
          description: request status enum discriminant
          minimum: 0
        userWallet:
          type: string
          description: user wallet
    PageInfo:
      type: object
      description: >-
        Pagination envelope shared across paginated listing endpoints

        (`/loans/info`, `/strategy/infos`, `/loop/info/v2`,
        `/lending_vaults/user/v2`).

        `totalItems` / `totalPages` are filter-scoped, not page-scoped.
      required:
        - page
        - pageSize
        - totalItems
        - totalPages
      properties:
        page:
          type: integer
          format: int64
          description: 0-indexed page number echoed back from the request.
          minimum: 0
        pageSize:
          type: integer
          format: int64
          description: |-
            Maximum item count per page applied by the server (may differ from
            the request's `pageSize` if the request was 0 or above the cap).
          minimum: 0
        totalItems:
          type: integer
          format: int64
          description: |-
            Total item count across the *filter* scope (not just this page).
            What "item" counts as depends on the endpoint — for grouped
            endpoints this is the count of distinct groups, not loans/rows.
          minimum: 0
        totalPages:
          type: integer
          format: int64
          description: '`ceil(totalItems / pageSize)`.'
          minimum: 0
    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.

````