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

# Get the Borrow Quote for a Liquidity Transaction

> Calculates the borrow quote including borrow cost, required input/output, and duration

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.sprinter.tech/liquidity/v2/chain/{srcChain}/protocol/{protocol}/type/{type}/quote' \
    --header 'X-Auth-Token: YOUR_API_KEY'
  ```

  ```python Python theme={null}
  import requests

  response = requests.get("https://api.sprinter.tech/liquidity/v2/chain/{srcChain}/protocol/{protocol}/type/{type}/quote", headers={"X-Auth-Token": "YOUR_API_KEY"})
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.sprinter.tech/liquidity/v2/chain/{srcChain}/protocol/{protocol}/type/{type}/quote",
    { headers: { "X-Auth-Token": "YOUR_API_KEY" } }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	req, _ := http.NewRequest("GET", "https://api.sprinter.tech/liquidity/v2/chain/{srcChain}/protocol/{protocol}/type/{type}/quote", nil)
  	req.Header.Set("X-Auth-Token", "YOUR_API_KEY")
  	resp, _ := http.DefaultClient.Do(req)
  	defer resp.Body.Close()
  	body, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(body))
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data": {
      "borrowCost": "150000",
      "duration": 300,
      "estimatedFillDuration": 180,
      "feeBps": 5,
      "id": "qt_a1b2c3d4e5f6",
      "liquidityPool": "0xLiqPool1234567890AbCdEf1234567890AbCdEf12",
      "quoteDuration": 60,
      "repaymentChain": 1,
      "repaymentRecipient": "0xRepayRecip234567890AbCdEf1234567890AbCdEf1",
      "requiredInput": "100000000",
      "requiredOutput": "99850000"
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml get /liquidity/v2/chain/{srcChain}/protocol/{protocol}/type/{type}/quote
openapi: 3.0.0
info:
  contact: {}
  title: ''
  version: 0.0.1
servers:
  - url: https://api.sprinter.tech
    description: Production server
security: []
paths:
  /liquidity/v2/chain/{srcChain}/protocol/{protocol}/type/{type}/quote:
    get:
      tags:
        - Liquidity
      summary: Get the borrow quote for a liquidity transaction based on the input data
      description: >-
        Calculates the borrow quote including borrow cost, required
        input/output, and duration
      parameters:
        - description: Protocol name (e.g., Across)
          name: protocol
          in: path
          required: true
          schema:
            type: string
        - description: Quote algorithm type (e.g., ExactInput, ExactOutput)
          name: type
          in: path
          required: true
          schema:
            type: string
        - description: Source CAIP chain ID (e.g., eip155:1)
          name: srcChain
          in: path
          required: true
          schema:
            type: string
        - description: Destination CAIP chain ID (e.g., eip155:1)
          name: dstChain
          in: query
          required: true
          schema:
            type: string
        - description: Exclusive fill flag (true/false)
          name: exclusive
          in: query
          schema:
            type: string
        - description: >-
            Amount of tokens for which we are requesting borrow quote (in the
            smallest denomination)
          name: amount
          in: query
          required: true
          schema:
            type: string
        - description: Token address on destination (hex)
          name: token
          in: query
          required: true
          schema:
            type: string
        - description: Preferred liquidity pool address to borrow from (hex)
          name: pool
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved borrow quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/liquidity.borrowQuoteResponse'
        '400':
          description: Bad request due to invalid input or missing parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responses.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    liquidity.borrowQuoteResponse:
      type: object
      required:
        - data
      properties:
        data:
          $ref: '#/components/schemas/liquidity.Quote'
    responses.ErrorResponse:
      type: object
      required:
        - error
      properties:
        debug:
          type: string
        error:
          type: string
    liquidity.Quote:
      type: object
      required:
        - borrowCost
        - duration
        - estimatedFillDuration
        - feeBps
        - liquidityPool
        - quoteDuration
        - repaymentChain
        - repaymentRecipient
        - requiredInput
        - requiredOutput
      properties:
        borrowCost:
          description: >-
            Cost to borrow the liquidity (in the smallest denomination).
            Excludes gas costs.
          type: string
        duration:
          description: 'Deprecated: use EstimatedFillDuration instead.'
          type: number
        estimatedFillDuration:
          description: |-
            Estimated duration for the borrow transaction to complete.
            Depends on the required amount of confirmations on the source chain.
          type: number
        feeBps:
          description: Borrow fee in basis points. Excludes gas costs.
          type: number
        id:
          description: >-
            Unique identifier for the quote. Guarantees liquidity reservation.
            Used on borrow signature request.
          type: string
        liquidityPool:
          description: Liquidity pool from which the liquidity will be borrowed
          type: string
        quoteDuration:
          description: Duration for which this quote remains valid.
          type: number
        repaymentChain:
          description: Chain on which the repayment will be received
          allOf:
            - $ref: '#/components/schemas/entity.ChainID'
        repaymentRecipient:
          description: Address to which the repayment should be sent
          type: string
        requiredInput:
          description: >-
            Amount of input tokens required to fulfill the borrow (in the
            smallest denomination)
          type: string
        requiredOutput:
          description: >-
            Amount of output tokens that will be received from the borrow (in
            the smallest denomination)
          type: string
    entity.ChainID:
      type: integer
      format: int32
      enum:
        - 1
        - 42161
      x-enum-varnames:
        - Ethereum
        - Arbitrum
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: X-Auth-Token
      in: header

````