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

# Create Pool CLMM

> Learn how to create new pool clmm on Cetus

Create pool CLMM Cetus

## Usage

```javascript theme={null}
// Create pool clmm
const form: ICreateTokenForm = {
  coinTypeA:
    "0x92aad4e078dded45773628adc3a9977d546b178bdadabcae351ce1818c5bb1fb::sc::SC",
  coinTypeB: "0x2::sui::SUI",
  initializePrice: 1,
  tickSpacing: 10,
  inputTokenAmount: 1,
  isTokenAInput: true,
  slippage: 0.07,
};

const result = await agent.createPoolCetusCLMM(form);
```

## Parameters

| Parameter        | Type    | Required | Description                                                   |
| ---------------- | ------- | -------- | ------------------------------------------------------------- |
| coinTypeA        | string  | Yes      | Address or symbol of the first token                          |
| coinTypeB        | string  | Yes      | Address or symbol of the second token                         |
| initializePrice  | number  | Yes      | Initial price for the token pair                              |
| tickSpacing      | number  | Yes      | The spacing between ticks in the liquidity pool               |
| inputTokenAmount | number  | Yes      | Amount of tokens to be provided as input                      |
| isTokenAInput    | boolean | Yes      | true means fixed coinA amount, false means fixed coinB amount |
| slippage         | number  | Yes      | Maximum allowable slippage (e.g., 0.07 for 7%)                |

## Example Prompts

### Natural Language Prompts

```javascript theme={null}
"Create a Cetus CLMM pool with the following parameters:
coinTypeA: 0x92aad4e078dded45773628adc3a9977d546b178bdadabcae351ce1818c5bb1fb::sc::SC
coinTypeB: 0x2::sui::SUI
Initialize Price: 1
Tick Spacing: 10
Input Token Amount: 1
Is Token A Input: true
Slippage: 0.07"
```

### LangChain Tool Prompts

```javascript theme={null}
{
 coinTypeA:
   "0x92aad4e078dded45773628adc3a9977d546b178bdadabcae351ce1818c5bb1fb::sc::SC",
 coinTypeB: "0x2::sui::SUI",
 initializePrice: 1,
 tickSpacing: 10,
 inputTokenAmount: 1,
 isTokenAInput: true,
 slippage: 0.07,
}
```

## Example Implementation

```javascript theme={null}
import { SuiAgentKit, ICreateTokenForm } from "@getnimbus/sui-agent-kit";

async function unStake(agent: SuiAgentKit) {
  try {
    const form: ICreateTokenForm = {
      coinTypeA:
        "0x92aad4e078dded45773628adc3a9977d546b178bdadabcae351ce1818c5bb1fb::sc::SC",
      coinTypeB: "0x2::sui::SUI",
      initializePrice: 1,
      tickSpacing: 10,
      inputTokenAmount: 1,
      isTokenAInput: true,
      slippage: 0.07,
    };

    const result = await agent.createPoolCetusCLMM(form);
    console.log("Create pool result:", result);
  } catch (error) {
    console.error("Create pool failed:", error);
  }
}
```

## Implementation Details

* Initialize the sqrt price and current tick index based on initializePrice
* Build the tick range
* Estimate liquidity and token amounts from a single input
* Calculate the required amounts of Token A and Token B
* Once all parameters are set, prepare the transaction payload
* Sign and execute the transactionn

## Response Format

```javascript theme={null}
// Successful response
{
  tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
  tx_status: "success",
}

// Error response
{
  tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
  tx_status: "failed",
}
```

## Error Handling

```javascript theme={null}
try {
  // Create pool clmm
  const form: ICreateTokenForm = {
    coinTypeA:
      "0x92aad4e078dded45773628adc3a9977d546b178bdadabcae351ce1818c5bb1fb::sc::SC",
    coinTypeB: "0x2::sui::SUI",
    initializePrice: 1,
    tickSpacing: 10,
    inputTokenAmount: 1,
    isTokenAInput: true,
    slippage: 0.07,
  };
  
  const result = await agent.createPoolCetusCLMM(form);
} catch (error) {
  if (error.message.includes("Insufficient balance")) {
    // Handle insufficient balance
  } else {
    // Handle other transaction failures
  }
}
```

## Best Practices

1. Balance Verification

* Account for transaction fees

2. Transaction Management

* Monitor transaction status
* Implement proper error handling
* Use appropriate commitment levels

3. Security

* Verify transaction details
* Double-check amounts
* Keep private keys secure

4. User Experience

* Show transaction progress
* Display staking rewards

## Related Functions

* get\_holding: Check token balances
