agentleFS
MystenLabsMystenLabs/skills/deepbook-overview/SKILL.md

deepbook-overview

Skill19 starsChanged 5 months agoApache-2.0View on GitHub

High-level overview of DeepBook V3 on Sui — architecture, key concepts, integration models, contract addresses, supported coins, and pool information. Use when explaining DeepBook to someone new, comparing integration approaches (Move vs SDK vs read-only), looking up mainnet/testnet contract addresses, or understanding the Pool/Book/State/Vault design.

  • Installs packages

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All patterns in this skill are derived from: https://docs.sui.io/onchain-finance/deepbook/deepbookv3/deepbook …

    line 24
  2. Distinctive:

    If unsure about any detail, fetch the relevant page before answering.

    line 29
  3. Distinctive:

    Always use SDK pool/coin keys, not hardcoded on-chain IDs: when building with the TypeScript SDK.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

DeepBook V3 Overview

MCP tool: When available in your environment, also query the Sui documentation MCP server (https://sui.mcp.kapa.ai) for up-to-date answers. Use it for verification and for details not covered by these reference files.

Source constraint: All information in this skill is sourced exclusively from docs.sui.io and the deepbookv3 GitHub repository. When extending or updating this skill, only pull from these sources. Do not use third-party blogs, tutorials, or unofficial documentation.

DeepBook V3 is a next-generation decentralized central limit order book (CLOB) built on Sui, providing a highly performant, low-latency exchange on-chain. This skill covers the high-level architecture and key concepts. Common mistakes include confusing DeepBook with an AMM (it is an order book), misunderstanding the role of the DEEP token in fee payments, and not knowing which integration model to use.

This skill routes to focused reference files. Load only the ones relevant to the current task.

All patterns in this skill are derived from: https://docs.sui.io/onchain-finance/deepbook/deepbookv3/deepbook https://docs.sui.io/onchain-finance/deepbook/deepbookv3/deepbook/design https://github.com/MystenLabs/deepbookv3

If unsure about any detail, fetch the relevant page before answering. Do not guess or extrapolate.


Reference files

design — Architecture and Design

Path: design.md Load when: the user asks how DeepBook works internally, about Pool/Book/State/Vault architecture, the order placement flow, BigVector, governance mechanics, or how fees are calculated. Covers: the three-part Pool structure (Book, State, Vault), order matching and injection, governance and voting, History and epoch tracking, BigVector implementation, the full order placement workflow.

contract-info — Contract Addresses, Coins, and Pools

Path: contract-info.md Load when: the user needs mainnet package IDs, pool object IDs, supported coin types and decimals, pool fee configurations, or registry addresses. Covers: current and historical package versions, all supported tokens with type addresses and decimals, all 23 mainnet trading pools with IDs and fee tiers.


Routing guide

TaskLoad
Explaining what DeepBook isskill content only
Choosing an integration model (Move vs SDK vs read-only)skill content only
Understanding Pool/Book/State/Vault architecturedesign
Understanding the order placement flowdesign
Understanding governance and fee votingdesign
Looking up a contract address or pool IDcontract-info
Finding a supported coin's type address or decimalscontract-info
Full deep dive on DeepBookall reference files

Skill Content

Key concepts

  • Central limit order book (CLOB). DeepBook is not an AMM. It maintains a full order book with bids and asks, matching orders by price-time priority. This enables limit orders, market orders, and precise price discovery.
  • Pool. A single market (e.g., DEEP/SUI) represented as a shared object. Each Pool contains three components: Book (order storage and matching), State (accounts, governance, history), and Vault (asset settlement).
  • BalanceManager. A shared object that holds a user's balances across all pools. Required for all trading operations (except direct swaps). Supports delegated access via TradeCap, DepositCap, and WithdrawCap.
  • DEEP token. The protocol's governance and fee token. Users stake DEEP for reduced taker fees (staking can halve taker fees when stake and volume thresholds are met) and can propose/vote on pool parameters (taker/maker fees, stake requirements). Fees can be paid in DEEP (default) or in the input token (at a 25% premium).
  • Whitelisted pools. DEEP/SUI and DEEP/USDC pools have 0% taker and maker fees, serving as gateway liquidity for the DEEP token.
  • Flash loans. Pools support uncollateralized flash loans via a hot potato pattern — borrow and repay within the same PTB.
  • DeepBook does not include an end-user interface. It is infrastructure that trading applications, bots, and protocols build on top of.

Integration models

ModelUse caseDependency
Move packageProtocols requiring on-chain logic guarantees and composabilitydeepbook = { mvr = "@deepbook/core" }
SDK & PTBsApps, bots, and wallets submitting trades via TypeScriptnpm install @mysten/deepbook-v3
Read-only dataPrice/order book queries via indexer or RPCNo dependency — query endpoints directly

Rules

  1. Always use SDK pool/coin keys, not hardcoded on-chain IDs when building with the TypeScript SDK. The SDK maps keys to the correct addresses per network.
  2. Read fee parameters on-chain rather than hardcoding. Governance can change taker/maker fees and stake requirements at any time.
  3. Reuse BalanceManagers. Creating a new one per transaction wastes gas and creates orphaned shared objects.

Common mistakes

  • Treating DeepBook like an AMM. DeepBook uses a central limit order book with discrete price levels (tick size) and quantity increments (lot size). Orders must respect these parameters or they are rejected.
  • Forgetting DEEP for fees. Most pools require DEEP tokens to pay trading fees. Without DEEP in the BalanceManager, trades fail. Whitelisted pools (DEEP/SUI, DEEP/USDC) are the exception.
  • Ignoring tick and lot sizes. Each pool has specific tick sizes (minimum price increment) and lot sizes (minimum quantity increment). Orders that don't align are rejected.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.