Getting Started
This section covers the fundamentals needed to start building with DLMM:
Understand what DLMM is, how it differs from traditional AMMs, and its key advantages for both liquidity providers and traders.
Set up the DLMM SDK in your project with step-by-step installation instructions and dependency requirements.
Configure the SDK for different networks, set up your connection, and prepare for your first transactions.
Master the core concepts of DLMM including bins, bin steps, active bins, and how price discovery works in a discretized system.
Quick Example
Here's a taste of what you can do with the DLMM SDK:
import { FerraDlmmSDK, BinMath } from '@ferra-xyz/dlmm'
// Initialize SDK
const sdk = new FerraDlmmSDK({
network: 'mainnet',
fullNodeUrl: 'https://...',
senderAddress: '0x...'
})
// Get a pair and check price
const pair = await sdk.Pair.getPair('0x...')
const price = BinMath.getPriceFromId(
pair.parameters.active_id,
Number(pair.binStep),
9, // tokenX decimals
6 // tokenY decimals
)
console.log(`Current price: ${price} tokenY per tokenX`)
Prerequisites
Before you begin, ensure you have:
Node.js 16+ installed
Basic understanding of DeFi and liquidity provision
Familiarity with TypeScript (recommended)
A Sui wallet with some SUI for gas fees
Choose Your Path
For Developers
Start with SDK Initialization to set up your development environment.
For Liquidity Providers
Jump to Key Concepts to understand how DLMM liquidity works.
Support
Discord: Join our community for help
GitHub: Report issues or contribute
Docs: You're here!
Ready to dive in? Let's start with the Overview →
Last updated