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 Cetus
Usage
// 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
"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"
{
coinTypeA:
"0x92aad4e078dded45773628adc3a9977d546b178bdadabcae351ce1818c5bb1fb::sc::SC",
coinTypeB: "0x2::sui::SUI",
initializePrice: 1,
tickSpacing: 10,
inputTokenAmount: 1,
isTokenAInput: true,
slippage: 0.07,
}
Example Implementation
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
// Successful response
{
tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
tx_status: "success",
}
// Error response
{
tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
tx_status: "failed",
}
Error Handling
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
- Balance Verification
- Account for transaction fees
- Transaction Management
- Monitor transaction status
- Implement proper error handling
- Use appropriate commitment levels
- Security
- Verify transaction details
- Double-check amounts
- Keep private keys secure
- User Experience
- Show transaction progress
- Display staking rewards
- get_holding: Check token balances