cetus-swap
Integrate Cetus AMM on Sui (swaps, liquidity, concentrated pools). Use when the user mentions Cetus.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Integrate Cetus AMM on Sui (swaps, liquidity, concentrated pools). Use when the user mentions Cetus.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Pick a brand name, color palette, or typography for a Sui product. Use when the user wants to name or brand a Sui project.
Build an AI agent that signs Sui transactions or runs onchain actions. Use when the user wants an AI agent on Sui.
Build a Sui data indexer or analytics pipeline. Use when the user wants to index Sui events, build a pipeline, or query Sui RPC data.
Build a mobile Sui app with React Native or the Sui Mobile SDK. Use when the user wants iOS, Android, or mobile Sui flows.
Pair with a coding agent to build a Sui MVP step by step. Use when the user wants to build the MVP iteratively with an agent.
Author Sui Move modules and packages with a senior Move dev as your pair. Use when the user wants to write, build, author, add, or scaffold Move code, smart contracts, or Sui programs at the module or function level, in any phrasing.
| name | cetus-swap |
| description | Integrate Cetus AMM on Sui (swaps, liquidity, concentrated pools). Use when the user mentions Cetus. |
# Suiperpower telemetry. Routes through the CLI so projects.json + Convex stay in sync.
# Silent on failure so the skill never blocks. Opt out: SUIPERPOWER_TELEMETRY=off.
#
# AGENT NOTE: when this skill finishes, run the matching completion command:
# suiperpower track cetus-swap build completed
# Or use "failed" / "aborted" if it ended that way.
command -v suiperpower >/dev/null 2>&1 && suiperpower track cetus-swap build started >/dev/null 2>&1 &
true
If TEL_PROMPTED is no, before doing real work, ask the user:
Help suiperpower get better. We track which skills get used and how long they take. No code, no file paths, no PII. Change anytime in
~/.suiperpower/config.json.A) Sure, anonymous B) No thanks
Write the answer to ~/.suiperpower/config.json telemetryTier field and create ~/.suiperpower/.telemetry-prompted. Then continue.
Integrates Cetus CLMM into a project so the user can execute real token swaps and, optionally, manage concentrated liquidity positions on testnet or mainnet. Sets up the SDK, queries pools, builds swap transactions with slippage protection, and verifies a real swap settles on chain before declaring done.
deepbook-orderbook instead.scallop-money-market or navi-lending.scaffold-project first.If you activated this and the user actually wants something else, consult skills/SKILL_ROUTER.md and hand off.
.suiperpower/build-context.md from scaffold-project. Read it if present.If unclear, interview the user for:
Working Cetus swap code using the SDK V2 (@cetusprotocol/sui-clmm-sdk).
A verifiable testnet swap: one real swap executed, observable on suiscan with a recorded digest.
Optionally, position management code (open, add liquidity, close).
Append to .suiperpower/build-context.md:
## cetus-swap session, <timestamp>
- pool id: <pool object id>
- coin pair: <coinA> / <coinB>
- fee tier: <rate>
- first swap tx digest: <digest>
- slippage: <value>
- position id: <id, if LP>
- open issues: <list>
The skill never deletes files outside the integration source path without explicit user confirmation.
Context gathering
.suiperpower/build-context.md if it exists.SDK setup
@cetusprotocol/cetus-sui-clmm-sdk is deprecated):
npm install @cetusprotocol/sui-clmm-sdk @cetusprotocol/common-sdk
import { CetusClmmSDK } from '@cetusprotocol/sui-clmm-sdk'
const sdk = CetusClmmSDK.createSDK({ env: 'testnet' })
full_rpc_url for a custom RPC. Set the sender address after init via sdk.setSenderAddress(wallet).Pool selection
const pools = await sdk.Pool.getPoolByCoins([coinTypeA, coinTypeB])
fee_rate, tick_spacing, current_sqrt_price, liquidity.coin_type_a.build-context.md.Swap implementation
sdk.Swap.preSwap() simulates on chain and returns estimated_amount_in / estimated_amount_out.adjustForSlippage(toAmount, slippage, !byAmountIn) computes the minimum acceptable output.sdk.Swap.createSwapPayload() with pool id, coin types, a2b, by_amount_in, amount, amount_limit.sdk.fullClient.sendTransaction(signer, swapPayload).a2b flag: true means coin_type_a to coin_type_b.references/cetus-quickstart.md for the full code flow.Liquidity provision (optional)
sdk.Position.openPositionPayload() or the price-based variant.sdk.Position.createAddLiquidityFixTokenPayload().sdk.Position.closePositionPayload() (must collect all pending rewards first).references/cetus-quickstart.md for add-liquidity code.Demo
https://suiscan.xyz/testnet/tx/<digest>.Writeback
.suiperpower/build-context.md.Closing handoff
.suiperpower/intent.md exists and the session was non-trivial (new module, new sponsor integration, or material changes to public functions), recommend verify-against-intent as the next step so drift is caught before shipping.intent.md exists and the session was non-trivial, surface that gap once: offer clarify-intent to backfill, do not force it.For user-facing swap UIs that need best execution across multiple DEXes, consider the Cetus Aggregator SDK (@cetusprotocol/aggregator-sdk). It routes across 30+ Sui DEXes (Cetus, DeepBook v3, Turbos, FlowX, Bluefin, and others). Use direct CLMM SDK (this skill) when you need liquidity management, position control, or fine-grained pool interaction. Use the aggregator when you only need swaps and want optimal pricing.
Before reporting done, the skill asks itself the following and refuses to declare success if any answer is no:
build-context.md?@cetusprotocol/sui-clmm-sdk) used, not the deprecated V1 package?If any answer is no, the skill reports the gap and works through it before claiming the integration is complete.
Cetus was exploited for ~$223M in May 2025 due to a bug in shared Move math libraries (not the SDK). The protocol relaunched June 8, 2025 and is fully operational. The SDK API was not affected. Contract addresses listed in references are the current post-fix versions.
On-demand references (load when relevant to the user's question):
references/cetus-quickstart.md: Install, pool query, swap, and add-liquidity recipes for the SDK V2.Knowledge docs (load when scope expands beyond what is in references):
claude "/suiper:cetus-swap <your message>"codex "/cetus-swap <your message>"grok, then /cetus-swap <your message> in the session~/.cursor/rules/cetus-swap.mdc and reference it.If you activated this and the user actually wants something else, consult skills/SKILL_ROUTER.md and hand off.