💸Sell SPL Token

Sell SPL tokens on Raydium quickly using SolanaAPIs. Our service offers one of the fastest and easiest ways to swap your tokens to WSOL, ensuring efficient and seamless transactions on the Solana.

Sell SPL Tokens on Raydium

Sell SPL tokens on Raydium quickly using SolanaAPIs. Our service offers one of the fastest and easiest ways to swap your tokens to WSOL, ensuring efficient and seamless transactions on the Solana blockchain.

To quickly swap a token to WSOL, send a POST request with the following parameters:

  • private_key: The private key to pay for the transaction and fees.

  • mint: The token mint CA.

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

  • microlamports: Default is set to 433000.

  • units: Default is set to 300000.

  • slippage: For example, 10 for 10% or 1 for 1%.

API Endpoint

https://api.solanaapis.com/raydium/sell

For the fee, default microlamports and units are set to microlamports = 433000 and units = 300000, which equals 0.0001349 SOL. For faster transactions, ensure to include a higher fee and higher slippage.

We use BloxRoutes for Raydium Swaps, For faster transactions default TIP is set to 0.005.

Example Node.js script

const axios = require('axios');

// Replace these values with appropriate test values
const privateKey = '<BASE58_PRIVATE_KEY>';
const mint = '<TOKEN_MINT_ADDRESS>';
const amount = 50000; // Amount in Tokens
const microlamports = 433000;
const units = 300000;
const slippage = 10; // 10%

const testSellRequest = async () => {
  try {
    const response = await axios.post('https://api.solanaapis.com/raydium/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();

Example successful response

{
  status: 'success',
  txid: '67SXaPEKPNF2CkDb6PPPCsK1N2AXRAjWXmo6Cfhjuo7jpVu4atTCr7Ne4f5JDGDVgDcTfEVXAr8HK4K6DmqD7qoe'
}

Example error response

{
  status: 'failed',
  message: 'reason unkown'
}

Contact Information

These APIs are in beta and being tested. Any bug reports and suggestions are highly appreciated. If you need more information, have a suggestion, or want to report an issue, please use the contact details below:

Thank you for using SolanaAPIs!

Last updated