# Guide: Deploying a Pool

### Deploying a Hyperdrive pool <a href="#deploying-a-hyperdrive-pool" id="deploying-a-hyperdrive-pool"></a>

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://element-2.gitbook.io/element-developer-docs/integrations/guide-deploying-a-pool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
