Ambient is a Decentralized Exchange for Managing Concentrated Liquidity Positions

Ambient is a decentralized exchange whose concentrated-liquidity interface lets an LP mint a two-token position inside chosen price bounds, monitor whether the range is active, reposition it through one compound transaction, and burn it back into collateral. The lifecycle begins with pair, bounds, amount, slippage, and settlement choices, then stays tied to the original on-chain owner.

This page follows that record from entry to closure. It focuses on balance and status changes, routine adjustment, and direct or surplus settlement, while leaving protocol-wide comparisons, lending, and liquidation outside the position workflow.

Bottom line: A range earns swap fees only while the pool price sits between its two chosen boundaries.

An ETH - USDC Range From Deposit to Closure

An ETH - USDC concentrated position is a two-asset market-making record whose collateral shifts between ETH and USDC as the pool price travels across a lower and an upper boundary. Minting inside the band commits both assets in the ratio the curve requires at that moment.

After entry, swaps alter the ratio without changing the selected bounds. The position earns its share of swap fees while active, becomes entirely one asset after price moves beyond either end, and activates again if price returns. A reposition burns the old range, balances the assets, and mints new bounds. A final burn returns the current token mix and accumulated rewards to the selected settlement destination.

Position Ownership Before the First Deposit

Position ownership is the recovery layer for an Ambient range, because CrocSwapDex indexes a native concentrated record by its owner and tick boundaries rather than issuing an ERC-721 position NFT.

Wallet software is replaceable; the on-chain address is not. Restoring the same externally owned account in MetaMask, Rabby Wallet, or a Ledger-backed wallet retains the signer the position expects. A Safe smart account instead preserves its contract address through its configured signers and threshold. Uniswap V3 differs by representing concentrated positions as ERC-721 tokens. Local bookmarks and portfolio cards only help rediscover these records; they do not define ownership.

Position Form On-Chain Ownership Record Backup or Recovery Standard
Ambient native concentrated range Owner, pool, lower tick, and upper tick Recover the same signer address and query the range tuple
Ambient native full-range liquidity Owner and pool record Recover the same signer address and query its ambient balance
Ambient ERC-20 ambient LP token Transferable ERC-20 balance Restore control of the token-holder address
Uniswap V3 concentrated position ERC-721 token ID and holder Restore control of the NFT-holder address
Lifecycle Rule On-chain ownership survives interface changes Recovery must restore the controlling address or signer policy

Can the Position Survive a Device Change?

An Ambient position survives a device change when the replacement wallet reconstructs or controls the same on-chain owner address, since CrocSwapDex stores the position on-chain rather than inside the old device. CrocQuery can rediscover it from the owner, chain, token pair, pool index, lower tick, and upper tick. The replacement must also select the original network. Opening the same address on another chain displays that chain's independent state, not the existing range.

The Entry Transaction and Its Six Decisions

The entry transaction is a concentrated-liquidity mint containing six user decisions: token pair, liquidity type, lower and upper range, deposit quantity, maximum slippage, and settlement method.

Pair and Range

Chain selection precedes the pair because identical token symbols on Ethereum and Scroll refer to separate markets. Ambient represents each token with a 160-bit EVM address, orders the lower address as the base asset, and identifies its initialized standard pool type with index 420. The chosen price interval supplies two permanent boundaries for that position, which is examined in Ambient security.

Each boundary is a signed 24-bit tick, and one tick changes price by a factor of 1.0001, equal to one basis point. The interface converts readable prices into valid ticks before requesting the signature.

Quantity and Slippage

The flat mint interface supports three sizing modes: fixed liquidity units, fixed base-token quantity, or fixed quote-token quantity. The curve calculates the corresponding second amount. Token quantities enter the contract as signed or unsigned 128-bit raw integers, so the interface must apply each ERC-20 token's decimal precision before displaying a wallet amount.

Wallet or Surplus Settlement

