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:

  1. 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.

  2. Choose a deployer coordinator to use when deploying the pool. This is equivalent to choosing the Hyperdrive implementation to use for the deployment.

  3. Choose a pool configuration and ensure that it is a valid pool configuration based on the factory's current configuration.

  4. 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."

  5. 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.

  6. Choose a fixed APR to use when initializing the pool.

  7. Choose a create2 salt to use for the deployment.

  8. Call deployTarget on the Hyperdrive factory with the chosen deployment ID, deployer coordinator, configuration, extra data fixed APR, time stretch APR, salt, and a targetIndex of 0. By convention, the target0 contract must be deployed first.

  9. Call deployTarget on the Hyperdrive factory with the same data and a targetIndex 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).

  10. 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