> For the complete documentation index, see [llms.txt](https://tucana-1.gitbook.io/tucana-developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tucana-1.gitbook.io/tucana-developer-docs/spot-dex/spot-dex-sdk/features/create-pool.md).

# Create Pool

## 1. Create pool

Just create one clmmpool, without adding any initial liquidity.

**Function input params**

* tick\_spacing: tick spacing will affect price precision. Now mainnet exist some different type tick\_spacing, they correspond to different fee rates.

  | tick spacing | fee rate |
  | ------------ | -------- |
  | 2            | 0.0001   |
  | 10           | 0.0005   |
  | 60           | 0.0025   |
  | 200          | 0.01     |
* initialize\_sqrt\_price: for computational convenience, we use fixed-point numbers to represent square root prices. Use the provided by the SDK transformation price to sqrtPrice: TickMath.priceToSqrtPriceX64().
* uri: the icon of pool, it's allows null.
* metadata\_a: the metadata address about tokenA.
* metadata\_b: the metadata address about tokenB.

**Example**

```typescript
 const token0 = currTokenConfig.USDC
 const token1 = currTokenConfig.USDT
 const tick_spacing = 60
 const initialize_sqrt_price = TickMath.tickIndexToSqrtPriceX64(TickMath.priceToTickIndex(d(1.1), token0.decimals, token1.decimals))

// Define pool creation parameters
 const params : CreatePoolParams = {
      tick_spacing,
      uri: '',
      initialize_sqrt_price: initialize_sqrt_price.toString(),
      metadata_a: token1.metadata,
      metadata_b: token0.metadata
    }

 const payload = sdk.Pool.createPoolPaylod(params)
 const respone = await executeTransaction([payload], sdk, key, false)
```

## 2. Create pool and add liquidity

Create one clmmpool and add some initial liquidity simultaneously. (Recommended)

**Function input params**

* tick\_lower: Represents the index of the lower tick boundary.
* tick\_upper: Represents the index of the upper tick boundary.
* amount\_a: the amount about Token A, which used to add liquidity.
* amount\_b: the amount about Token B, which used to add liquidity. Notice: amount a and b was calculated by ClmmPoolUtil.estLiquidityAndcoinAmountFromOneAmounts(), it will affected by selected tick interval、amount about one fixed Token(TokenA or TokenB)、current sqrt price of pool and allowed price slippage. You can see the usage in the next example.
* fix\_amount\_a: true means fixed TokenA amount, false means fixed TokenB amount.

**Example**

```typescript
const token0 = currTokenConfig.USDC
const token1 = currTokenConfig.USDT
const tick_spacing = 60
const initialize_price = TickMath.tickIndexToSqrtPriceX64(TickMath.priceToTickIndex(d(1.1), token0.decimals, token1.decimals))

const lowTick = TickPriceData.buildTickPriceData('0.8', tick_spacing, token0, token1)
const highTick = TickPriceData.buildTickPriceData('1.2', tick_spacing, token0, token1)

const fix_amount_a = true
const coin_amount = '1000000'
const slippage = 0.1

const liquidityInput = ClmmPoolUtil.estLiquidityAndcoinAmountFromOneAmounts(
    lowTick.tick,
    highTick.tick,
    new BN(coin_amount),
    fix_amount_a,
    true,
    slippage,
    initialize_price
)

const amount_a = fix_amount_a ? coin_amount : liquidityInput.tokenMaxA.toString()
const amount_b = fix_amount_a ? liquidityInput.tokenMaxB.toString() : coin_amount

// Define parameters for creating a pool with liquidity
const params : CreatePoolWithLiquidityParams= {
    tick_spacing,
    uri: '',
    initialize_price: initialize_price.toString(),
    metadata_a: token1.metadata,
    metadata_b: token0.metadata,
    tick_lower: lowTick.tick,
    tick_upper: highTick.tick,
    amount_a,
    amount_b,
    fix_amount_a
}
const payload = sdk.Pool.createPoolPaylod(params)
const respone = await executeTransaction([payload], sdk, key, false)
```