Direct settlement pulls approved ERC-20 inputs from the owner's wallet. Surplus settlement debits balances already held inside the exchange contract, avoiding another token transfer for that action. Native ETH uses the zero address, 0x0, and travels through the transaction's attached value rather than a WETH approval. A maximum-slippage setting limits how far execution may move from the quoted amounts.

Reading In-Range Status and Token Balances

Position status is the comparison between the pool's current tick and the two stored boundary ticks, while position balance is the current base quantity, quote quantity, and liquidity contribution.

The Active-Tick Test

A concentrated range contributes liquidity when the lower tick is at or below the current tick and the current tick remains below the upper tick. CrocQuery exposes both the curve tick and price. The contract represents price as a Q64.64 square-root value occupying 128 bits; a frontend converts that raw representation into the pair's displayed exchange rate.

Three Values Behind the Position Card

A range query returns three core values: liquidity, base-token quantity, and quote-token quantity. The two balances change as swaps move the curve, even when the owner takes no action. That movement reflects the market-making inventory, not a separate wallet transfer. Reading performance therefore requires comparing the present token mix with the value of retaining the original assets outside the pool.

What Changes When the Price Leaves the Range?

An out-of-range Ambient position is an open concentrated-liquidity record with zero active contribution at the current tick, so it stops receiving fees from swaps executed while price remains outside.

Crossing a boundary also changes the collateral composition. Beyond one end, the range holds the base-side asset; beyond the other, it holds the quote-side asset, with direction determined by the pool's address ordering and displayed price convention. Fees earned earlier remain associated with the position as ambient liquidity. If price crosses back into the interval, the same range resumes contributing automatically. Narrower bounds concentrate liquidity across fewer ticks, yet they also place either boundary closer to ordinary price movement.

Repositioning an Out-of-Range Balance

Ambient's reposition command is a compound liquidity action combining one burn, one balancing swap, and one mint within a single on-chain transaction for an out-of-range position.

The burn realizes the old range's current token composition and associated rewards. The internal swap then creates the ratio required by the replacement bounds, while CrocImpact can estimate the swap's price effect. Finally, the mint writes a position under the new lower and upper ticks. The entire sequence either completes together or reverts together, although the balancing trade still carries pool price impact and the transaction consumes network gas.

Fee Accrual and the Ambient Portion

Fee accrual in Ambient is an on-chain growth mechanism that assigns swap fees pro rata to active liquidity and converts each concentrated position's earned amount into associated ambient liquidity. A 64-bit rewards odometer tracks the position's share, while cumulative growth uses Q16.48 fixed-point data with 48 fractional bits. Pool fees use unsigned 16-bit fields in units of 0.0001%. Harvest call code 5 realizes accrued rewards without closing the range; a burn realizes rewards for the portion removed.

Partial Reductions, Full Burns, and Settlement

Liquidity reduction in Ambient is a burn operation that removes either part or all of a concentrated position, calculates the matching token collateral, and assigns the corresponding accumulated ambient rewards.

Reducing Part of the Range

A partial burn leaves the owner, pool, lower tick, and upper tick unchanged. It decrements the stored liquidity and pays rewards in proportion to the amount removed. The remaining portion continues under the same bounds. Unlike an incremental mint, a reduction does not reset the position's stored block time.

Closing the Entire Range

A full burn removes all concentrated liquidity associated with the selected range tuple. The output reflects the pool price at execution, so it can contain both assets or mainly one asset. Previously earned ambient liquidity is included with the withdrawal rather than left as a separate fee balance.

Choosing the Destination

An 8-bit settlement field selects how each side moves. Flag 0x1 applies surplus settlement to the base side, while 0x2 applies it to the quote side; both bits can be combined. Wallet settlement transfers the outputs immediately. Surplus collateral instead records idle internal balances, ready for another mint, swap, transfer, or later withdrawal.

How Does a Clean Exit Reach the Wallet?

A clean Ambient exit is a full burn followed by confirmation that concentrated liquidity at the original owner, pair, pool index, and two boundary ticks has reached zero.

