• Creates the necessary instructions to initialize a Splash Pool on Orca Whirlpools.

    Parameters

    • rpc: Rpc<GetAccountInfoApi & GetMultipleAccountsApi>

      A Solana RPC client for communicating with the blockchain.

    • tokenMintA: Address

      The first token mint address to include in the pool.

    • tokenMintB: Address

      The second token mint address to include in the pool.

    • OptionalinitialPrice: number = 1

      The initial price of token 1 in terms of token 2.

    • Optionalfunder: TransactionSigner = FUNDER

      The account that will fund the initialization process.

    Returns Promise<CreatePoolInstructions>

    A promise that resolves to an object containing the pool creation instructions, the estimated initialization cost, and the pool address.

    import { createSplashPoolInstructions, setWhirlpoolsConfig } from '@orca-so/whirlpools';
    import { generateKeyPairSigner, createSolanaRpc, devnet, address } from '@solana/web3.js';

    await setWhirlpoolsConfig('solanaDevnet');
    const devnetRpc = createSolanaRpc(devnet('https://api.devnet.solana.com'));
    const wallet = await generateKeyPairSigner(); // CAUTION: This wallet is not persistent.

    const tokenMintOne = address("So11111111111111111111111111111111111111112");
    const tokenMintTwo = address("BRjpCHtyQLNCo8gqRUr8jtdAj5AjPYQaoqbvcZiHok1k"); // devUSDC
    const initialPrice = 0.01;

    const { poolAddress, instructions, initializationCost } = await createSplashPoolInstructions(
    devnetRpc,
    tokenMintOne,
    tokenMintTwo,
    initialPrice,
    wallet
    );

    console.log(`Pool Address: ${poolAddress}`);
    console.log(`Initialization Cost: ${initializationCost} lamports`);