> ## 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 best quote

> Returns the top quote for each specified collateral asset based on available liquidity. This endpoint is designed for minimizing rate slippage for a borrow with known inputs.



## OpenAPI

````yaml post /markets/quote/max
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/quote/max:
    post:
      tags:
        - quotes
      summary: Get max quote
      description: >-
        Returns the top quote for each specified collateral asset based on
        available liquidity. This endpoint is designed for minimizing rate
        slippage for a borrow with known inputs.
      operationId: route_get_max_quote
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MaxQuoteRequest'
        required: true
      responses:
        '200':
          description: Best matching quote per collateral asset
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaxQuoteResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    MaxQuoteRequest:
      type: object
      required:
        - collateralFilter
        - principalMint
        - duration
        - durationType
      properties:
        collateralFilter:
          type: array
          items:
            $ref: '#/components/schemas/CollateralFilter'
        duration:
          type: integer
          format: int64
          minimum: 0
        durationType:
          type: integer
          format: int32
          minimum: 0
        excludedExternalYield:
          type:
            - array
            - 'null'
          items:
            type: integer
            format: int32
            minimum: 0
        principalMint:
          type: string
        strategyCredit:
          type: object
          additionalProperties:
            type: integer
            format: int64
            minimum: 0
          propertyNames:
            type: string
    MaxQuoteResponse:
      type: object
      required:
        - apy
        - strategy
        - collateralIdentifier
        - ltv
        - lqt
        - amount
      properties:
        amount:
          type: integer
          format: int64
          minimum: 0
        apy:
          type: integer
          format: int64
          minimum: 0
        collateralIdentifier:
          type: string
        lqt:
          type: integer
          format: int32
          minimum: 0
        ltv:
          type: integer
          format: int32
          minimum: 0
        strategy:
          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
    CollateralFilter:
      type: object
      required:
        - amount
        - assetData
      properties:
        amount:
          type: integer
          format: int64
          minimum: 0
        assetData:
          $ref: '#/components/schemas/AssetDataInfo'
        priceOverride:
          type:
            - number
            - 'null'
          format: double
    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.
    AssetDataInfo:
      oneOf:
        - type: object
          required:
            - Spl
          properties:
            Spl:
              $ref: '#/components/schemas/SplData'
        - type: object
          required:
            - StakedSol
          properties:
            StakedSol:
              $ref: '#/components/schemas/StakedSolData'
        - type: object
          required:
            - Orca
          properties:
            Orca:
              $ref: '#/components/schemas/OrcaPositionData'
        - type: object
          required:
            - Meteora
          properties:
            Meteora:
              $ref: '#/components/schemas/MeteoraDlmmPositionData'
        - type: object
          required:
            - Raydium
          properties:
            Raydium:
              $ref: '#/components/schemas/RaydiumPositionData'
      description: |-
        Collateral asset identification, tagged by collateral kind (SPL token,
        staked SOL, or a CLMM LP position on Orca / Meteora / Raydium).
    SplData:
      type: object
      required:
        - mint
      properties:
        mint:
          type: string
    StakedSolData:
      type: object
      required:
        - stakeAccount
        - stakePool
      properties:
        stakeAccount:
          type: string
        stakePool:
          type: string
    OrcaPositionData:
      type: object
      required:
        - positionMint
        - whirlpool
      properties:
        positionMint:
          type: string
        tokenProgram:
          type:
            - string
            - 'null'
        whirlpool:
          type: string
    MeteoraDlmmPositionData:
      type: object
      required:
        - positionAddress
        - lbPair
      properties:
        lbPair:
          type: string
        positionAddress:
          type: string
        tokenProgram:
          type:
            - string
            - 'null'
    RaydiumPositionData:
      type: object
      required:
        - mint
        - pool
      properties:
        mint:
          type: string
        pool:
          type: string
        tokenProgram:
          type:
            - string
            - 'null'

````