Liquidity Models

To support a broad range of trading scenarios—from casual swaps to high-volume transactions—DotSwap introduces two distinct liquidity models. Each is designed to balance usability, capital efficiency, and price stability under the limitations of Bitcoin’s scripting environment.

  • Constant Product Market Maker (CPMM) — known for simplicity and robustness

  • Concentrated Liquidity Market Maker (CLMM) — designed for capital efficiency and flexibility

By combining these two models, DotSwap offers secure, permissionless swaps optimized for the unique constraints and opportunities of the Bitcoin network.


1. Constant Product AMM (CPMM)

1.1 Introduction

The Constant Product Market Maker (CPMM) is one of the simplest and most widely used automated market maker models. It operates based on a mathematical invariant:

x * y = k

Here, x and y are the reserve balances of two assets (e.g., BTC and Runes), and k is a constant. Each trade alters the reserve ratios but maintains the constant k, resulting in a continuous price curve. This model is ideal for enabling permissionless swaps without order books.

1.2 Benefits

  • Simplicity: Easy to implement and understand.

  • Always Liquid: The pool always has a price for traders.

  • Resilience: Stable and predictable behavior under normal conditions.

1.3 Limitations

  • Low Capital Efficiency: Liquidity is spread across all prices.

  • High Slippage: Particularly for large trades.

  • No Range Customization: Liquidity providers cannot optimize for specific market ranges.

1.4 Example Scenario

Assume a BTC/Runes pool with the following initial state:

  • 1000 BTC

  • 100,000 Runes

A user sells 50 BTC:

  1. Compute the constant: k = 1000 * 100,000 = 100,000,000

  2. After the trade, the pool has 1050 BTC. To maintain k, the new Runes balance becomes 100,000,000 / 1050 ≈ 95,238.10

  3. The trader receives 100,000 - 95,238.10 = 4,761.90 Runes

  4. Average execution price: 4,761.90 / 50 ≈ 95.24 Runes per BTC

  5. Slippage: (100 - 95.24) / 100 ≈ 4.76%


2. Concentrated Liquidity AMM (CLMM)

2.1 Introduction

CLMM enhances the AMM concept by allowing liquidity providers to concentrate their capital within a specific price range. This improves capital efficiency and reduces slippage in actively traded regions. Instead of spreading liquidity evenly, CLMM focuses on targeted zones, resulting in deeper liquidity where it's most needed.

CLMM introduces the concept of virtual reserves:

(x + virtual_x) * (y + virtual_y) = k

These virtual reserves adjust dynamically based on the price range set by the liquidity provider.

2.2 Benefits

  • Improved Capital Efficiency: Liquidity is focused, not wasted.

  • Lower Slippage: Especially within popular trading ranges.

  • Customizability: LPs can manage risk and strategy via price bounds.

2.3 Limitations

  • Requires Active Management: LPs must monitor and rebalance.

  • Inactive Liquidity: Out-of-range capital does not contribute to trades.

  • Higher Complexity: Harder to understand for casual users.

2.4 How It Works

Let’s assume the same pool:

  • 1000 BTC

  • 100,000 Runes

  • Liquidity is concentrated between 95 and 105 Runes per BTC

CLMM calculates liquidity depth L:

  • L = sqrt(1000 * 100,000) = 10,000

  • Assume the full price range spans from 50 to 150 Runes. The target range is 95–105.

  • Amplification factor: (150 - 50) / (105 - 95) = 10x

  • Effective liquidity: L' = 10,000 * 10 = 100,000

A user sells 50 BTC:

  • The price shifts from 100 to approximately 99.014 Runes

  • Runes received: ≈ 4945.23

  • Average price: 98.9 Runes per BTC

  • Slippage: ≈ 1.1%

This concentrated liquidity allows for deeper trades with reduced slippage, while idle capital is minimized.


3. Summary

CPMM offers simplicity and stability, making it a solid choice for base-level liquidity. CLMM builds upon that foundation, introducing range-based flexibility and vastly better capital utilization. DotSwap supports both models, tailored for native Bitcoin assets like BRC-20 and Runes, providing efficient, non-custodial liquidity infrastructure for the Bitcoin ecosystem.

Last updated

Was this helpful?