Core Concepts

Discrete Price Bins

In Ferra's DLMM, liquidity is organized into discrete price bins, each representing a specific price level for a token pair, such as SUI/USDC at 2.5, 2.51, 2.52 USDC per SUI, up to 4.1. This approach differs significantly from traditional Automated Market Makers (AMMs) like Uniswap V2, where liquidity is distributed continuously across all prices from 0 to infinity using the constant product formula xy=kx \cdot y = k . This continuous distribution often leads to high slippage for large trades and inefficient capital use, as liquidity is spread thinly across unused price ranges.

Concentrated Liquidity Market Makers (CLMMs), such as Uniswap V3, improve on this by allowing LPs to concentrate liquidity within user-defined price ranges, enhancing capital efficiency. However, within these ranges, the price still changes continuously based on the ratio of reserves, following a piecewise linear function. In contrast, DLMM's discrete bins, inspired by Trader Joe's Liquidity Book, operate at fixed price points, each bin acting as an independent mini-market. This allows LPs to allocate funds precisely, potentially maximizing fee earnings by focusing liquidity where trading activity is expected.

The image below illustrates the distribution of liquidity across price bins for the SUI/USDC pair.

Ferra's DLMM liquidity distribution example

Zero-Slippage Swaps

Zero-slippage swaps are a hallmark of Ferra's DLMM, enabled by the discrete bin structure. Within each bin, trades occur at a fixed price without price impact, as long as the trade size does not exceed the bin's liquidity. This is a significant departure from traditional AMMs, where the price changes continuously with each trade due to the constant product formula, and from CLMMs, where price changes smoothly within tick ranges

In DLMM, each bin operates as a constant sum market maker within its price, meaning trades within the bin maintain a fixed exchange rate. For example, if the active bin for SUI/USDC is at 3.00 USDC per SUI, with 1000 SUI and 3000 USDC, a trader buying 100 SUI pays exactly 300 USDC, experiencing zero slippage, as the price remains 3.00 throughout the trade within the bin's capacity. This is because within a bin, you can add X tokens and take out Y tokens (or vice versa) at the fixed price until one token is depleted, aligning with the constant sum invariant

Mathematically, if a bin has reserves X(SUI)X (SUI) and Y(USDC)Y (USDC), and the price is P=Y/XP = Y/X, a trade to buy ΔX(SUI)\Delta X (SUI) would cost ΔY=PΔX\Delta Y = P\cdot\Delta X, as long as XΔXX\geq\Delta X. The price remains PP, ensuring zero slippage. Only when X<ΔXX < \Delta X does the trade move to the next bin, say at price P>PP' > P, introducing slippage for the remaining amount.

Example Calculation

Consider a SUI/USDC pool with:

  • Current Bin: Price P=3.00P = 3.00 USDC per SUI, with reserves X=1,000X = 1,000 SUI and Y=3,000Y = 3,000 USDC

  • Next Bin: Price P=3.01P' = 3.01USDC per SUI.

  • Trade: Buy ΔX=1,500\Delta X = 1,500 SUI

Step-by-Step Calculation:

  1. First Bin (P = 3.00):

    • The bin supplies up to 1,0001,000 SUI.

    • Cost: ΔY1=3.001,000=3,000\Delta Y_1 = 3.00 \cdot 1,000 = 3,000 USDC.

    • Remaining: 1,5001,000=5001,500 - 1,000 = 500 SUI.

  2. Next Bin (P' = 3.01):

    • Cost: ΔY2=3.01500=1,505\Delta Y_2 = 3.01 \cdot 500 = 1,505 USDC.

  3. Total Cost:

    • Total: ΔY=3,000+1,505=4,505\Delta Y = 3,000 + 1,505 = 4,505 USDC.

  4. Slippage:

    • Expected cost at P=3.00P = 3.00 : 3.001,500=4,5003.00 \cdot 1,500 = 4,500 USDC.

    • Actual cost: 4,5054, 505 USDC.

    • Slippage: 4,5054,500=54,505 - 4,500 = 5 USDC.

Dynamic Fee

Ferra’s DLMM utilizes a dynamic fee mechanism to optimize returns for liquidity providers (LPs). Each swap incurs a total fee that consists of two components:

  • A fixed base fee, determined by the pool creator.

  • A variable fee, which increases in response to market volatility.

This dynamic fee structure is designed to reward LPs more during periods of high trading activity, compensating them for the increased risk associated with price fluctuations.

To learn more about how the dynamic fee mechanism works and its technical implementation in Ferra’s DLMM, please refer to the detailed explanation in Ferra's Dynamic Fee session

Liquidity Shapes and Strategies

Ferra’s DLMM on the SUI network revolutionizes liquidity provision by offering LPs flexible liquidity shapes and corresponding strategies to optimize fee earnings and manage risk.

Ferra provides three primary liquidity shapes: Spot, Curve, and Bid-Ask. Each defining how liquidity is distributed across discrete price bins. These shapes align with volatility strategies tailored to different market conditions, from stablecoin pairs to volatile memecoins.

In addition, Ferra supports single-sided liquidity and custom liquidity distributions, making it well-suited for token launches with limited initial liquidity.

Please refer to the Shapes & Strategies section below for more detailed information.

Last updated