Creating a Pool
MaplePoolDeployer deploys and configures everything a Pool needs in one transaction: the Pool Manager (which deploys the Pool), the queue-based Withdrawal Manager, the Open Term Loan Manager, and the Strategy Managers the Pool will fund. Only a Pool Delegate can call it. Full interface: PoolDeployer.
Prerequisites
The deployment reverts unless all of the following hold in Globals.
The caller is a valid Pool Delegate (
isPoolDelegate) and does not already own a Pool Manager.The Pool Deployer is registered as a pool deployer (
isPoolDeployer) and may deploy from the Withdrawal Manager factory (canDeployFrom).poolManagerFactoryis aPOOL_MANAGER_FACTORYinstance,withdrawalManagerFactoryis aWITHDRAWAL_MANAGER_QUEUE_FACTORYinstance andpoolPermissionManageris aPOOL_PERMISSION_MANAGERinstance.The Pool asset is a valid pool asset (
isPoolAsset).The Open Term Loan Manager factory is a
STRATEGY_FACTORYinstance. Globals lets any Pool Manager deploy from such a factory without further setup.Each Strategy Manager was deployed by a
STRATEGY_MANAGER_FACTORYinstance and supports the Pool asset. The Strategy Deployer deploys Strategy Managers beforehand.initialSupplyis zero, or Globals has a migration admin to receive the initial shares.
deployPool
function deployPool(
address poolManagerFactory,
address withdrawalManagerFactory,
PoolManagerInitParams calldata poolManagerInitParams,
PoolConfigParams calldata poolConfigParams,
StrategyDeployParams[] calldata strategiesParams,
StrategyManagerParams[] calldata strategyManagersParams
) external returns (address poolManager);PoolManagerInitParams
asset
address
The Pool asset
initialSupply
uint256
Shares minted to the migration admin at construction, normally zero
name, symbol
string
ERC-20 metadata of the Pool share token
PoolConfigParams
poolPermissionManager
address
The Pool Permission Manager
delegateManagementFeeRate
uint256
Delegate management fee rate, where 100_0000 is 100%
liquidityCap
uint256
Maximum totalAssets the Pool accepts
StrategyDeployParams (the Open Term Loan Manager)
factory
address
Strategy factory
cap
uint256
Strategy cap, zero leaves it unset
salt
bytes32
CREATE2 salt
deploymentData
bytes
Factory-specific data. The Pool Manager address is prepended automatically
StrategyManagerParams (one per Strategy Manager)
instance
address
An existing Strategy Manager
cap
uint256
Strategy cap, zero leaves it unset
What the transaction does
Deploys the Pool Manager from its factory. The initializer deploys the Pool, which approves the Pool Manager for its asset.
Deploys the queue Withdrawal Manager for the Pool.
For each
StrategyDeployParams, callsaddStrategyon the Pool Manager and, ifcapis non-zero,setStrategyCap.For each
StrategyManagerParams, callsaddStrategyManagerand, ifcapis non-zero,setStrategyCap.Emits
PoolDeployed(pool, poolManager, withdrawalManager, strategies, strategyManagers).Sets the delegate management fee rate, liquidity cap, Pool Permission Manager and Withdrawal Manager, then calls
completeConfiguration.
Addresses are deterministic. getPoolDeploymentAddresses, getQueueWithdrawalManagerAddress and getStrategiesAddresses return the addresses a deployment will produce.
Activation
A new Pool is configured but not active, so it rejects deposits with P:NOT_ACTIVE. The Governor or Operational Admin calls activatePoolManager(poolManager) on Globals. It checks the factory and the Pool Delegate, records the Pool Manager as the delegate's owned Pool, and calls setActive(true) on the Pool Manager.
After deployment
Once configured, the Pool Delegate, Governor or Operational Admin can change the liquidity cap, delegate management fee rate, Pool Permission Manager and strategy caps. Only the Governor can add strategies or Strategy Managers, only the Operational Admin can remove a Strategy Manager, and the Withdrawal Manager cannot be changed. See Pool Manager.
Last updated
Was this helpful?