Use when integrating DeepBook DEX, implementing orderbook trading, managing liquidity pools, or building market-making features on SUI. Triggers on DEX integration, trading pair setup, or liquidity management tasks.
From sui-dev-agentsnpx claudepluginhub first-mover-tw/sui-dev-agents --plugin sui-dev-agentsThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Decentralized orderbook exchange protocol on SUI.
DeepBook provides:
Since SUI v1.47, DeepBook is no longer included as an implicit dependency. You must add it explicitly in your Move.toml:
[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.68.0" }
DeepBook = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/deepbook", rev = "testnet-v1.68.0" }
use deepbook::clob_v2;
use deepbook::custodian_v2;
public fun create_pool<BaseAsset, QuoteAsset>(
tick_size: u64,
lot_size: u64,
ctx: &mut TxContext
) {
clob_v2::create_pool<BaseAsset, QuoteAsset>(
tick_size, // Minimum price increment
lot_size, // Minimum quantity increment
ctx
);
}
public fun place_limit_order<BaseAsset, QuoteAsset>(
pool: &mut Pool<BaseAsset, QuoteAsset>,
price: u64,
quantity: u64,
is_bid: bool, // true = buy, false = sell
account_cap: &AccountCap,
ctx: &mut TxContext
) {
clob_v2::place_limit_order(
pool,
price,
quantity,
is_bid,
account_cap,
ctx
);
}
import { Transaction } from '@mysten/sui/transactions';
async function placeBuyOrder(
poolId: string,
price: number,
quantity: number
) {
const tx = new Transaction();
tx.moveCall({
target: `${DEEPBOOK_PACKAGE}::clob_v2::place_limit_order`,
arguments: [
tx.object(poolId),
tx.pure(price),
tx.pure(quantity),
tx.pure(true), // is_bid
tx.object(accountCapId)
],
typeArguments: ['0x2::sui::SUI', '0x...::USDC']
});
return await signAndExecute({ transaction: tx });
}
// ✅ Use SuiGrpcClient (SDK v2) — JSON-RPC is deprecated, removal April 2026
async function getOrderbook(poolId: string) {
const pool = await client.getObject({
id: poolId,
options: { showContent: true }
});
// Parse bids and asks
const content = pool.data.content;
const bids = content.fields.bids;
const asks = content.fields.asks;
return { bids, asks };
}
// Simple market making strategy
public fun provide_liquidity<Base, Quote>(
pool: &mut Pool<Base, Quote>,
mid_price: u64,
spread_bps: u64,
size: u64,
account_cap: &AccountCap,
ctx: &mut TxContext
) {
let spread = (mid_price * spread_bps) / 10000;
// Place buy order below mid
let bid_price = mid_price - spread;
clob_v2::place_limit_order(
pool, bid_price, size, true, account_cap, ctx
);
// Place sell order above mid
let ask_price = mid_price + spread;
clob_v2::place_limit_order(
pool, ask_price, size, false, account_cap, ctx
);
}
❌ Incorrect tick/lot size configuration
❌ Not handling partial fills
❌ No order cancellation mechanism
cancel_order with order ID tracking❌ Ignoring orderbook depth
❌ Not validating price against market
❌ Forgetting to create AccountCap
Query DeepBook docs:
const deepbookInfo = await sui_docs_query({
type: "docs",
target: "deepbook",
query: "orderbook trading pool creation"
});
Professional-grade orderbook DEX on SUI!