raydium-io / raydium-sdk-V2-demo

Open-source Typescript SDK demos
56 stars 31 forks source link

Failed to create the Market ID. #76

Closed AphobiaCat closed 2 months ago

AphobiaCat commented 2 months ago

I followed cruzshia's advice and used the two mint addresses already created in dev net as baseInfo and quoteInfo, with a Block height exceeded. The problem. pls help, thanks!

async createMarket() {
  let base_token = new PublicKey('E5gYGvqxYvRJEGd51dQqsXPdti3YXnFyXtb4JSkuM8kc');
  let quote_token = new PublicKey("E3QZcRgZrvG2QtBZCEGuPf9ctDGrRs8WgWQBdzy8ZjpF");
  const raydium = await initSdk()

  // check mint info here: https://api-v3.raydium.io/mint/list
  // or get mint info by api: await raydium.token.getTokenInfo('mint address')

  const { execute, extInfo, transactions } = await raydium.marketV2.create({
      baseInfo: {
          mint: base_token,
          decimals: 9,
      },
      quoteInfo: {
          mint: quote_token,
          decimals: 9,
      },
      lotSize: 1,
      tickSize: 0.01,
      // dexProgramId: OPEN_BOOK_PROGRAM,
      dexProgramId: DEVNET_PROGRAM_ID.OPENBOOK_MARKET, // devnet

      // requestQueueSpace: 5120 + 12, // optional
      // eventQueueSpace: 262144 + 12, // optional
      // orderbookQueueSpace: 65536 + 12, // optional

      txVersion,
      // optional: set up priority fee here
      computeBudgetConfig: {
              units: 600000,
              microLamports: 100000000,
      },
  })

  console.log(
      `create market total ${transactions.length} txs, market info: `,
      Object.keys(extInfo.address).reduce(
          (acc, cur) => ({
              ...acc,
              [cur]: extInfo.address[cur].toBase58(),
          }),
          {}
      )
  )

  const txIds = await execute({
      // set sequentially to true means tx will be sent when previous one confirmed
      sequentially: true,
  })

  console.log('create market txIds:', txIds)
}
cruzshia commented 2 months ago

maybe you should check your rpc config and set raydium cluster to devnet in config.ts. after test sdk works well as usual

cruzshia commented 2 months ago

and the mints you used for create market, their supply looks like to be zero for both... https://explorer.solana.com/address/E5gYGvqxYvRJEGd51dQqsXPdti3YXnFyXtb4JSkuM8kc?cluster=devnet https://explorer.solana.com/address/E3QZcRgZrvG2QtBZCEGuPf9ctDGrRs8WgWQBdzy8ZjpF?cluster=devnet

please make sure:

  1. you have enough sol in your devent wallet
  2. you have enough mints balance for create market in your wallet
  3. you can paste simulate base64 string printed in console to check what's going on here
  4. you can create devent mints here
image image
cruzshia commented 2 months ago

here's a normal txs should be

https://explorer.solana.com/tx/31uiEvC14PR4comSLeVt236kgeE1B7sn2EFLAJonHzZHVKQpRNaiUkYkonRMoYs7JGMpe7AvTZZVVLpQVqUKVam5?cluster=devnet https://explorer.solana.com/tx/4rH3dkoPVPRdehHpxTghAxN1NkcyLwgj8Eam2R47L8YdZDw6jjgC4JV5XyHgd5A3N76RPhHQGjyScRtobfcZfALd?cluster=devnet

mints should have supply and have some balances in your devent wallet

image image
AphobiaCat commented 2 months ago

here's a normal txs should be

https://explorer.solana.com/tx/31uiEvC14PR4comSLeVt236kgeE1B7sn2EFLAJonHzZHVKQpRNaiUkYkonRMoYs7JGMpe7AvTZZVVLpQVqUKVam5?cluster=devnet https://explorer.solana.com/tx/4rH3dkoPVPRdehHpxTghAxN1NkcyLwgj8Eam2R47L8YdZDw6jjgC4JV5XyHgd5A3N76RPhHQGjyScRtobfcZfALd?cluster=devnet

mints should have supply and have some balances in your devent wallet image image

Oh ok, I thought I needed to increase the supply when creating amm pool. I will try again, thank you