pumpdotfun-sdk icon indicating copy to clipboard operation
pumpdotfun-sdk copied to clipboard

There are two types of errors related to purchases

Open Gtokentool opened this issue 1 year ago • 5 comments

When I make a single purchase of more than 1.5sol: SendTransactionError: Simulation failed. Message: Transaction simulation failed: Error processing Instruction 1: Program failed to complete. Logs: [ "Program log: Instruction: InitializeAccount3", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4188 of 984164 compute units", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success", "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 20307 of 1000000 compute units", "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success", "Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [1]", "Program log: Instruction: Buy", "Program log: panicked at programs/pump/src/lib.rs:152:9:\nattempt to subtract with overflow", "Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 18010 of 979693 compute units", "Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P failed: SBF program panicked" ]. Catch the SendTransactionError and call getLogs() on it for full details. at Connection.sendEncodedTransaction (chunk-XCAX5GFN.js?v=e792720a:14040:17) at async Connection.sendRawTransaction (chunk-XCAX5GFN.js?v=e792720a:14007:24) at async Connection.sendTransaction (chunk-XCAX5GFN.js?v=e792720a:13971:18) at async sendTx2 (util.ts:515:24) at async PumpFunSDK.oneCreateAndBuy (pumpfun.ts:306:18) at async cj (index.tsx:290:28) at async onClick (index.tsx:567:36)

When I add multiple purchases to a block, the total amount exceeds 1.5sol: SendTransactionError: Simulation failed. Message: Transaction simulation failed: Error processing Instruction 3: custom program error: 0x1772. Logs: [ "Program log: Instruction: InitializeAccount3", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4188 of 177903 compute units", "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success", "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 21807 of 195239 compute units", "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success", "Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [1]", "Program log: Instruction: Buy", "Program log: AnchorError thrown in programs/pump/src/lib.rs:136. Error Code: TooMuchSolRequired. Error Number: 6002. Error Message: slippage: Too much SOL required to buy the given amount of tokens..", "Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 18634 of 173432 compute units", "Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P failed: custom program error: 0x1772" ]. Catch the SendTransactionError and call getLogs() on it for full details. at Connection.sendEncodedTransaction (chunk-XCAX5GFN.js?v=e792720a:14040:17) at async Connection.sendRawTransaction (chunk-XCAX5GFN.js?v=e792720a:14007:24) at async Connection.sendTransaction (chunk-XCAX5GFN.js?v=e792720a:13971:18) at async sendTx2 (util.ts:515:24) at async PumpFunSDK.oneCreateAndBuy (pumpfun.ts:306:18) at async cj (index.tsx:290:28) at async onClick (index.tsx:567:36)

I'm using devnet and I'd like to ask if this happens on mainnet Looking forward to hearing from you

Gtokentool avatar Nov 05 '24 06:11 Gtokentool

滑点设置太小

zLikeMario avatar Nov 05 '24 07:11 zLikeMario

滑点设置太小

How much slippage do I need to set, the current slippage basis is 500 It's equivalent to 5% slippage, isn't it?

Gtokentool avatar Nov 05 '24 07:11 Gtokentool

Why do you speak English when you are Chinese? 你可以设置无限大,如果你不会因为币价的波动而执意要买入的话。

zLikeMario avatar Nov 05 '24 07:11 zLikeMario

Why do you speak English when you are Chinese? 你可以设置无限大,如果你不会因为币价的波动而执意要买入的话。

I've increased the slippage and no longer prompts "Error Code: TooMuchSolRequired. Error Number: 6002. Error Message: slippage: Too much SOL required to buy the given amount of tokens", but it will also prompt "failed: SBF program panicked"

Gtokentool avatar Nov 05 '24 07:11 Gtokentool

你为什么是中国人却说英语? 你可以设置无限大,如果你不会因为币价的波动而执着要买入的话。

I'm a sophomore and I took on a development assignment online, but I had a little trouble, this is someone else's home field, so I speak English more easily for everyone to understand

Gtokentool avatar Nov 05 '24 08:11 Gtokentool