Sell Pump.fun Token By Percentage

POST

Sell a Pump.fun token by percentage of holdings from Rest API. Closes the token account if the balance goes to zero.

This endpoint mirrors the Sell Token endpoint, but instead of selling a fixed amount of token, it sells a percentage of the total holdings of the token, for the provided wallet.

Request Body

mint

(string)

The mint address of the token.

fromWallet

(string)

The id of the wallet selling the token.

percentage

(number)

The percentage of holdings of the token to sell.

feePayer

(string) nullable

The id of the wallet paying for the transaction.

slippage

(number) nullable

The slippage percentage for the transaction.

priorityUnitLimit

(number) nullable

The maximum amount of priority units the user is willing to pay for the transaction.

priorityUnitPrice

(number) nullable

The priority unit price for the transaction.

Response

result

(object)

An object containing the solana balance of the wallet.


mint

(string)

The mint address of the token.

wallet

(string)

The id of the wallet buying the token.

sellAmount

(number)

The amount of token sold.

preTokenBalance

(number)

The balance of the token before the sell.

postTokenBalance

(number)

The balance of the token after the sell.

signature

(string) nullable

The signature of the transaction.

transactionResult

(object)

The result of the transaction.

tokenAccount

(string)

The token account address.

tokenAccountClosed

(boolean)

Whether the token account was closed, only occurs if token account balance goes to zero.

solscan

(object)

An object containing Solana Explorer URLs for the wallet.


mint

(string)

The Solana Explorer URL for the token mint.

wallet

(string)

The Solana Explorer URL for the wallet.

tx

(string)

The Solana Explorer URL for the transaction.

tokenAccount

(string)

The Solana Explorer URL for the token account address.

pumpfun

(object)

An object containing the Pump.fun URL for the token.


mint

(string)

The Pump.fun URL for the token.

Useful for

  • Selling a Pump.fun token by percentage of holdings.

  • Building a Pump.fun token sniper bot.

Endpoint

https://api.tradepump.fun/v1/trade/sell-by-percentage

Example Request

Node
Curl
Axios
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import { PumpApiClient } from 'tradepumpfun'; const client = new PumpApiClient({ apiKey: '<your-api-key>' }); await client.trade.sellByPercentage({ mint: "<mint>", fromWallet: "<wallet>", percentage: 100, feePayer: null, slippage: 500, priorityUnitLimit: null, priorityUnitPrice: null, });

Response Example

{ "result": { "mint": "<:mint>", "wallet": "<:id>", "sellAmount": 500000000, "preTokenBalance": 1000000000, "postTokenBalance": 500000000, "signature": "<:signature>", "transactionResult": { "success": true, "signature": "<:signature>", "results": "<:tx-result>" }, }, "solscan": { "mint": "https://solscan.io/token/<:mint>", "wallet": "https://solscan.io/account/<:id>", "tx": "https://solscan.io/tx/<:signature>" }, "pumpfun": { "mint": "https://pump.fun/coin/<:mint>" } }