Direct settlement completes the burn and returns both underlying assets in one transaction; received ERC-20 tokens require no approval. Choosing surplus settlement credits the exchange balance first, so moving those assets to the wallet requires a second withdrawal transaction. CrocQuery distinguishes a zeroed range from funds still sitting as surplus collateral. For an ETH leg, direct settlement sends native ETH rather than substituting WETH.

Advanced Position Records and Edge Cases

Advanced position records are the low-level identifiers and timing fields an LP needs when a frontend card, indexer response, and direct contract query appear to describe different states.

Within one pool, a concentrated record is keyed by owner, lower tick, and upper tick. It stores liquidity as a 128-bit value, a rewards odometer as a 64-bit value, and its block timestamp as a 32-bit value. Adding liquidity to identical ticks merges into that record, blends its rewards checkpoint, and resets the timestamp. A reduction leaves the timestamp unchanged.

Flat LP operations use callpath index 2. Concentrated mint codes 1, 11, and 12 select fixed liquidity, base quantity, and quote quantity. Burn codes 2, 21, and 22 mirror those denominations, while code 5 harvests accumulated rewards. These identifiers matter to SDK and contract integrations; the hosted interface translates user choices into them.

A pool-level time-to-live setting limits how quickly newly added concentrated liquidity can be burned. The protocol permits values from 0 through 255 seconds: 0 imposes no waiting interval, while a nonzero value sets the minimum age. Because increasing an existing range resets its block time, an immediate follow-up burn must satisfy the pool's configured interval.

An indexer makes position discovery and history convenient, but an indexed card can lag the confirmed chain state. CrocQuery reads the owner's native range and surplus balances directly, while the transaction receipt records whether the mint, reposition, harvest, or burn completed. Reconciliation should therefore match the chain, owner, pair, pool index, and ticks before comparing the interface with an indexer snapshot.

Ambient: questions and answers

Does adding liquidity to identical ticks create a separate position?

Adding liquidity under the same owner, pair, pool index, lower tick, and upper tick increases the existing native range record. The contract blends the earlier and newer rewards checkpoints so both deposits retain their proper accrual history. It also resets the position's stored block timestamp. Selecting even one different boundary creates a distinct range tuple, which appears as another position and must be managed or burned separately.

Is native ETH wrapped before it enters an Ambient liquidity position?

Native ETH enters Ambient as the chain currency and is represented by the zero address, not wrapped into WETH by the protocol. The mint carries ETH through the transaction's attached value, and any excess attached amount is refunded when the transaction involves native ETH. An ERC-20 token paired with ETH still requires the appropriate approval before the contract can collect that token from the wallet.

Can a native concentrated position move to another wallet as an NFT?

A native Ambient concentrated position does not use an ERC-721 NFT, so a standard NFT transfer is not part of its lifecycle. The record belongs to its on-chain owner and specified tick range. Moving the economic exposure to another address requires closing or reducing the original range, transferring the resulting assets, and minting from the destination address. Ambient's ERC-20 LP-token option applies to fungible ambient liquidity rather than the native concentrated record.

When does increasing a range reset its position timestamp?

Increasing a concentrated range resets its stored 32-bit block timestamp when new liquidity joins the same owner and tick boundaries. The contract also blends the rewards odometer for the old and added liquidity. A partial burn does not reset that timestamp. This distinction matters when the pool enforces a nonzero time-to-live interval, because the expanded record must age from its most recent increase before an immediate burn can complete.

Why can raw CrocQuery token quantities look much larger than the displayed balance?

Raw CrocQuery quantities use each token's smallest units and do not apply ERC-20 decimal formatting. USDC uses 6 decimal places, so a raw quantity of 1,000,000 represents 1 USDC. Native ETH and many ERC-20 tokens use 18 decimal places, where 1 ETH equals 1,000,000,000,000,000,000 wei. A frontend divides each raw value by the token contract's declared decimal factor before displaying the position balance.

Updated