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.
The spacing between price ticks for the pool.
Optional
initialPrice: number = 1The initial price of token 1 in terms of token 2.
Optional
funder: TransactionSigner = FUNDERThe account that will fund the initialization process.
A promise that resolves to an object containing the pool creation instructions, the estimated initialization cost, and the pool address.
import { createConcentratedLiquidityPoolInstructions, 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 tickSpacing = 64;
const initialPrice = 0.01;
const { poolAddress, instructions, initializationCost } = await createConcentratedLiquidityPoolInstructions(
devnetRpc,
tokenMintOne,
tokenMintTwo,
tickSpacing,
initialPrice,
wallet
);
console.log(`Pool Address: ${poolAddress}`);
console.log(`Initialization Cost: ${initializationCost} lamports`);
Creates the necessary instructions to initialize a Concentrated Liquidity Pool (CLMM) on Orca Whirlpools.