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

> Returns a list of raw Vault metadata and data that match filters.



## OpenAPI

````yaml post /markets/lending_vaults/info
openapi: 3.1.3
info:
  title: Loopscale API
  version: 1.0.0
servers:
  - url: https://tars.loopscale.com/v1
    description: Loopscale Production Server
security: []
paths:
  /markets/lending_vaults/info:
    post:
      tags:
        - Markets
        - Vaults
      summary: Get Loopscale Vaults
      description: Returns a list of raw Vault metadata and data that match filters.
      operationId: getVaults
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetVaultsRequest'
      responses:
        '200':
          description: List of Vaults that match filter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVaultsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/GeneralError'
components:
  schemas:
    GetVaultsRequest:
      type: object
      required:
        - page
        - pageSize
      properties:
        vaultAddresses:
          type: array
          items:
            type: string
          description: List of Vault addresses
        vaultIdentifiers:
          type: array
          items:
            type: string
          description: List of Vault vanity identifiers
        principalMints:
          type: array
          items:
            type: string
          description: List of Vault principal mints to select
        includeRewards:
          type: bool
          description: Include extra rewards information (if applicable)
        page:
          type: integer
          description: Pagination offset, sorted by APY
        pageSize:
          type: integer
          description: Pagination limit (max 1000)
    GetVaultsResponse:
      type: object
      properties:
        lendVaults:
          type: array
          description: Array of Vault data
          items:
            $ref: '#/components/schemas/VaultData'
        total:
          type: number
          description: Total number of Vaults for this filter (to inform pagination)
    VaultData:
      type: object
      properties:
        vault:
          $ref: '#/components/schemas/VaultInfo'
        vaultMetadata:
          $ref: '#/components/schemas/VaultMetadata'
        vaultStrategy:
          $ref: '#/components/schemas/StrategyInfo'
        pendingTerms:
          type: object
          description: Upcoming changes to the Vault waiting on timelock (Not documented)
        vaultRewardsSchedule:
          type: array
          description: Past and upcoming rewards on the Vault.
          items:
            $ref: '#/components/schemas/VaultRewardsSchedule'
        vaultRewardsEmittedAmounts:
          type: object
          description: >-
            Map of reward index to total amount distributed of each reward.
            (Optional)
          properties:
            '[scheduleIndex]':
              type: number
              description: >-
                The number of rewards already emitted for the corresponding
                reward schedule
    VaultInfo:
      type: object
      description: Onchain Vault data
      properties:
        address:
          type: string
          description: Onchain Vault account address
        vaultIdentifier:
          type: string
          description: Offchain vanity identifier (defaults to address)
        principalMint:
          type: string
          description: Vault's deposit mint
        lpMint:
          type: string
          description: LP Token mint
    VaultMetadata:
      type: object
      description: Offchain Vault metadata
      properties:
        name:
          type: string
          description: Name of the Vault set by the manager.
        description:
          type: string
          description: A Vault's description set by the manager.
        managerName:
          type: string
          description: Manager's name.
        depositCap:
          type: number
          description: The maximum amount of deposit tokens allowed, controlled by manager.
    StrategyInfo:
      type: object
      description: >-
        Vault's onchain strategy holding deposited capital. TVL = tokenBalance +
        externalYieldAmount + currentDeployedAmount + outstandingInterestAmount.
        APY = (interestPerSecond * SECONDS_PER_YEAR + externalYieldInfo.apy *
        externalYieldAmount) / TVL. If there is external yield, will need to
        include that directly from the externalYieldInfo data.
      properties:
        strategy:
          type: object
          description: The onchain strategy account.
          properties:
            address:
              type: string
              description: Onchain address of the strategy account
            principalMint:
              type: string
              description: Mint of the deposited assets
            tokenBalance:
              type: number
              description: Amount of principal tokens held in the strategy PDA
            externalYieldAmount:
              type: number
              description: >-
                Amount of principal tokens held in an external program to
                generate yield while waiting for orders to be filled
            currentDeployedAmount:
              type: number
              description: Amount of principal tokens actively lent out
            outstandingInterestAmount:
              type: number
              description: >-
                Amount of principal tokens currently owed as interest on
                outstanding loans
            interestPerSecond:
              type: number
              description: Interest accruing every second to the Vault
            lastAccruedTimestamp:
              type: number
              description: >-
                The UNIX timestamp of the last time interest was accrued to
                outstandingInterestAmount
        externalYieldInfo:
          type: object
          description: >-
            Cached information about the deposits into third party yield sources
            (if applicable)
          properties:
            apy:
              type: number
              description: The most recently parsed APY for this source.
    VaultRewardsSchedule:
      type: object
      description: Rewards information for a Vault
      properties:
        vaultAddress:
          type: string
          description: The address of the Vault this schedule is applied to
        rewardMint:
          type: string
          description: Reward token mint
        totalWeightedStakeSupply:
          type: string
          description: The amount of staked LP tokens
        rewardStartTime:
          type: number
          description: The starting timestamp of the rewards schedule
        rewardEndTime:
          type: number
          description: The ending timestamp of the current rewards schedule
        emissionsPerSecond:
          type: string
          description: >-
            In lamports, the amount of reward tokens distributed every second
            (BigNumber)
        scheduleIndex:
          type: number
          description: The index of this reward schedule in the rewards account
  responses:
    BadRequest:
      description: Bad Request
      content:
        text/plain:
          schema:
            type: string
            example: 'Something went wrong: You have an error in your SQL syntax.'
    GeneralError:
      description: General Server Error
      content:
        text/plain:
          schema:
            type: string
            example: >-
              Failed to deserialize the JSON body into the target type: missing
              field `mints` at line 1 column 1.

````