# IPoolInitializer

Creates and initializes V3 Pools

Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that require the pool to exist.

*Developer note: Credit to Uniswap Labs under GPL-2.0-or-later license: <https://github.com/Uniswap/v3-periphery>*

## Functions

### createAndInitializePoolIfNecessary

`function createAndInitializePoolIfNecessary(address token0, address token1, uint160 sqrtPriceX96) external payable returns (address pool)` payable external

Creates a new pool if it does not exist, then initializes if not initialized *Developer note: This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool*

| Name         | Type    | Description                                                 |
| ------------ | ------- | ----------------------------------------------------------- |
| token0       | address | The contract address of token0 of the pool                  |
| token1       | address | The contract address of token1 of the pool                  |
| sqrtPriceX96 | uint160 | The initial square root price of the pool as a Q64.96 value |

**Returns:**

| Name | Type    | Description                                                                                                           |
| ---- | ------- | --------------------------------------------------------------------------------------------------------------------- |
| pool | address | Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary |


---

# 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://docs.algebra.finance/algebra-integral-documentation/algebra-v1-technical-reference/contracts/api-reference-v1.9/v1.9-periphery/ipoolinitializer.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.
