Skip to main content
POST
/
data
/
lp-balance
Get LP Balance
curl --request POST \
  --url https://tx.api.heaven.xyz/data/lp-balance \
  --header 'Content-Type: application/json' \
  --data '
{
  "pool": "<string>",
  "user": "<string>",
  "program_id": "<string>"
}
'
{
  "lp_token_balance": 1,
  "reward_debt": 1,
  "pending_fees": 1,
  "lp_position_address": "<string>",
  "exists": true
}

Body

application/json

Query a user's LP token balance in a pro pool. Returns zero values if the user has never added liquidity.

pool
string
required

On-chain address of the pro pool state account. Returned in the response when creating a pool.

user
string
required

Public key of the wallet to check the LP balance for.

program_id
string
required

Program ID of the Heaven DEX program. Use HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o for mainnet.

Response

200 - application/json

LP position information for a user in a pro pool.

lp_token_balance
integer<int64>
required

Current LP token balance for this user in the pool.

Required range: x >= 0
reward_debt
integer<int64>
required

Accumulated reward debt used internally for fee distribution calculations.

Required range: x >= 0
pending_fees
integer<int64>
required

Pending trading fees claimable by this LP position.

Required range: x >= 0
lp_position_address
string
required

On-chain PDA address of the user's LP position account.

exists
boolean
required

Whether the LP position account exists on-chain. False if the user has never added liquidity to this pool.