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

# Get LP Balance

> Fetch a user's LP position in a pro pool.

Returns the LP token balance, pending fees, and whether the position exists on-chain. If the user has never added liquidity (or received LP tokens via transfer), `exists` will be `false` and all values will be zero.

The `lp_position_address` is the PDA derived from `[USER_LP_POSITION, pool, user]` — useful for monitoring the account directly via WebSocket subscriptions.



## OpenAPI

````yaml /openapi.json post /data/lp-balance
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:
  /data/lp-balance:
    post:
      tags:
        - Data API
      summary: Get LP Balance
      description: >-
        Fetch a user's LP position in a pro pool.


        Returns the LP token balance, pending fees, and whether the position
        exists on-chain. If the user has never added liquidity (or received LP
        tokens via transfer), `exists` will be `false` and all values will be
        zero.


        The `lp_position_address` is the PDA derived from `[USER_LP_POSITION,
        pool, user]` — useful for monitoring the account directly via WebSocket
        subscriptions.
      operationId: fetch_lp_balance
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FetchLpBalanceRequest'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FetchLpBalanceResponse'
components:
  schemas:
    FetchLpBalanceRequest:
      type: object
      required:
        - pool
        - user
        - program_id
      properties:
        pool:
          type: string
          description: >-
            On-chain address of the pro pool state account. Returned in the
            response when creating a pool.
        user:
          type: string
          description: Public key of the wallet to check the LP balance for.
        program_id:
          type: string
          description: >-
            Program ID of the Heaven DEX program. Use
            `HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o` for mainnet.
      description: >-
        Query a user's LP token balance in a pro pool. Returns zero values if
        the user has never added liquidity.
    FetchLpBalanceResponse:
      type: object
      required:
        - lp_token_balance
        - reward_debt
        - pending_fees
        - lp_position_address
        - exists
      properties:
        lp_token_balance:
          type: integer
          format: int64
          minimum: 0
          description: Current LP token balance for this user in the pool.
        reward_debt:
          type: integer
          format: int64
          minimum: 0
          description: >-
            Accumulated reward debt used internally for fee distribution
            calculations.
        pending_fees:
          type: integer
          format: int64
          minimum: 0
          description: Pending trading fees claimable by this LP position.
        lp_position_address:
          type: string
          description: On-chain PDA address of the user's LP position account.
        exists:
          type: boolean
          description: >-
            Whether the LP position account exists on-chain. False if the user
            has never added liquidity to this pool.
      description: LP position information for a user in a pro pool.

````