From 6f0d5467afc896ae39cff86bd3ba9fa038989cf7 Mon Sep 17 00:00:00 2001 From: zhourunlai Date: Thu, 9 Jan 2025 14:19:23 +0800 Subject: [PATCH] solana transaction more lenient --- packages/plugin-solana/src/actions/fomo.ts | 6 +++--- packages/plugin-solana/src/actions/pumpfun.ts | 4 ++-- packages/plugin-solana/src/actions/swapUtils.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/plugin-solana/src/actions/fomo.ts b/packages/plugin-solana/src/actions/fomo.ts index e9713c62eb..72946c794c 100644 --- a/packages/plugin-solana/src/actions/fomo.ts +++ b/packages/plugin-solana/src/actions/fomo.ts @@ -66,7 +66,7 @@ export const createAndBuyToken = async ({ priorityFee, requiredLiquidity = 85, allowOffCurve, - commitment = "finalized", + commitment = "confirmed", fomo, connection, }: { @@ -182,7 +182,7 @@ export const buyToken = async ({ slippage, connection, currency = "sol", - commitment = "finalized", + commitment = "confirmed", }: { fomo: Fomo; buyer: Keypair; @@ -281,7 +281,7 @@ export const sellToken = async ({ slippage, connection, currency = "token", - commitment = "finalized", + commitment = "confirmed", }: { fomo: Fomo; seller: Keypair; diff --git a/packages/plugin-solana/src/actions/pumpfun.ts b/packages/plugin-solana/src/actions/pumpfun.ts index 30d6f29237..043362b0e9 100644 --- a/packages/plugin-solana/src/actions/pumpfun.ts +++ b/packages/plugin-solana/src/actions/pumpfun.ts @@ -56,7 +56,7 @@ export const createAndBuyToken = async ({ buyAmountSol, priorityFee, allowOffCurve, - commitment = "finalized", + commitment = "confirmed", sdk, connection, slippage, @@ -416,7 +416,7 @@ export default { const wallet = new Wallet(deployerKeypair); const provider = new AnchorProvider(connection, wallet, { - commitment: "finalized", + commitment: "confirmed", }); const sdk = new PumpFunSDK(provider); // const slippage = runtime.getSetting("SLIPPAGE"); diff --git a/packages/plugin-solana/src/actions/swapUtils.ts b/packages/plugin-solana/src/actions/swapUtils.ts index 64dcd713c6..8324ac2bbf 100644 --- a/packages/plugin-solana/src/actions/swapUtils.ts +++ b/packages/plugin-solana/src/actions/swapUtils.ts @@ -82,7 +82,7 @@ export const executeSwap = async ( lastValidBlockHeight: latestBlockhash.lastValidBlockHeight, blockhash: latestBlockhash.blockhash, }, - "finalized" + "confirmed" ); if (confirmation.value.err) { elizaLogger.log("Confirmation error", confirmation.value.err);