Custom Distribution
Besides the three basic liquidity distributions, Ferra allows users to manually specify the exact liquidity amount for each bin—offering full control over placement for advanced strategies and precise position management.
Basic Implementation
// Manual distribution - you control everything
const tx = await sdk.Pair.openPositionAndAddLiquidity(pair, {
amountX: 5000000000n,
amountY: 10000000000n,
deltaIds: [-10, -5, -1, 0, 3, 7, 10], // Specific bins
distributionX: [0, 0, 10, 30, 60, 0, 0], // Custom weights
distributionY: [5, 15, 40, 30, 10, 0, 0] // Different for each token
});
Strategic Placements
Limit Order Style
// Single bin acts like limit order
await sdk.Pair.openPositionAndAddLiquidity(pair, {
amountX: sellAmount,
amountY: 0n,
deltaIds: [5], // 5 bins above current
distributionX: [100],
distributionY: [0]
});
Support/Resistance Levels
// Place at key price levels
const supportBin = -15; // Support level
const resistanceBin = 20; // Resistance level
await sdk.Pair.openPositionAndAddLiquidity(pair, {
amountX,
amountY,
deltaIds: [supportBin, 0, resistanceBin],
distributionX: [20, 30, 50], // More at resistance
distributionY: [50, 30, 20] // More at support
});
Ladder Strategy
// DCA-style ladder
const ladderBins = [-20, -15, -10, -5];
const equalWeight = 100 / ladderBins.length;
await sdk.Pair.openPositionAndAddLiquidity(pair, {
amountX: 0n, // Buy ladder
amountY: buyAmount,
deltaIds: ladderBins,
distributionX: Array(ladderBins.length).fill(0),
distributionY: Array(ladderBins.length).fill(equalWeight)
});
Advanced Patterns
Barbell Strategy
// Concentrate at extremes
const deltaIds = [-20, -19, 0, 19, 20];
const distributionX = [0, 0, 20, 40, 40];
const distributionY = [40, 40, 20, 0, 0];
Asymmetric Distribution
// Different shapes for buy/sell
const deltaIds = Array.from({length: 21}, (_, i) => i - 10);
const distributionX = deltaIds.map(id => id > 0 ? id * 2 : 0);
const distributionY = deltaIds.map(id => id < 0 ? Math.abs(id) * 3 : 0);
// Normalize to 100
normalize(distributionX);
normalize(distributionY);
Use Cases
✅ Perfect for:
Technical analysis levels
Limit order simulation
Complex strategies
Precise positioning
❌ Avoid if:
New to DLMM
Want simple management
Need quick setup
Tips & Best Practices
Plan First: Map out bins before executing
Test Small: Try strategy with minimal amounts
Track Performance: Monitor which bins perform best
Adjust Actively: Custom positions need management
Common Strategies
Range Orders: Single bins at target prices
Fibonacci Levels: Place at fib retracements
Volume Profile: Match historical volume
Mean Reversion: Concentrate at extremes
Related Topics
Calculate Token Amounts - Preview requirements
Add to Existing Position - Modify custom positions
Last updated