Guide: Deploying a Pool
Deploying a Hyperdrive pool
In order to deploy and initialize a Hyperdrive pool using the HyperdriveFactory
, a user will go through the following steps:
Choose a
bytes32
deployment ID that will identify the deployment within the corresponding deployer coordinator. This ID allows the user to complete the deployment over the course of several transactions. The factory will hash this deployment ID with the user's address to ensure that the user's deployment cannot be front-run.Choose a deployer coordinator to use when deploying the pool. This is equivalent to choosing the Hyperdrive implementation to use for the deployment.
Choose a pool configuration and ensure that it is a valid pool configuration based on the factory's current configuration.
Choose the appropriate parameters for the specific deployer coordinator that is being used and ABI encode it into a string of bytes. This is called the deployment's "extra data."
Choose a time stretch APR to use to configure the pool's time stretch parameter. In addition to this APR, the factory will use the specified position duration to configure the time stretch parameter.
Choose a fixed APR to use when initializing the pool.
Choose a
create2
salt to use for the deployment.Call
deployTarget
on the Hyperdrive factory with the chosen deployment ID, deployer coordinator, configuration, extra data fixed APR, time stretch APR, salt, and atargetIndex
of 0. By convention, the target0 contract must be deployed first.Call
deployTarget
on the Hyperdrive factory with the same data and atargetIndex
ranging from 1 to the index of the largest target (for Hyperdrive v1, the user needs to deploy target1, target2, target3, and target4 in this step).Call
deployAndInitialize
on the Hyperdrive factory with the same data and a contribution amount that specifies the amount of liquidity that the user wants to provide when initializing the pool. The user must set an approval prior to making this call or send ether in the call so that there are sufficient funds available to initialize the pool.
Last updated