Comparing Carbon to Existing Concentrated Liquidity AMMs

Nate Hindman
CarbonDeFi
6 min readDec 29, 2022

--

Automated market makers (AMMs) experienced a step-change with the introduction of concentrated liquidity. Instead of forcing users to provide liquidity across an infinity range, users can provide their liquidity to a specific price range. While this gives liquidity providers greater control over how their tokens are used for trading, the same incentive structure has carried over and LPs still approach AMMs with the same goal in mind: Earn trading fees that are not only sufficient to cover for the impermanent loss (“IL”), but also deliver attractive risk-adjusted returns over and beyond covering IL.

Yet a growing body of research shows most LPs in concentrated liquidity AMMs do not break even once IL has been taken into account.

More recently, a new paradigm is emerging in concentrated liquidity AMMs, where users no longer provide liquidity solely to earn trading fees, but also use an AMM to submit “limit orders’’ to the market. These orders serve a similar role to traditional LP positions in that they provide on-chain liquidity for any token pair, against which other users can perform market orders. However, using conventional concentrated AMMs for limit-order utility runs into a number of issues:

  1. Liquidity is self-reversing: Executed limit/range orders are reversed when markets retrace (unless users withdraw liquidity in time).
  2. Liquidity is costly to update and automate: It is gas intensive for a user to move their position into a different price range, since the user must withdraw and recreate their entire liquidity position.
  3. MEV is rampant: Users who perform market orders against existing AMMs are exposed to “Maximum Extractable Value” (MEV) sandwich attacks.

Replacing Conventional LP’ing with Conditional Trading

Carbon is a new on-chain trading protocol that combines AMM mechanics with an order book-like model. Users create one-way, adjustable trading strategies composed of custom limit and range orders. In this model, liquidity is not reliant on LPs who leak value to arbitrageurs, but is instead provisioned by users who take directional positions.

To achieve these goals, Carbon introduces a number of key features that address current drawbacks of AMMs and order books, while enabling entirely new financial primitives.

1. Asymmetric liquidity

Contrary to all other AMMs on the market, Carbon liquidity trades in one direction. Each Carbon order contains a single token balance that is either used for buying or selling — but never for both. As a Carbon order is filled, acquired tokens are automatically removed from active trading or, in the case of a recurring strategy, rotated into the other order.

This stands in contrast to all existing AMMs, which process buy and sell orders symmetrically, using a single pricing algorithm. Once a buy order for one asset is traded against, a sell order for the other asset is placed at the same price. This has been referred to in the industry as a “double-sided” limit order, and requires users to manually monitor and withdraw their liquidity immediately upon execution in order to finalize the order and avoid order reversal.

The one-directional nature of Carbon liquidity eliminates the risk of order reversal while also removing the need for users to constantly monitor their orders and manually withdraw them upon execution (or rely on a third-party to do so). Rather, Carbon makes executed orders irreversible by design. This allows two distinct buy and sell orders to be linked together, creating an asymmetric trading strategy, as discussed below.

2. Linked orders

Two orders can be linked together in a single liquidity position (or “strategy”), establishing distinct buy and sell ranges for the provisioned token(s).

Each user strategy in Carbon is either disposable or recurring. A disposable strategy is composed of one order that removes tokens from active trading as the order is executed. For example, a single limit order (“sell ETH at $2000”) or a single range order (“sell ETH between $1900–2000”).

A recurring strategy is composed of two linked orders that trade in perpetuity. One order is set to buy a token when it enters a certain price range, and the other order is to set to sell the token when it enters a separate price range, until the user chooses to stop the strategy. A recurring strategy can consist of two limit orders, two range orders, or a limit and a range order. Tokens acquired in the buy order become automatically available in the linked sell order, and vice versa.

Take, for example, a strategy that buys ETH at 1200 USDC and sells it between 1600 and 1800 USDC. Using existing AMMs to execute this type of strategy — which combines a limit order with a range order — would require either two separate liquidity positions or specialist tooling to automate gas-intensive transactions that withdraw and recreate a position as prices move into range. In contrast, on Carbon, two linked orders use a single source of collateral and liquidity automatically rotates between the two prices (or ranges) as the market price comes into range.

The idea behind Carbon’s linked-order strategies is to create a self-renewing cycle where one order is continuously accumulating an asset at a lower price, while the other order is selling it at a higher price, so the strategy can then buy more of the same asset again at the lower price, in an infinite cycle until the user chooses to stop.

3. Adjustable parameters

Carbon curves are adjustable on-chain, giving users the ability to inexpensively change the conditions of a submitted order prior to execution. In existing concentrated AMMs, changes to a user’s position (e.g., moving liquidity between price ranges) require closing and recreating the user’s entire liquidity position. This is complex to manage, and more importantly, prohibitively expensive when trying to react in real-time to market movements. In Carbon, adjustments to an order can be made “on the fly” — i.e., without a user needing to close and recreate their liquidity position. Parameters are adjustable via low-cost transactions involving minimal computational overhead, making strategy management significantly more gas efficient.

In addition, unlike existing concentrated AMMs, Carbon does not rely on predefined “tick ranges” that limit the ranges in which users can place liquidity. On Carbon, users can deploy liquidity, and subsequently move their liquidity, to any price point or range via Carbon’s novel parametric adjustable bonding curve, giving users greater precision in their strategies.

4. MEV resistance

An important issue for on-chain liquidity is Maximal Extractable Value or “MEV” — which results in profits extracted by parties who control the transaction flow, typically miners.

A primary MEV attack vector for existing AMMs is the so-called “sandwich attack”, where a genuine transaction is sandwiched between transactions of the attacker. An AMM sandwich attack is very similar to front-running in traditional markets, except that a sandwich attack is guaranteed to either succeed or fail costlessly.

MEV sandwich attacks are not possible in Carbon. While an attacker can still front-run a transaction, the reverse transaction is prohibited by the asymmetry of the system. Therefore, the attacker is no longer in a position to retreat from the consequences of their front-running trade, which defeats the underlying tenability of the sandwich attack entirely.

Conclusion

Carbon’s one-way, adjustable, concentrated liquidity model gives users an unprecedented level of precision to personalize on-chain trading strategies. At the same time, Carbon protects market orders from the most common form of MEV, sandwich attacks. More broadly, Carbon fundamentally changes the status quo in existing AMMs: On-chain liquidity is no longer reliant on LPs who frequently suffer losses due to impermanent loss, but is instead supported by users taking directional positions via true on-chain limit and range orders.

Additional resources:

--

--