Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are two types of errors related to purchases #50

Open
Gtokentool opened this issue Nov 5, 2024 · 5 comments
Open

There are two types of errors related to purchases #50

Gtokentool opened this issue Nov 5, 2024 · 5 comments

Comments

@Gtokentool
Copy link

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

@YaminZheng
Copy link

滑点设置太小

@Gtokentool
Copy link
Author

Gtokentool commented Nov 5, 2024

滑点设置太小

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

@YaminZheng
Copy link

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

@Gtokentool
Copy link
Author

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
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants