A Solana RPC client for communicating with the blockchain.
The first token mint address to include in the pool.
The second token mint address to include in the pool.
Optionalconfig: CreatePoolConfig = {}The parameters to build the create splash pool instruction.
A promise that resolves to an object containing the pool creation instructions, the estimated initialization cost, and the pool address.
import { createSplashPoolInstructions, WhirlpoolDeployment } from '@orca-so/whirlpools';
import { generateKeyPairSigner, createSolanaRpc, devnet, address } from '@solana/kit';
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 { poolAddress, instructions, initializationCost } = await createSplashPoolInstructions(
devnetRpc,
tokenMintOne,
tokenMintTwo,
{
initialPrice: 0.01,
funder: wallet,
whirlpoolDeployment: WhirlpoolDeployment.devnet,
},
);
console.log(`Pool Address: ${poolAddress}`);
console.log(`Initialization Cost: ${initializationCost} lamports`);
Creates the necessary instructions to initialize a Splash Pool on Orca Whirlpools.