This series is written by a senior software engineer who works with the Sui blockchain and its ecosystem day to day. The goal is to make Sui DeFi and DeepBook approachable for curious learners, whether you are a blockchain beginner or an aspiring Sui developer.
This is the first part of a step-by-step tutorial series. In the upcoming articles, we will:
- Set up a complete development environment on Linux, macOS, and Windows.
- Create and understand a Sui smart contract using the Move language.
- Test the contract thoroughly with the Sui CLI.
- Build a frontend and backend to expose a fully functional DEX interface.
- Wrap up with a conclusion, best practices, and ideas for next steps.
In this introductory tutorial, you will get an overview of what you are going to build: a Sui DeepBook-based decentralized exchange (DEX) that lets users create liquidity pools, deposit and withdraw assets, and execute trades.
What You Will Learn
By following this series, you will learn how to:
- Set up your Sui and Move development environment so you can start building on Sui DeepBook with confidence.
- Implement a Sui DeepBook smart contract that covers liquidity pool creation, custodian account management, limit and market orders, and asset withdrawals.
- Build, publish, and test your DeepBook contract using the Sui CLI, and interact with it like a real user would.
Prerequisites
You do not need to be an expert to follow along, but the following will help you get more out of the series:
- Basic familiarity with Rust or a similar systems language is helpful but not mandatory.
- A basic understanding of blockchain concepts (blocks, transactions, smart contracts).
- Some exposure to the Sui blockchain and its core ideas is useful but not required.
- A high-level understanding of DeFi concepts such as swaps, liquidity pools, and trading pairs.
- Comfort using a terminal or command line on your operating system.
Technologies Used
Here are the core technologies we will use throughout the series:
- Sui Blockchain – A high-performance, developer-friendly layer-1 blockchain focused on asset ownership and fast, low-cost transactions.
- Move Language – A resource-oriented smart contract language (inspired by Rust) designed for safety, asset management, and flexible on-chain logic.
- DeepBook – A decentralized exchange (DEX) protocol on Sui that powers order books, liquidity pools, deposits, withdrawals, and various trading operations.
Key Concepts
Before building, it helps to know a few key terms that will appear frequently:
- Liquidity pool – A smart contract that holds a reserve of tokens, enabling users to trade against the pool instead of a traditional order book.
- Base and quote assets – In a trading pair, the base asset is what you are buying or selling, and the quote asset is what you are pricing it in (for example, in BTC/USDT, BTC is base and USDT is quote).
- Custodian account – A special account that holds assets on behalf of users or contracts, used to securely manage balances in the Sui ecosystem.
- SUI token and MIST – Sui’s native token, SUI, is used to pay for transactions and computation. For finer-grained amounts, Sui uses MIST as its smallest unit, where one SUI equals one billion MIST.
Top comments (0)