Finds a free pool seed index for this mint pair + amm config by checking
pool PDA existence on-chain (batched). Raydium reserves index 0.
By default the scan starts at a RANDOM index. The bucket's configured
poolSeedIndex is public on-chain state, so another (potentially hostile)
launch of the same mint pair and fee tier can occupy it — and if the
fallback were sequential, the next index would be just as predictable. An
unpredictable fresh index, repointed and graduated atomically in a single
transaction or bundle, leaves no moment where the new index is visible
on-chain before the pool exists. Pass startIndex for a deterministic
scan.
Run this before graduation: if the configured index is no longer free,
point the bucket at the returned one via updateRaydiumClmmBucketV2
(pre-finalize) or updateRaydiumClmmBucketV2PostFinalize, in the same
transaction or bundle as the graduation itself.
Finds a free pool seed index for this mint pair + amm config by checking pool PDA existence on-chain (batched). Raydium reserves index 0.
By default the scan starts at a RANDOM index. The bucket's configured
poolSeedIndexis public on-chain state, so another (potentially hostile) launch of the same mint pair and fee tier can occupy it — and if the fallback were sequential, the next index would be just as predictable. An unpredictable fresh index, repointed and graduated atomically in a single transaction or bundle, leaves no moment where the new index is visible on-chain before the pool exists. PassstartIndexfor a deterministic scan.Run this before graduation: if the configured index is no longer free, point the bucket at the returned one via
updateRaydiumClmmBucketV2(pre-finalize) orupdateRaydiumClmmBucketV2PostFinalize, in the same transaction or bundle as the graduation itself.