danbayk / solana-spl-token-sniper

Solana SPL-Token sniper for new Raydium liquidity pools
155 stars 58 forks source link

The amm account owner is not match with this program. #2

Open winktool opened 7 months ago

danbayk commented 7 months ago

That error is generated when attempting to swap a token that doesn't have added liquidity yet which is part of the strategy that spams buy txs, it will eventually go through the moment liquidity is added. I didn't expect people to actually use this code; I'll update it to make it less confusing.

winktool commented 7 months ago

Haha, thanks for your contribution. It's gold that shines.

winktool commented 7 months ago
ws.onopen = () => {
  ws.send(
    JSON.stringify({
      jsonrpc: "2.0",
      id: 1,
      method: "blockSubscribe",
      params: [
        {
          mentionsAccountOrProgram:
            "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX",
        },
        {
          commitment: "confirmed",
          maxSupportedTransactionVersion: 0,
          encoding: "jsonParsed",
        },
      ],
    })
  );
};
confirmed
winktool commented 7 months ago

That error is generated when attempting to swap a token that doesn't have added liquidity yet which is part of the strategy that spams buy txs, it will eventually go through the moment liquidity is added. I didn't expect people to actually use this code; I'll update it to make it less confusing.

SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 3: custom program error: 0x1b

danbayk commented 7 months ago

SendTransactionError: failed to send transaction: Transaction simulation failed: Error processing Instruction 3: custom program error: 0x1b

Keep waiting, the script that listens for openbook "initialize market" starts sending swap transactions as soon as it finds a newly created market id. It usually takes ~1-2 minutes for liquidity to be added to Raydium. These two events are independent but the initialize market must happen before Raydium add liquidity. If you confirm that the token is actually live with liquidity and you still get that error lmk.

winktool commented 7 months ago

Got it, looking forward to your optimised code.

winktool commented 7 months ago
Server responded with 429 Too Many Requests.  Retrying after 500ms delay...

plz how to solve this in code?

danbayk commented 7 months ago

plz how to solve this in code?

That's due to rate-limits on non-paid RPC connections, including the default one for Solana. As long as it doesn't time out and stop retrying the code will work. You can add a deley between each retry to avoid hitting the limit but I suspect it would be slower than waiting out the RPC cooldown.

This code isn't optimized and it also makes a lot of repeat RPC calls with each swap retry which increases the chances of hitting the RPC call limit. I'll upload my improved version as I see people are interested this.

winktool commented 7 months ago

Thank you very much and I hope to see an update from you soon. The crypto world is full of passion because of you!

winktool commented 7 months ago

I think it would be nice to be able to buy and sell tokens automatically.

darth-raijin commented 6 months ago

Code is good man, making bread :100: Working on adding auto sell feature based on percentage gain. Could prob make a ladder based approach with gradual selloffs