Pool Creation
Creating Pools
Via Controller
async function createPool(
controller: Contract,
tokenA: string,
tokenB: string,
fee: number,
tickSpacing: number,
feeManager: string
) {
const tx = await controller.createPool(
tokenA,
tokenB,
fee,
tickSpacing,
feeManager
);
const receipt = await tx.wait();
const event = receipt.events.find((e: any) => e.event === 'PoolCreated');
const poolAddress = event.args.pool;
console.log('Pool created:', poolAddress);
return poolAddress;
}Common Pool Configurations
Pair Type
Fee (bps)
Tick Spacing
Use Case
Example Pool Creation Script
Initializing Pools
Price Encoding
Simple Price Encoding
Initialize via Controller
Initialize Directly on Pool
Setting Protocol Fees
Fee Protocol Values
Value
Protocol Share
LP Share
Set via Controller
Verifying Pool Creation
Check Pool Exists
Full Verification Script
Adding Initial Liquidity
Next Steps
Last updated