Typescript SDK
The typescript SDK to interact with Ferra DLMM protocol
Getting Started
Overview - Introduction to DLMM protocol and key features for developers
Installation - Package installation and setup requirements
SDK Initialization - Configuration and network setup
Key Concepts - Understanding bins, bin steps, and active bins
Trading Pairs
Create LB Pair - Deploy new liquidity book trading pair
Get Single Pair - Fetch detailed pair information
Get All Pairs - List all available trading pairs
Get Pair Bins - Retrieve bin data for a specific pair
Get Pair Reserves - Check liquidity distribution across bins
Position Management
Open Position - Create new position NFT
Get User Positions - List all positions for an address
Get Single Position - Fetch detailed position data
Get Position Bins - View bins within a position
Close Position - Remove liquidity and close position
Add Liquidity
Add Liquidity Overview - Core concepts and workflow
Add to New Position - Open position and add liquidity in one transaction
Add to Existing Position - Add more liquidity to current position
SPOT Distribution - Uniform liquidity distribution
CURVE Distribution - Gaussian curve distribution
BID-ASK Distribution - Weighted bid-ask spread
Custom Distribution - Manual bin and amount selection
Calculate Token Amounts - Required tokens per bin calculation
Remove Liquidity
Remove Liquidity Overview - Understanding the removal process
Remove from Specific Bins - Partial liquidity removal
Remove All Liquidity - Complete position withdrawal
Calculate Output Amounts - Estimate tokens to receive
Swap Operations
Execute Swap - Perform token swaps
Swap Direction - Understanding X→Y vs Y→X swaps
Calculate Swap Output - Preview swap results before execution
Price Impact - Calculate impact across affected bins
Slippage Protection - Set minimum output amounts
Fees & Analytics
Fee Structure - How protocol fees work in bins
Calculate Position Fees - Track accumulated trading fees
Collect Fees - Claim earned fees from positions
Position Value - Calculate current position worth
Calculate APR - Estimate annualized returns
Utilities & Reference
Bin Mathematics - Understanding and Calculations
Price Helpers - Price conversion utilities
Best Practices - Performance optimization tips
Last updated