magicblock-labs / magicblock-labs/Solana.Unity-Core

[Bug] Error running the example given by jupiter

Open
#54 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
53
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Error running the example given by jupiter

`IDexAggregator dex = new JupiterDexAg(account_1.PublicKey);

TokenData tokenA = await dex.GetTokenBySymbol("SOL");
TokenData tokenB = await dex.GetTokenBySymbol("USDC");

SwapQuoteAg swapQuote = await dex.GetSwapQuote(
tokenA.MintAddress,
tokenB.MintAddress,
DecimalUtil.ToUlong(5m, tokenB.Decimals),
SwapMode.ExactOut
);
var quote = DecimalUtil.FromBigInteger(swapQuote.InputAmount, tokenA.Decimals);

Transaction tx = await dex.Swap(swapQuote);

var result = await SignAndSendTransaction(tx, account_1);

Console.WriteLine(result);`

**Error Content**
Transaction simulation failed: Error processing Instruction 2: Provided seeds do not result in a valid address

**Detailed Information**
{"jsonrpc":"2.0","error":{"code":-32002,"message":"Transaction simulation failed: Error processing Instruction 2: Provided seeds do not result in a valid address","data":{"accounts":null,"err":{"InstructionError":[2,"InvalidSeeds"]},"innerInstructions":null,"logs":["Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program ComputeBudget111111111111111111111111111111 invoke [1]","Program ComputeBudget111111111111111111111111111111 success","Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]","Program log: CreateIdempotent","Program log: Error: Associated address does not match seed derivation","Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 4960 of 1399700 compute units","Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL failed: Provided seeds do not result in a valid address"],"returnData":null,"unitsConsumed":5260}},"id":0}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the JupiterDexAg example shown in the issue and follow the SignAndSendTransaction call, focusing on instruction 2 and the associated-address seed error in the simulation logs. Done means the example transaction simulates and sends successfully without the InvalidSeeds error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.