Skip to main content
This guide demonstrates how to create a new BEX pool using the PoolCreationHelper contract. The PoolCreationHelper is a Relayer allowing pools to be created and joined in a single transaction, simplifying the pool creation process.
For more comprehensive pool creation examples, see the pool creation examples in the BEX SDK repository.

Requirements

Before creating a pool, you’ll need the addresses of tokens you want to include in your pool and tokens to join the pool.

Example: creating a weighted pool

In this example, we’ll create a 50/50 HONEY-WBTC weighted pool using Ethers.js. Following pool creation, the pool will be joined with 1 HONEY and 0.0001 WBTC.

Step 1 - approve the PoolCreationHelper

The PoolCreationHelper must be approved as a relayer in the Vault contract:

Step 2 - approve tokens

The Vault contract needs approval to spend your tokens:

Step 3 - create and join pool

Finally, create and join the pool in a single transaction. We leverage the function createAndJoinWeightedPool.