Sell Pump.fun Token
Sell a Pump.fun token from Rest API. Closes the token account if the balance goes to zero.
This endpoint is available to all users.
Request Body
mint
(string)
The mint address of the token.
fromWallet
(string)
The id of the wallet selling the token.
amountInToken
(number)
The amount of 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.
Building a Pump.fun token sniper bot.
Endpoint
https://api.tradepump.fun/v1/trade/sell
Example Request
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.sell({
mint: "<mint>",
fromWallet: "<wallet>",
amountInToken: "1000000000",
feePayer: null,
slippage: 500,
priorityUnitLimit: null,
priorityUnitPrice: null,
});
Response Example
{
"result": {
"mint": "<:mint>",
"wallet": "<:id>",
"sellAmount": 1000000000,
"preTokenBalance": 1000000000,
"postTokenBalance": 0,
"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>"
}
}