admin管理员组

文章数量:1129075

I use quicknode metis jup to get quotes to build swaps, and trade through quicknode's solana nodes.I tried a lot, and even if I set the quote slippage parameter and swap priority fee to automatic, my transaction success rate was still low.Many transactions cannot be found on the chain at all, as if nothing happened.Below are the parameters I currently use to obtain quotes and build swaps:

`const params = {
        inputMint: "So11111111111111111111111111111111111111112",
        outputMint: "9BB6NFEcjBCtnNLFko2FqVQBq8HHM13kCyYcdQbgpump",
        amount: 10000000,
        slippageBps: 20,
        onlyDirectRoutes: true,
        autoSlippage: true
    };
    const quote = await jupiterTrader.getQuoteBase(params);`
`async getSwapTransaction(quoteResponse) {
    return await promiseRetry(async (retry) => {
        try {
            const response = await fetch('', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({
                    quoteResponse,
                    userPublicKey: this.wallet.publicKey.toString(),
                    wrapAndUnwrapSol: true,
                    dynamicComputeUnitLimit: true,
                    prioritizationFeeLamports: 'auto'
                })
            });

            if (!response.ok) {
                throw new Error(`API请求失败: ${response.status}`);
            }

            return response.json();
        } catch (error) {
            return retry(error);
        }
    }, this.RETRY_OPTIONS);
}`

I want to achieve a 90% success rate in my transactions. I mainly trade mainstream currencies through JUP's API, and I am willing to pay priority fees. I hope you can share some good code snippets or point out problems with my code.

本文标签: