Jupiter Swap V6 Problem with commission.

Hello, I have a problem. I made a node js script to send a swap through the jupiter ag platform.

My transaction is successful, but the solscan page displays No Data and there is no transaction, it does not go through.

As I understand it, the error is that in my transaction the commission is minimal and therefore the transaction does not go through. Out of 50 transactions, only 1-2 are successful for me. I have a referral API key but I don’t understand how to install it to make a commission.

Please help me how can I set a commission for a transaction, I looked at the documentation but I still don’t understand how to set it correctly in order to set a commission for a transaction.



Here is an example transaction: https://solscan.io/tx/gz8wng1SqCgkaYZsZBMzt5GwZESZ41DQHuycTLENCKmj5empCLyVoJoPvwzvcbVkNRB5MKZQHVaa8eNk8eCz3Ww Solscan

Here is my code that I use to make a swap:

import { Connection, Keypair, PublicKey, VersionedTransaction } from '@solana/web3.js';
import { createJupiterApiClient } from '@jup-ag/api';
import { Wallet } from '@project-serum/anchor';
import axios from 'axios';
import bs58 from 'bs58';
import logger from './logger.js';
import { cfgSwap, cfgScript, cfgDeal } from './config.js';

const jupiterQuoteApi = createJupiterApiClient();
const wallet = new Wallet(Keypair.fromSecretKey(bs58.decode(cfgSwap.PRIVATE_KEY || '')));
const connection = new Connection(cfgScript.RPC_ENDPOINT, { wsEndpoint: cfgScript.RPC_WEBSOCKET });
const feeAccount = "FTECPy8Qt1JtJwvE7p3qPuvVLWB";

async function swap(input_mint, output_mint, amount) {
    const new_amount = amount * cfgDeal.SOL_DIVIDE;
    const slippagebps = cfgDeal.MAX_SLIPPAGE_TOLERANCE;
    const extrafee = cfgDeal.EXTRA_FEE;

    const quote = await jupiterQuoteApi.quoteGet({
        inputMint: input_mint,
        outputMint: output_mint,
        amount: new_amount,
        slippageBps: slippagebps,
        swapMode: 'ExactOut',
        onlyDirectRoutes: false,
        asLegacyTransaction: false,

    const swapTransaction = await jupiterQuoteApi.swapPost({
        swapRequest: {
            quoteResponse: quote,
            userPublicKey: wallet.publicKey.toBase58(),
            dynamicComputeUnitLimit: true,
            wrapAndUnwrapSol: true,
            prioritizationFeeLamports: 'auto',
            preflightCommitment: 'processed',
        logger.info('[post_swap] Attempting to send a request.');
        const swapTransactionBuffer = Buffer.from(swapTransaction.swapTransaction, "base64");
        const transaction = VersionedTransaction.deserialize(swapTransactionBuffer);
        var tryAgain = true;
        var objSignatureStatusResult;
        var maxTriesCounter = 0;
        var maxTries = 5;
        logger.info('[transaction] Attempting to create a transaction');
        while (tryAgain) {
            const rawTransaction = transaction.serialize();
            const txid = await connection.sendRawTransaction(rawTransaction, {
            skipPreflight: true,
            maxRetries: 5,
            preflightCommitment: 'confirmed',
            logger.info(`Swap successful! Transaction ID: ${txid}`);
            logger.info(`View the transaction Sosclan: https://solscan.io/tx/${txid}`);
            await new Promise(r => setTimeout(r, 1500));
            const result = await connection.getSignatureStatus(txid, {
            searchTransactionHistory: true,
            objSignatureStatusResult = JSON.parse(JSON.stringify(result));
            if (objSignatureStatusResult.value !== null) tryAgain = false;
            if (maxTriesCounter>maxTries) tryAgain = false;
            return txid;

async function swapRun() {
    await swap(



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.