Skip to main content
POST
/
quote
/
pro
/
buy
Quote Pro Buy
curl --request POST \
  --url https://tx.api.heaven.xyz/quote/pro/buy \
  --header 'Content-Type: application/json' \
  --data '
{
  "config_version": 1,
  "mint": "<string>",
  "program_id": "<string>",
  "max_sol_spend": 123,
  "slippage_bps": 1,
  "pool": "<string>"
}
'
{
  "config_version": 1,
  "max_lamport_spend": 1,
  "max_sol_spend": 123,
  "minimum_out": 1,
  "minimum_out_ui": 123,
  "mint": "<string>",
  "program_id": "<string>",
  "slippage_bps": 1
}

Body

application/json

Request a buy quote for a pro pool. Returns the estimated token output and fee breakdown.

config_version
integer<int32>
required

Protocol config version. Use 1 for community tokens, 2 for creator tokens, 3 for pro pools.

Required range: x >= 0
mint
string
required

Mint address of the SPL token (token A) in the pool.

program_id
string
required

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

max_sol_spend
number<double>
required

Maximum SOL to spend (in SOL, not lamports). For example, 1.5 means 1.5 SOL.

slippage_bps
integer<int64>
required

Maximum acceptable slippage in basis points. 50 = 0.5%. Set to 0 for no slippage tolerance.

Required range: x >= 0
pool
string
required

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

Response

200 - application/json
config_version
integer<int32>
required

Protocol config version used for the quote.

Required range: x >= 0
max_lamport_spend
integer
required

Maximum amount of lamports to spend for the buy operation

Required range: x >= 0
max_sol_spend
number
required

Maximum amount of SOL to spend for the buy operation

minimum_out
integer
required

Minimum amount of tokens to receive from the buy operation

Required range: x >= 0
minimum_out_ui
number
required

Minimum amount of tokens to receive from the buy operation in UI format

mint
string
required

Mint address of the token being bought.

program_id
string
required

Heaven DEX program ID used.

slippage_bps
integer<int64>
required

Slippage tolerance applied (basis points).

Required range: x >= 0