Helps developers work with the Ferra DLMM SDK for Discrete Liquidity Market Maker operations on Sui blockchain...
This skill helps you work with the Ferra Discrete Liquidity Market Maker (DLMM) SDK for Sui blockchain. The SDK provides tools for liquidity management, pair creation, token swapping, and position handling in DLMM pools.
The @ferra-labs/dlmm package is a TypeScript SDK for interacting with Discrete Liquidity Market Maker protocols on Sui. It supports:
Initialize the SDK with a specific network (mainnet, testnet, beta):
import { initFerraSDK } from '@ferra-labs/dlmm'
const sdk = initFerraSDK({
network: 'testnet',
wallet: '0x...your_wallet_address'
})
// Get a pair by its address
const pair = await sdk.Pair.getPair(pairAddress)
// Check current active bin
const activeId = pair.parameters.active_id
console.log(`Current active bin ID: ${activeId}`)
The SDK is organized into these main modules:
sdk.Factory) - Creating and managing trading pairssdk.Pair) - Liquidity pool operations and pair informationsdk.Position) - Opening, closing, and managing positionssdk.Swap) - Token swapping with rate calculationssdk.Quoter) - Price quoting utilitiesFor detailed guidance on specific operations, refer to these reference files:
Step-by-step guides for common tasks:
The package includes comprehensive test examples. You can run them with:
# Navigate to the dlmm package
cd packages/dlmm
# Run specific test files
bun test add-liquidity.ts
bun test create-pair.ts
bun test swap.ts
Test files are located in packages/dlmm/tests/ and provide working examples of all major operations.
This skill allows the following tools:
**/*.ts for TypeScript files)When working with the DLMM SDK:
Start with the SDK Setup reference for detailed initialization instructions.