Decoding Ambient Finance: An Efficient Two-Way AMM Protocol Combining CEX and DEX Advantages

Ambient Finance Decoded: A Hybrid AMM Protocol with CEX and DEX Benefits

Mechanism Analysis

Automated Market Maker (AMM)

In Ambient, liquidity is provided through an Automated Market Maker (AMM) mechanism. Unlike traditional limit order books (LOBs), liquidity is not provided by individual orders, but by a liquidity pool consisting of funds provided by liquidity providers (LPs).

Each liquidity pool in Ambient represents a two-way market between interchangeable assets or tokens. At any given time, each liquidity pool has a single exchange rate determined by the virtual reserve ratio committed to that pool. End users can exchange one token of the pair with another token according to a deterministic formula.

Ambient liquidity pools use a Constant Product Market Maker (CPMM) algorithm. Regardless of the size or direction of the exchange, the product of the two aspects of the virtual reserve will remain constant. (Except for fees charged and centralized liquidity added). When an exchanger sends a certain amount of base token to the pool, the liquidity pool will return a certain amount of quote token based on this constant product relationship. Therefore, the exchange rate of the liquidity pool will increase to raise the exchange rate of the quote token relative to the base token.

This mechanism balances supply and demand by readjusting prices proportionally based on the size and direction of the exchange. Therefore, the exchanger will not get the instant exchange rate, but will get a slightly worse price depending on the size of their trade relative to the liquidity in the pool. This difference is called price impact.

In addition, exchangers pay a liquidity fee based on the nominal amount of their trade. The liquidity fee is redistributed to LPs in proportion to their contribution to the active liquidity in the liquidity pool. The rate varies depending on the specific liquidity pool and may be adjusted according to market conditions, but is usually in the range of 0-1%.

Concentrated Liquidity

Concentrated liquidity allows users to provide liquidity within any predetermined price range on a single AMM curve. This is in stark contrast to Ambient liquidity, where liquidity remains active in all possible prices from zero to infinity.

The advantage of concentrated liquidity is primarily capital efficiency. Liquidity providers (LPs) only need to commit collateral required to support the limited range of liquidity. For example, significantly less capital is required to provide concentrated liquidity for a stablecoin pair trading between $0.99 and $1.01.

One disadvantage of concentrated liquidity is that if the curve price goes beyond the order range, liquidity providers will no longer accumulate fees. Therefore, concentrated liquidity providers must either wisely determine their price range or periodically “rebalance” orders to move them back within range.

Ambient also supports native Ambient liquidity, which is different from “full-range concentrated liquidity.” The first advantage is that, unlike accumulating fees in a separate side pocket, the fees of Ambient liquidity providers are automatically compounded back to their original position without any manual management. The second advantage is that the gas cost required to cast and destroy Ambient liquidity providers’ positions is significantly lower. The third advantage is that all Ambient liquidity providers’ positions on a given curve are naturally interchangeable and can be easily packaged into “LP tokens.”

Eliminating Liquidity

The act of eliminating liquidity is similar to range-based concentrated liquidity, except that liquidity is permanently removed from the AMM curve at any time the curve price exceeds the range edge. Eliminating liquidity can be set when the curve price is below the buy price or when the curve price rises to the sell price.

The behavior of eliminating liquidity is somewhat similar to “irreversible limit orders” in a traditional centralized limit order book. Users who want to achieve targeted execution at better than current market prices can buy (sell) in the pool by bidding (selling) below (above) the current price. As soon as the price exceeds that point, the user’s order is executed. Unlike the original concentrated liquidity range order, even if the price rebounds beyond the fill price, the tokens purchased by the user will not convert back. For this reason, eliminating liquidity is a useful tool for users who want to achieve targeted execution but hope to get a more favorable price than traditional swaps.

Eliminating liquidity orders provide better prices for:

  • Waiting for cheaper prices

  • Receiving rather than paying swap fees

  • Avoiding price slippage on AMM curves

In practice, eliminating liquidity is often subject to some limitations for users:

  • Unlike typical concentrated liquidity, the width of the range order for all eliminating orders in the entire pool is fixed (usually narrower).

  • The eliminating bid must always be below the current curve price, and the eliminating ask must be above the current curve price.

  • In order to be completely eliminated, the price must move completely throughout the range. If the curve moves to the middle of the range, the order may be “partially filled.” If the price moves back to the range without reaching the elimination price, it will convert back.

User Experience

Token Swaps

Ambient’s core functionality is to allow users to exchange one type of token for another at a fair market price. If a given currency pair has liquidity in the DEX contract, users will be able to swap between tokens. Additionally, the front-end web app provides an interface for regular use case swaps.

Excess Collateral

Users can directly deposit a certain amount of tokens as a static balance in the DEX contract. Excess collateral can be used as lightweight operational funds, so its expenses and transaction costs are lower than handling ERC20 token transfers in each swap, mint, and burn operation. Excess collateral can be directly deposited by users by sending tokens directly to the DEX contract. Alternatively, it can receive output from swap, burn, or harvest operations. Additionally, excess collateral can also be directly withdrawn so that the user’s wallet will receive the corresponding underlying token.

