> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meteora.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Pool Types & Configuration

> How DAMM v2 pool configs work — static vs dynamic, price range parameters, activation types, and what gets set at pool creation vs config creation.

## Config Types

DAMM v2 pools are created from a **config account** that pre-defines pool parameters. Two config types exist:

<Tabs>
  <Tab title="Static Config">
    Parameters are fixed when the config is created. All pools created from a static config inherit the same:

    * Fee structure (base fee mode, dynamic fee, protocol fee %)
    * `collect_fee_mode` (BothToken / OnlyB / Compounding)
    * `activation_type` (slot or timestamp)
    * Price range (`sqrt_min_price`, `sqrt_max_price`)

    **Best for:** Launchpads and protocols that want uniform pool settings across all their pools.
  </Tab>

  <Tab title="Dynamic Config">
    Pool creators define custom parameters at pool creation time. Only available for **private configs** (permissioned via `pool_creator_authority`).

    Configurable per-pool:

    * Fee structure
    * `collect_fee_mode`
    * `activation_type` and `activation_point`
    * Price range
    * Alpha vault settings

    **Best for:** Protocols that need per-pool customization (Meteora Invent, custom launchpads).
  </Tab>
</Tabs>

***

## Activation Types

Each pool can gate trading behind an activation point:

| `activation_type` | Value | Description                                    |
| ----------------- | ----- | ---------------------------------------------- |
| `Slot`            | `0`   | Trading opens at a specific Solana slot number |
| `Timestamp`       | `1`   | Trading opens at a specific Unix timestamp     |

Before the activation point, swaps are disabled. Only whitelisted vault programs (Alpha Vault) can trade.

<Note>
  Setting `activation_point: null` (or `0`) opens the pool for trading immediately.
</Note>

***

## Price Range

Every pool has a configured price range defined by:

| Parameter       | Type   | Description                                       |
| --------------- | ------ | ------------------------------------------------- |
| `sqrtMinPrice`  | `u128` | Lower bound of the price range (as √price × 2^64) |
| `sqrtMaxPrice`  | `u128` | Upper bound of the price range (as √price × 2^64) |
| `initSqrtPrice` | `u128` | Starting price at pool creation                   |

### Full Range vs Concentrated

| Mode               | `sqrtMinPrice`   | `sqrtMaxPrice`   |
| ------------------ | ---------------- | ---------------- |
| Full range (x·y=k) | `MIN_SQRT_PRICE` | `MAX_SQRT_PRICE` |
| Concentrated       | Custom lower     | Custom upper     |

<Warning>
  `CollectFeeMode.Compounding` (mode 2) **requires** full range. The SDK enforces `MIN_SQRT_PRICE` / `MAX_SQRT_PRICE` for compounding pools.
</Warning>

### Converting Price to √Price

```
sqrtPrice = √(tokenB_per_tokenA) × 2^64
```

The TypeScript SDK provides `getSqrtPriceFromPrice(price, decimalsA, decimalsB)` for this conversion.

***

## Pool Creation Parameters

When calling `createCustomPool`, the key parameters are:

| Parameter         | Type             | Description                                               |
| ----------------- | ---------------- | --------------------------------------------------------- |
| `tokenAMint`      | `PublicKey`      | Base token mint                                           |
| `tokenBMint`      | `PublicKey`      | Quote token mint (must be SOL or USDC for public configs) |
| `tokenAAmount`    | `BN`             | Initial base token deposit                                |
| `tokenBAmount`    | `BN`             | Initial quote token deposit (0 for one-sided)             |
| `sqrtMinPrice`    | `BN`             | Lower price bound                                         |
| `sqrtMaxPrice`    | `BN`             | Upper price bound                                         |
| `initSqrtPrice`   | `BN`             | Initial pool price                                        |
| `liquidityDelta`  | `BN`             | Initial liquidity (calculated from amounts)               |
| `collectFeeMode`  | `CollectFeeMode` | 0 = BothToken, 1 = OnlyB, 2 = Compounding                 |
| `activationType`  | `ActivationType` | 0 = Slot, 1 = Timestamp                                   |
| `activationPoint` | `BN \| null`     | When trading opens (null = immediate)                     |
| `hasAlphaVault`   | `boolean`        | Whether an alpha vault is associated                      |
| `poolFees`        | `PoolFeesParams` | Full fee configuration                                    |

***

## Pool State

On-chain, a pool account stores:

| Field                | Type              | Description                                 |
| -------------------- | ----------------- | ------------------------------------------- |
| `liquidity`          | `u128`            | Current total liquidity in the active range |
| `sqrtPrice`          | `u128`            | Current √price                              |
| `sqrtMinPrice`       | `u128`            | Pool price range lower bound                |
| `sqrtMaxPrice`       | `u128`            | Pool price range upper bound                |
| `tokenAAmount`       | `u64`             | Token A reserves                            |
| `tokenBAmount`       | `u64`             | Token B reserves                            |
| `collectFeeMode`     | `u8`              | Fee collection mode                         |
| `activationPoint`    | `u64`             | Trading activation point                    |
| `poolStatus`         | `u8`              | Pool enabled/disabled status                |
| `poolType`           | `u8`              | 0 = Permissionless, 1 = Customizable        |
| `feeAPerTokenStored` | `[u8; 32]`        | Cumulative fee A per unit liquidity (U256)  |
| `feeBPerTokenStored` | `[u8; 32]`        | Cumulative fee B per unit liquidity (U256)  |
| `rewardInfos`        | `[RewardInfo; 2]` | Farming reward state (2 slots)              |
| `metrics`            | `PoolMetrics`     | Cumulative swap/liquidity stats             |
