Skip to content
🚧 Under Development! May be incomplete.Some pages/links may be incomplete or subject to change.

PoolCreationHelper

0x00b4626883A3b4566A061372C93168fbE2020D8a | ABI JSON

Helper contract to create and join pools in a single transaction. Supports joining WBERA pools with BERA. Non-standard ERC20 tokens and double-entrypoint tokens are not supported.

Note: This contract must be approved as a relayer by the pool creator inside the vault contract to join pools (using setRelayerApproval).

Functions

createAndJoinWeightedPool

Creates a weighted pool and joins it in a single transaction. Allows users to create a WBERA weighted pool and join it with either WBERA or BERA.

solidity
function createAndJoinWeightedPool(
    string memory name,
    string memory symbol,
    IERC20[] memory createPoolTokens,
    IERC20[] memory joinPoolTokens,
    uint256[] memory normalizedWeights,
    IRateProvider[] memory rateProviders,
    uint256 swapFeePercentage,
    uint256[] memory amountsIn,
    address owner,
    bytes32 salt
) external payable returns (address pool)

Parameters

NameTypeDescription
namestringName of the pool
symbolstringSymbol of the pool
createPoolTokensIERC20[]Tokens to create the pool with
joinPoolTokensIERC20[]Tokens to join the pool with
normalizedWeightsuint256[]Normalized weights for the pool
rateProvidersIRateProvider[]Rate providers for the pool
swapFeePercentageuint256Swap fee percentage for the pool
amountsInuint256[]Amounts to join the pool with
owneraddressOwner of the pool
saltbytes32Unique salt for deterministic pool address creation

Pools with BERA

Pools created with WBERA should use the WBERA token address in the createPoolTokens array

joinPoolTokens should use address(0) at the WBERA index if joining a pool with BERA (with msg.value equal to the WBERA amount in the amountsIn array)

createAndJoinStablePool

Creates a stable pool and joins it in a single transaction. Allows users to create a WBERA stable pool and join it with either WBERA or BERA.

solidity
function createAndJoinStablePool(
    string memory name,
    string memory symbol,
    IERC20[] memory createPoolTokens,
    uint256 amplificationParameter,
    IRateProvider[] memory rateProviders,
    uint256[] memory tokenRateCacheDurations,
    bool exemptFromYieldProtocolFeeFlag,
    uint256 swapFeePercentage,
    uint256[] memory amountsIn,
    address owner,
    bytes32 salt,
    bool joinWBERAPoolWithBERA
) external payable returns (address pool)

Parameters

NameTypeDescription
namestringName of the pool
symbolstringSymbol of the pool
createPoolTokensIERC20[]Tokens to create the pool with
amplificationParameteruint256Amplification parameter for the pool
rateProvidersIRateProvider[]Rate providers for the pool
tokenRateCacheDurationsuint256[]Cache durations for the pool tokens
exemptFromYieldProtocolFeeFlagboolIf true, exempt from yield protocol fee
swapFeePercentageuint256Swap fee percentage for the pool
amountsInuint256[]Amounts to join the pool with
owneraddressOwner of the pool
saltbytes32Unique salt for deterministic pool address creation
joinWBERAPoolWithBERAboolIf true, join the WBERA pool with BERA (msg.value corresponds to WBERA in amountsIn)

Events

WeightedPoolCreated

Emitted when a weighted pool is created.

solidity
event WeightedPoolCreated(string name, string symbol, address indexed pool)

ComposableStablePoolCreated

Emitted when a composable stable pool is created.

solidity
event ComposableStablePoolCreated(string name, string symbol, address indexed pool)