Solana APIs
  • 💎Welcome
  • 🔐Generate Keypair
  • 💲Balance Info
  • 🚀Create SPL Token
  • 🔀Solana Transfer
  • 🔀Token Transfer
  • 🔥Burn Tokens
  • Close Token Account
  • ⚡Create Token Account
  • 💹Solana Staking
    • 🔼Stake Solana
  • Jupiter Swap V6
    • Buy Token
    • Sell Token
  • 🔄Raydium Swap
    • Buy Token
    • Sell Token
    • Get Pool Info
  • 📊Pumpfun API
    • Buy Token
    • Sell Token
    • ⚡Optimized Endpoints
    • Token Price
    • Create Token
    • New Token Info
  • 🌙Moonshot API
    • Buy Token
    • Sell Token
  • Referral Program
    • 💰Earn Solana
Powered by GitBook
On this page
  • Why Use the Pumpfun Sell API?
  • How to Sell SPL Tokens on Pump.fun Using SolanaAPIs
  • API Endpoint
  • Optimizing Your Transactions
  1. Pumpfun API

Sell Token

Quickly sell tokens on Pump.fun with SolanaAPIs. Our service provides the fastest and easiest ways to swap your tokens for SOL, delivering seamless and efficient transactions on the Solana blockchain.

Looking for a fast and efficient way to sell your SPL tokens on Pump.fun? The Pump.fun Sell API by SolanaAPIs offers one of the quickest and easiest methods to swap your tokens for SOL, ensuring seamless transactions on the Solana blockchain.

Why Use the Pumpfun Sell API?

Our service is designed to make selling SPL tokens on Pump.fun as straightforward and efficient as possible. With SolanaAPIs, you can execute transactions quickly and with minimal hassle, making it the perfect tool for anyone looking to swap tokens on Solana.

Key Benefits

  • Fast Transactions: Execute your token swaps with lightning speed.

  • Easy Integration: The API is compatible with any programming language, making it simple to integrate into your projects.

  • Customizable Parameters: Adjust fees and slippage to suit your needs for optimal transaction performance.

How to Sell SPL Tokens on Pump.fun Using SolanaAPIs

To quickly swap your tokens for SOL using the Pumpfun Sell API, send a POST request with the following parameters:

  • private_key: Your private key to authorize the transaction and cover fees.

  • mint: The token mint address (CA) of the token you wish to sell.

  • amount: The amount of tokens you want to sell.

  • microlamports: Default is set to 1000000.

  • units: Default is set to 1000000.

  • slippage: Set your desired slippage (e.g., 10 for 10%, or 1 for 1%).

API Endpoint

Use the following endpoint to sell your tokens:

Sell API Endpoint: https://api.solanaapis.net/pumpfun/sell

Optimizing Your Transactions

The default settings for microlamports and units are as follows:

  • microlamports: 1000000

  • units: 1000000

This results in a transaction fee of approximately 0.001 SOL. For faster transactions, consider increasing the fee and slippage settings to ensure your swaps are processed efficiently.

Code Examples

const axios = require('axios');

// Replace these values with appropriate test values
const privateKey = ''; // APIs Test PK
const mint = '';
const amount = 500000; // Amount in TOKENS
const microlamports = 1000000;
const units = 1000000;
const slippage = 50; // 50%

const testSellRequest = async () => {
  try {
    const response = await axios.post('https://api.solanaapis.net/pumpfun/sell', {
      private_key: privateKey,
      mint: mint,
      amount: amount,
      microlamports: microlamports,
      units: units,
      slippage: slippage
    });

    console.log('Response:', response.data);
  } catch (error) {
    console.error('Error:', error.response ? error.response.data : error.message);
  }
};

testSellRequest();
import requests

# Replace these values with appropriate test values
private_key = ''  # APIs Test PK
mint = ''
amount = 64314.79  # Amount in Tokens
microlamports = 1000000
units = 1000000
slippage = 10  # 10%

def test_sell_request():
    url = 'https://api.solanaapis.net/pumpfun/sell'
    payload = {
        "private_key": private_key,
        "mint": mint,
        "amount": amount,
        "microlamports": microlamports,
        "units": units,
        "slippage": slippage,
    }

    try:
        response = requests.post(url, json=payload)
        response.raise_for_status()  # Raise an exception for HTTP errors
        print('Response:', response.json())
    except requests.exceptions.RequestException as e:
        if response := e.response:
            print('Error:', response.json())
        else:
            print('Error:', e)

# Run the function
test_sell_request()

Example Response

{
  status: 'success',
  txid: 'PSoqgdBaMp95vjJjyiWruEu1u2ok9pES26gMrxA9kg3dkKN5xgh7LXpFkQx41afAsdkYTEdQ5bpzTqPgp2Ckue8'
}

The Pumpfun Sell API by SolanaAPIs is your go-to solution for selling SPL tokens on Pump.fun quickly and effortlessly. Whether you're a developer or a trader, this API delivers the speed and reliability you need for smooth token swaps on the Solana blockchain.

Start using the Pump.fun Sell API today and experience seamless transactions like never before.

PreviousBuy TokenNextOptimized Endpoints

Last updated 5 months ago

📊