Skip to main content

Liquidity Curves in Automated Market Making

Introduction

Liquidity curves are mathematical functions used to distribute liquidity across a price range in automated market making (AMM) protocols. They allow liquidity providers to optimize their capital allocation based on expected price movements and trading activity.

Benefits and Drawbacks of Curving Liquidity

Benefits:

  • Capital Efficiency: Concentrates liquidity where it's most needed, potentially increasing returns.
  • Risk Management: Allows tailoring of exposure to different price ranges.
  • Market Responsiveness: Can be designed to adapt to various market conditions and trading patterns.
  • Fee Optimization: Potentially captures more fees by focusing liquidity in high-activity price ranges.

Drawbacks:

  • Complexity: More difficult to understand and implement than uniform liquidity distribution.
  • Potential for Misconfiguration: Incorrect curve settings could lead to suboptimal performance.
  • Increased Gas Expenses: May require more frequent funding as more is being done on chain.

Types of Liquidity Curves

1. Linear Curve

Linear Liquidity

Description: Liquidity is distributed in a straight line across the price range.

Configuration:

  • No additional parameters required.

Use Cases:

  • Simple, gradual increase or decrease in liquidity across a range.
  • Good for markets with steady, predictable price movements.

2. Normalized (Gaussian) Curve

Normalized Curve

Description: Liquidity follows a bell-shaped curve, concentrating around a central point. The mean used is the center of the liquidity range produced from the strategy.

Configuration:

  • stdDev: The standard deviation, controlling the spread of the curve (default: 2).

Use Cases:

  • Concentrating liquidity around an expected price point.
  • Suitable for stable pairs or when you expect prices to revert to a mean.

3. Sigmoid Curve

Sigmoid Curve

Description: An S-shaped curve that gradually increases liquidity across the range.

Configuration:

  • k: The steepness of the curve (default: 1).

Use Cases:

  • Creating a smooth transition between low and high liquidity areas.
  • Useful when you expect a certain price threshold to be significant.

4. Logarithmic Curve

Log Curve

Description: Liquidity increases rapidly at first, then slows down as price increases.

Configuration:

  • base: The base of the logarithm (default: 2).

Use Cases:

  • Providing more liquidity at lower prices and less at higher prices (or vice versa).
  • Suitable for assets that tend to have more trading activity at certain price ranges.

5. Bid-Ask Spread

Bid Ask Curve

Description: Liquidity is concentrated at two points, simulating a traditional order book with bids and asks.

Configuration:

  • No additional parameters required.

Use Cases:

  • Mimicking traditional market-making strategies.
  • Providing deep liquidity at specific price points.

Curve Manipulation

All curves can be manipulated to change the liquidity shape, offering additional flexibility in strategy design:

Reflecting over Y-Axis

Description: Flips the curve over the y-axis.

Effect: Reverses the liquidity distribution from left to right.

Inverting over X-Axis

Description: Flips the curve over the x-axis.

Effect: Inverts the liquidity concentration, making high-liquidity areas low and vice versa.

Use Case: Reverse a strategy's focus, e.g., from concentrating liquidity in the center to concentrating it at the edges.

Liquidity Position Limit

All curves support a configurable liquidity position limit:

Description: Specifies the ideal number of positions to use when creating the liquidity curve shape.

Configuration:

  • bins: The maximum number of positions the strategy will attempt to create.

Considerations:

  1. Higher number of positions can create a more precise curve shape but may increase gas costs and will have diminishing returns.
  2. The actual number of positions may be limited by the available range and pool spacing.
  3. Simplification algorithms may be applied to reduce the number of positions while maintaining the overall curve shape.

Implementation Considerations

  1. Range Selection: Choose an appropriate price range that covers expected trading activity. Remember the curve will be within the bounds of the strategy, so adjust accordingly.
  2. Parameter Tuning: Adjust curve parameters based on historical data and market expectations.
  3. Regular Review: Monitor performance and adjust curves as market conditions change.
  4. Combine with Rebalancing: Use in conjunction with rebalancing strategies for optimal performance.
  5. Gas Costs: Consider the impact on gas costs when implementing more complex curves or a high number of positions.
  6. Curve Manipulation: Experiment with mirroring and inverting to find the most effective liquidity distribution for your strategy.
  7. Position Optimization: Balance the number of positions between curve accuracy and gas efficiency.

Conclusion

Liquidity curves offer a powerful tool for optimizing capital allocation in AMM protocols. By carefully selecting, configuring, and manipulating the appropriate curve type, and optimizing the number of liquidity positions, liquidity providers can potentially enhance their returns and manage risk more effectively. Regular monitoring, adjustment, and experimentation with different curve shapes and configurations are key to maintaining an effective liquidity provision strategy in dynamic market conditions.