Questions tagged [instructions]
The instructions tag has no summary.
106 questions
0 votes
1 answer
5 views
Target orders optionnal on Raydium sell instructions?
I just asked this question to know if the target_orders don't need to be at index 4 in sell instructions. On the raydium amm doc (https://github.com/raydium-io/raydium-amm/blob/master/program/src/...
0 votes
0 answers
23 views
Buy token on Raydium AMM v4
I have this code to buy a token on Raydium AMM v4 but wanted advices from people who already worked on these types of code because it's pretty hard to find a clear documentation with all the ...
2 votes
1 answer
107 views
Buy instructions for Pumpfun
I want to create a function in Rust to buy a token on Pumpfun with a X amount of SOL. I struggled a bit with the offsets and the account order (I fetch it from https://github.com/pump-fun/pump-public-...
1 vote
2 answers
53 views
How to send lamports from signer to PDA inside an instruction (Anchor: place_bid in auction project)?
I’m new to Solana development and I'm building a learning project: an Auction program with Anchor. I have an instruction place_bid where I want to send a provided amount of lamports from the bidder (...
0 votes
1 answer
28 views
Trying to use WSOL ATA to buy tokens on cpmm
Cpmm config is not working, I tried using it to use my WSOL ATA to buy tokens but it's not working, is there anything am doing wrong? Can someone check my code below? const txData = await raydium.cpmm....
1 vote
1 answer
254 views
AnchorError occurred. Error Code: AccountNotEnoughKeys. Error Number: 3005. Error Message: Not enough account keys given to the instruction
I am trying to make a script to swap tokens in pumpfun before they graduate, I am rewriting the source code from pumpfun crate (https://docs.rs/pumpfun/latest/pumpfun/) I get the error on the title, I ...
2 votes
0 answers
25 views
Clarification on Signature for initializeTokenMetadataInstruction Without Explicitly Using mintAuthoritySigner
📣 Hello Solana Community! I’m currently working on adding token metadata during my SPL Token-2022 generation process, and I’d like to clarify something regarding how signing works when using the ...
1 vote
1 answer
33 views
If all PDA seeds are available on-chain, why must it still be passed via the Ix Context?
In Solana programs, it’s common to use PDAs whose seeds come entirely from on-chain data — no user input involved. Since the program has access to all required seeds, it seems like it could simply ...
0 votes
2 answers
50 views
Where derive PDAs?
I'm new developing on Anchor. I have to know where is more common or best practices derived a PDA like the following. I have a Event account with an collection_mint PDA and anyone can mint NFTs inside ...
0 votes
1 answer
86 views
Monitoring specific Instructions via Websocket logsSubscribe
I'm currently aiming to monitor specific instruction types using the WebSocket logsSubscribe method. I have a couple of questions: Comprehensive List of Instructions: Is there an available list ...
0 votes
1 answer
18 views
Pass account to Context vs as param
In anchor, when pass an existing account to an instruction, seems can pass via: 1. part of Context, then access via context. 2. instruction func's param, can access directly in function, or use #[...
0 votes
2 answers
44 views
Program authorities create vulnerability
I have a keypair authority for my program. Some instructions must be called at scheduled times and require the authority to do so. What is the best approach to do so? The only way I can see is to have ...
3 votes
1 answer
42 views
What is the state of account changes In a failed transaction containing multiple Instructions
If a transaction calls 3 instructions and the first 2 instructions in the transaction succeed but the third instruction fails, does the state changes performed in Instruction 1 and 2 persist or they ...
2 votes
1 answer
61 views
got the error: error[E0277]: `dyn solana_sdk::signature::Signer` cannot be shared between threads safely
Im trying to run service that will run anchor-client, but when Im trying to compile the project I got the error: error[E0277]: `dyn solana_sdk::signature::Signer` cannot be shared between threads ...
1 vote
2 answers
191 views
How to transfer ALL token from SPL token account without knowing how much exactly to transfer?
I'm running an arbitrage bot with the following logic: I transfer USDC from my ATA to auxiliary account I perform arbitrage (with 100% slippage) I checked the profit (on-chain program to secure ...