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

Body

application/json

Request a sell quote for a pro pool. Returns the estimated SOL 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.

amount_in_ui
number<double>
required

Amount of tokens to sell in UI format (human-readable with decimals). For example, 1000.5 for a 9-decimal token means 1000500000000 native units.

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
amount_in
integer<int64>
required

Amount of tokens to sell (native units).

Required range: x >= 0
amount_in_ui
number<double>
required

Amount of tokens to sell (human-readable with decimals).

config_version
integer<int32>
required

Protocol config version used for the quote.

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

Minimum SOL output after slippage (lamports).

Required range: x >= 0
minimum_out_ui
number<double>
required

Minimum SOL output after slippage (human-readable).

mint
string
required

Mint address of the token being sold.

program_id
string
required

Heaven DEX program ID used.

slippage_bps
integer<int64>
required

Slippage tolerance applied (basis points).

Required range: x >= 0