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

# Quote Buy

> Get a quote for buying tokens in a standard pool.

Returns the estimated token output, fees, and minimum output after slippage. Pass the full response object to `/tx/buy` to build the transaction.

**Note:** The quote is calculated at the current on-chain state and may change by the time the transaction is submitted. Use `slippage_bps` to protect against price movements.



## OpenAPI

````yaml /openapi.json post /quote/buy
openapi: 3.1.0
info:
  title: heaven-tx-api
  description: ''
  license:
    name: ''
  version: 0.1.14
servers:
  - url: https://tx.api.heaven.xyz
security: []
tags:
  - name: heaven-api
    description: Heaven API
paths:
  /quote/buy:
    post:
      tags:
        - Standard Pool API
      summary: Quote Buy
      description: >-
        Get a quote for buying tokens in a standard pool.


        Returns the estimated token output, fees, and minimum output after
        slippage. Pass the full response object to `/tx/buy` to build the
        transaction.


        **Note:** The quote is calculated at the current on-chain state and may
        change by the time the transaction is submitted. Use `slippage_bps` to
        protect against price movements.
      operationId: quote_buy
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuoteBuyRequest'
        required: true
      responses:
        '200':
          description: Use the response to create a buy transaction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteBuyResponse'
components:
  schemas:
    QuoteBuyRequest:
      type: object
      required:
        - config_version
        - mint
        - program_id
        - max_sol_spend
        - slippage_bps
      properties:
        config_version:
          type: integer
          description: Use 1 for Community Token and 2 for Creator Token
          default: 1
          minimum: 0
        max_sol_spend:
          type: number
          description: Maximum amount of SOL to spend for the buy operation
          example: 1
        mint:
          type: string
          description: Mint address of the token
          example: LiGHtkg3uTa9836RaNkKLLriqTNRcMdRAhqjGWNv777
        program_id:
          type: string
          description: Program ID of the Heaven DEX program
          default: HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o
        slippage_bps:
          type: integer
          description: Slippage in basis points (bps), e.g., 50 bps = 0.5%
          example: 50
          minimum: 0
    QuoteBuyResponse:
      type: object
      required:
        - max_sol_spend
        - max_lamport_spend
        - minimum_out
        - minimum_out_ui
        - config_version
        - mint
        - program_id
        - slippage_bps
      properties:
        config_version:
          type: integer
          format: int32
          minimum: 0
          description: Protocol config version used for the quote.
        max_lamport_spend:
          type: integer
          description: Maximum amount of lamports to spend for the buy operation
          minimum: 0
        max_sol_spend:
          type: number
          description: Maximum amount of SOL to spend for the buy operation
        minimum_out:
          type: integer
          description: Minimum amount of tokens to receive from the buy operation
          minimum: 0
        minimum_out_ui:
          type: number
          description: >-
            Minimum amount of tokens to receive from the buy operation in UI
            format
        mint:
          type: string
          description: Mint address of the token being bought.
        program_id:
          type: string
          description: Heaven DEX program ID used.
        slippage_bps:
          type: integer
          format: int64
          minimum: 0
          description: Slippage tolerance applied (basis points).

````