Ambient is a pool and LP mode workflow for position minting and removal
Ambient is a liquidity-position workflow in which an LP connects a compatible wallet, selects a two-token market and chooses ambient or concentrated liquidity. The LP then sets the deposit amount, adds two price boundaries only for concentrated mode, reviews token settlement and signs the mint. A confirmed transaction creates the position. Removing it later burns the selected liquidity and returns the current token mix either to the wallet or to surplus collateral held in CrocSwapDex.
Range boundaries decide whether liquidity stays active
Concentrated liquidity is a bounded LP position whose two chosen price ticks control when its capital participates in Ambient’s shared curve.
A position contributes active liquidity while the pool price remains between its lower and upper ticks. Once price moves beyond either boundary, its concentrated component contributes 0 active liquidity and stops sharing in the pool’s swap-fee flow. The collateral remains accounted for, although its composition has shifted toward one side of the pair. Returning inside the range reactivates the position. The position remains visible and removable throughout. An overly narrow range creates the main workflow failure. The mint succeeds, yet the position soon sits outside the band that the LP selected.
Ambient records ticks as signed 24-bit integers. Each tick follows a base-1.0001 logarithm, so a one-tick step multiplies raw pool price by 1.0001, or about 0.01%. The interface converts those values to human-readable prices, but token decimal ordering changes which direction looks upward. Before signing, read both token labels and both displayed bounds.
Wallet and market prerequisites before minting
Wallet prerequisites are the correct network, spendable assets for both sides and a settlement path that matches the intended market.
Network and token identity
Every Ambient market joins exactly two assets, identified on-chain as a base address and a quote address.
Ethereum Virtual Machine addresses are 160 bits, while pool type indexes occupy 256 bits. Standard pools use pool type index 420. The protocol orders the lower token address as base. Native ETH appears internally as 0x0 rather than WETH, although the interface shows a readable symbol. Ethereum, Scroll, Blast and Swell Chain hold separate CrocSwapDex deployments, so the same symbols on another network do not identify the same market.
Wallet balance and settlement
Wallet settlement draws tokens directly through ERC-20 transfers, while surplus collateral uses balances already recorded inside the DEX contract.
A direct ERC-20 deposit needs an approval or permit allowance for each token that the mint will collect. An ERC-20 pair therefore presents two allowance checks; native ETH uses transaction value instead. EIP-2612 permits combine an allowance with a signed message for compatible tokens, while EIP-712 defines the typed-data format used by signed protocol instructions. Surplus settlement avoids a fresh transfer when the balance is already deposited. Keep separate network-native funds available for the mint transaction.
Should you choose ambient or concentrated liquidity?
Choose ambient liquidity for continuous full-curve participation and concentrated liquidity when a deliberate lower and upper range matches the intended position.
Ambient mode
Equally, Ambient mode is full-range liquidity that remains active from a price of 0 toward an unbounded upper limit.
Its collected fees compound into the same native position, and its lower gas path suits simple position management. An ambient entry needs no lower tick or upper tick. The LP still selects the pair, quantity, slippage guard and settlement. Because every ambient position on the same curve is fungible, it can remain native inside the exchange or use an ERC-20 LP token conduit when that representation serves another workflow.
Concentrated mode
Concentrated mode is range liquidity with exactly two price boundaries that define its active interval on the shared curve.
The mode concentrates capital near prices the LP expects to matter. Ambient stores each boundary as a 24-bit tick and each curve price as a 128-bit Q64.64 square-root value. The interface performs those conversions, so the visible decision stays lower price, upper price and deposit amount. A wider range sacrifices concentration for more time in range; a narrower band raises the chance of sitting inactive.
Worked range example
A worked range example shows how the two boundaries determine active status without predicting any market outcome.
Every changing input in this worked example is hypothetical: the reference pool price is 2 000 USDC per ETH, the lower bound is 1 600, the upper bound is 2 400 and the later pool price is 2 500. Each bound begins 20% from the reference price. At 2 500, the pool sits above the upper tick, so the concentrated component contributes exactly 0 active liquidity. The position remains recorded, and a return below 2 400 places it back inside its selected range. That status change tells the LP whether to keep the range or prepare a different mint (compare Ambient pricing ).
Position minting from amount entry to confirmation
Position minting is one primary on-chain action that encodes the market, mode, quantity, boundaries, price limits, settlement and ownership route.
The web form first fixes quantity in liquidity units, base-token units or quote-token units. For an ambient mint, the low-level flat LP codes are 3, 31 and 32 for those three choices. Concentrated minting uses 1, 11 and 12. All six variants run through flat LP callpath 2. Its command carries 11 encoded fields, including two 128-bit price limits, one 128-bit quantity, two 24-bit ticks, one 8-bit settlement flag and one 160-bit conduit address. Ambient mints ignore the tick fields, while concentrated mints bind the position to them.
The review screen should keep four user decisions recognizable: token pair, LP mode, amount and settlement destination. Concentrated mode adds lower and upper prices. A token collected from the wallet must have enough allowance or a valid permit. Native ETH arrives through transaction value, and any excess attached to an ETH transaction is refunded. CrocSwapDex then debits the inputs and records the position under the signing address.
The wallet signature authorizes the mint parameters shown. After broadcasting, wait for an included transaction receipt before treating the form as complete. A pending interface state does not confirm a position. The next decision is whether the recorded position matches the signed range and amount.
How do you confirm the position exists?
A confirmed Ambient position is an on-chain liquidity record whose owner, pair, pool index and optional ticks match the transaction just signed.
The CrocQuery view returns three position values - liquidity, base quantity and quote quantity - for both ambient and concentrated positions. An ambient record has four identifying inputs: owner, base token, quote token and pool index. A concentrated record adds the lower and upper ticks, bringing the identifying set to six. The frontend turns these fields into a card with token amounts and range status. Match the wallet address, network and pair first. Then compare both boundaries with the submitted transaction if the position is concentrated. A successful receipt proves execution, but it does not prove that the chosen market was the intended one.
Token balances can differ from the quantities entered because minting settles the pair at the pool’s execution price and position composition changes with the curve. Query values use raw token units and respect each ERC-20 token’s decimals. The visible interface normalizes them. Save the transaction hash and confirm that the position card exposes the expected removal control; that prepares the clean exit.
Removal, settlement and a clean exit
Position removal is a burn action that releases selected liquidity and settles its current two-token collateral to the wallet or surplus balance.
Burn the selected position
A burn targets the same owner, pair, pool type and range fields that identified the minted position.
Flat callpath 2 uses ambient burn codes 4, 41 and 42 and concentrated burn codes 2, 21 and 22. Each trio lets the quantity stay fixed in liquidity, base tokens or quote tokens. Burning 100% of its liquidity removes the whole chosen position; a smaller burn leaves the remainder active under the same mode and ticks. Removal still works for a concentrated position outside its range and returns the collateral mix represented at the current curve price.
Choose the settlement destination
The settlement destination is the final routing choice between a direct wallet transfer and an internal surplus-collateral credit inside CrocSwapDex.
Direct settlement sends ERC-20 outputs with transfer calls and native ETH directly to the wallet. Surplus settlement credits two internal token counters instead, which keeps assets available for another mint or withdrawal. The settlement flag is 8 bits: 0 selects direct handling for both sides, 0x1 selects surplus for the base side and 0x2 selects surplus for the quote side. Setting both bits produces 0x3 and keeps both outputs inside the DEX. A later surplus withdrawal uses command 74 and amount 0 requests the entire selected token balance.
Check both wallet balances or both surplus balances after receipt confirmation. That final balance check determines whether another withdrawal is required.
Popular questions about Ambient
Does an Ambient LP position appear as an ERC-20 token in my wallet?
An Ambient LP position does not always appear as an ERC-20 token in the wallet. Ambient supports native lightweight position entries inside CrocSwapDex and ERC-20 LP tokens routed through a conduit. The native form uses the protocol’s internal record and carries lower gas overhead. Choose the token form only when another application specifically requires a transferable ERC-20 representation.
Why do the two token amounts change before removal?
Token amounts change because an LP position rebalances across the pair as swaps move the pool price. An ambient position stays active across the full curve, while a concentrated position shifts composition within its selected range and becomes one-sided beyond a boundary. Removal pays the collateral represented at the current curve price, not the original deposit quantities. Use the position view to plan the exit rather than assuming the mint quantities remain unchanged.
Does burning an LP position also clear its ERC-20 allowances?
Burning an Ambient LP position does not clear ERC-20 allowances that the wallet previously granted to CrocSwapDex. A burn releases liquidity and routes outputs; it does not call the token’s approve function. Any unused allowance remains governed by the token contract until the owner changes it or the approved amount is consumed. This allowance state is separate from whether the position still exists.
What happens if an ERC-20 allowance is smaller than the mint amount?
The mint transaction cannot collect an ERC-20 amount above the allowance that the wallet granted to CrocSwapDex, so the call reverts without creating a position; raise the allowance, sign a valid EIP-2612 permit where supported or reduce the mint amount before submitting the primary action again from the same wallet.
Last updated