-
Notifications
You must be signed in to change notification settings - Fork 19
Pool Creation
Lucas Manuel edited this page Apr 4, 2021
·
7 revisions
Creating a Pool in Maple is a multi-step process, which requires the following prerequisite transactions (assuming that the Maple protocol is in a fresh, newly deployed state)
- Deploy PoolFactory
- Deploy LiquidityLockerFactory
- Deploy StakeLockerFactory
-
globals.setValidPoolFactory(address(poolFactory), true);
- Validate PoolFactory -
globals.setValidSubFactory(address(poolFactory), address(llFactory), true);
- Validate LiquidityLockerFactory -
globals.setValidSubFactory(address(poolFactory), address(slFactory), true);
- Validate StakeLockerFactory -
globals.setPoolDelegateAllowlist(address(poolDelegate), true);
- Validate PoolDelegate -
globals.setLiquidityAsset(USDC, true);
- Validate ERC-20 to be used by Pool (example: USDC) - Create and finalize 50-50 MPL-USDC Balancer Pool (example for USDC, if liquidityAsset is DAI, must create and finalize MPL-DAI 50-50 Balancer Pool. Other pair asset MUST be MPL)
-
setValidBalancerPool(address(bPool), true);
- Validate Balancer pool
- Create a Pool from the PoolFactory:
function createPool(
address liquidityAsset,
address stakeAsset,
address slFactory,
address llFactory,
uint256 stakingFee,
uint256 delegateFee,
uint256 liquidityCap
)
Example:
poolFactory.createPool(
USDC,
address(bPool),
address(slFactory),
address(llFactory),
500,
100,
100_000_000 * 10 ** 6
));
NOTE: Once a Pool is created, it is in the Initialized
state, meaning that it has been deployed successfully, but is not yet operational.
- Add liquidity to the Balancer pool, obtaining BPTs. Here is a link to the Balancer docs for how to perform this action.
- Approve the StakeLocker to spend the BPTs
- Get the minimum stake amount required from
(,,, uint256 minStake,) = pool.getInitialStakeRequirements();
-
stake
at least the minimum stake amount into the StakeLocker -
finalize
the Pool
Once the Pool is finalized, LPs can start depositing liquidity into the Pool.