0xcrust / raydium-swap

78 stars 23 forks source link

Swap : Error processing Instruction 0 : custom program error : 0x2a #3

Open ricskyl opened 3 months ago

ricskyl commented 3 months ago

Hi, After numerous swap tests, this error still appears:

Error processing Instruction 0: custom program error: 0x2a User token input does not match amm

My command (I want to buy the WIF token, EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm, with SOL) : RUST_LOG=info cargo run swap --keypair ./provider.json --in-token EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm --out-token So11111111111111111111111111111111111111112 --amount-in 1 --pool-cache pools.json --price-cache prices.json

Result : [2024-07-02T05:44:29Z INFO swap] Read keypair from ./provider.json successfully. Address: GAQCNda9VnJ2B85R6mQriMc6GHuFNx1FgYGQgdrxnHRn [2024-07-02T05:44:29Z INFO swap] Input token mint=EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm. Output token mint=So11111111111111111111111111111111111111112 [2024-07-02T05:44:29Z INFO swap::api] Fetching liq-pool-infos from pool-cache. path=pools_light.json [2024-07-02T05:44:29Z INFO swap] User input-tokens ATA balance=0 [2024-07-02T05:44:29Z INFO swap::api] Fetching price-information from price-cache. path=prices.json [2024-07-02T05:44:29Z INFO swap::api] Fetching price-information from price-cache. path=prices.json [2024-07-02T05:44:29Z INFO swap] Current price of 1 input token=2.3142282190534473 USD [2024-07-02T05:44:29Z INFO swap] Current price of 1 output token=148.94342037522634 USD [2024-07-02T05:44:29Z INFO swap] decimals: 6 [2024-07-02T05:44:29Z INFO swap] min_expected_out =0.09275967007574965 [2024-07-02T05:44:29Z INFO swap] Initiating swap of 1 input tokens for 0.09275967007574965 output. Rate=64.35986699537625 input-tokens/1 output-token [2024-07-02T05:44:29Z INFO swap] Initializing swap with input tokens as pool base token [2024-07-02T05:44:32Z INFO swap] Error processing Instruction 0: custom program error: 0x2a

On solscan : Result / Fail / Program Error: "Instruction #1 Failed - User token input does not match amm" Instruction Details : #1 - Raydium Liquidity Pool V4: SwapBaseIn (Program Error: "User token input does not match amm")

1 Unknown Program instruction

Program log: Error: User token input does not match amm Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 consumed 12336 of 200000 compute units Program returned error: custom program error: 0x2a

I've tested swaps with several tokens and I always get this error. Any ideas?