Skip to main content
Initializes the YES and NO SPL token mints for an existing market. Must be called by the market creator immediately after createMarket. This is a separate instruction for Solana stack safety.

Access

Creator — only the original market creator can call this.

Accounts

AccountTypeDescription
creatorSigner, mutMarket creator (pays mint rent)
marketPDA, mut["market", market_id]
yesMintPDA, mut["yes_mint", market_id] — created by this instruction
noMintPDA, mut["no_mint", market_id] — created by this instruction
tokenMintRead-onlyUSDC mint (for decimals)
tokenProgramProgramSPL Token Program
systemProgramProgramSystem Program

Arguments

marketId
u64
required
The market ID returned from createMarket.

Example

const yesMint = PublicKey.findProgramAddressSync(
  [Buffer.from("yes_mint"), b8(marketId)], PROGRAM_ID
)[0];
const noMint = PublicKey.findProgramAddressSync(
  [Buffer.from("no_mint"), b8(marketId)], PROGRAM_ID
)[0];

await program.methods
  .initMarketMints(new BN(marketId))
  .accounts({
    creator: wallet.publicKey,
    market: marketPda,
    yesMint,
    noMint,
    tokenMint: USDC_MINT,
  })
  .signers([wallet])
  .rpc();

On-Chain Log

Market 7 mints initialized: YES=<mint_address> NO=<mint_address>

Cost

  • Rent: ~0.0015 SOL per mint (2 mints = ~0.003 SOL total)
  • Transaction fee: ~0.000005 SOL
The mints use the same number of decimals as USDC (6). The mint authority is the Market PDA, meaning only the program can mint and burn tokens.