Governance & Policy

Ambient Protocol governance is ultimately controlled by a DAO multi-signature. There are two main multi-signatures, the operating multi-signature and the treasury multi-signature.

The ability of multi-sigs to act includes:

  • Setting and modifying pool parameters (e.g. liquidity fee, instant quote spacing, JIT threshold, etc.)

  • Initializing new pool type templates

  • Setting, opening, or closing protocol fees

  • Setting sub-price size improvement token size thresholds

  • Setting minimum liquidity commitments for newly initialized pool types.

  • Installing any strategy oracle pipeline that has multi-sig control functionality.

The treasury multi-signature is reserved for more serious administrative actions. However, this requires a higher degree of commitment and longer delays. The treasury multi-signature can:

  • Upgrade code in DEX contract

  • Transfer DEX permissions to a new strategy controller contract

  • Collect accumulated protocol fees in DEX

  • Forcefully unload strategy oracle before it expires in DEX

  • Force permit pool conversion to un-permitted pool (in case of improper behavior of permission oracle)

Overview

Governance fulfills the traditional role of a DAO. It has full control over the protocol and is governed by M-of-N multisig and time-locked solutions.

Strategy is an intermediate layer between DAO governance and the DEX contract itself. It can directly pass solutions from the governance layer, or delegate limited management control of the DEX to an external smart contract strategy oracle explicitly installed by DAO governance.

Mechanism is the underlying DEX contract itself. The CrocSwapDex (core smart contract holding decentralized liquidity and positions) is built using adjustable parameters that can be dynamically adjusted by external strategy oracles. This allows the protocol to improve and experiment with new features in a safer and more controllable way than upgrading the underlying DEX smart contract directly.

Advantages

Ambient, as a brand new codebase, considers best engineering practices and innovative smart contract architecture choices, which give it some core advantages compared to other DEXs:

  • Significantly lower gas fees.

  • Combining Concentrated (“UniV3 style”), Ambient (“UniV3 style”), and Defunct liquidity (behaving like limit orders that atomically fill and lock positions in a single direction) on the same liquidity curve.
  • Dynamically adjusting pool fees to maximize liquidity provider returns relative to market conditions and demand for liquidity.

  • Allowing users to earn compound interest, even without manual harvesting, since fees from Concentrated liquidity providers are automatically reinvested into the Ambient liquidity.

  • Preventing instant liquidity attacks by using the minimum TTL parameter on concentrated liquidity holdings. As a result, ordinary liquidity providers can earn higher fees.

  • Allowing users to provide funds in advance for tokens on the DEX in the form of “remaining collateral”. Active traders are more efficient by delaying token transfers until net settlement.

  • Enabling “gasless” trading of tokens for swaps by users, using the EIP-712 off-chain standard.

  • Uniquely supporting the “limited permission pool” primitive, which transfers the ability to manage and restrict pools to general-purpose smart contract oracles running inside or outside the protocol.

Summary

Ambient provides liquidity through a model that combines the characteristics of decentralized and centralized exchanges. Unlike other AMMs, liquidity is not dispersed across trading pairs. Ambient can run the entire DEX system in a single smart contract, resulting in lower transaction fees, greater liquidity rewards, and a fairer trading experience. As a trading protocol that combines the characteristics of CEX and DEX, Ambient introduces novel DeFi native features that provide users with a first-class experience.

We will continue to update Blocking; if you have any questions or suggestions, please contact us!

Share:

Was this article helpful?

93 out of 132 found this helpful

Discover more

Blockchain

Metropolitan Museum of Art in New York to return $550,000 FTX donation

According to Decrypt, the Metropolitan Museum of Art in New York has agreed to return hundreds of thousands of dollar...

Market

Chainlink: Reaching New Heights and Oracle Superpowers

In October, LINK's price has exhibited impressive strength. What could have caused this surge?

Blockchain

Three major domestic virtual currency exchanges focus on compliance business and actively engage with local governments and state-owned enterprises

China Times (www.chinatimes.net.cn) reporter Ran Xuedong trainee reporter An Lingfei Beijing reports The currency cir...

Market

Exclusive Interview with Yuga Labs We are more like Tencent of Web3, constantly changing the rules of NFT games

During the Token2049 conference, BlockBeats reporter had a conversation with Daniel Alegre, the CEO of Yuga Labs, dis...

Blockchain

The pace of competition is accelerating, how can the new exchange break with the finer operations?

The cryptocurrency exchange is still a good business. Recently, the Currency Exchange announced the eighth BNB quarte...

Blockchain

A picture to understand the difference between Bakkt's bitcoin futures and "traditional" futures

According to the delivery method, futures contracts are usually divided into cash delivery and physical delivery. At ...