DEV Community

Jerome Barton
Jerome Barton

Posted on

Cross-chain swaps: what happens when range liquidity runs out

A cross-chain swap trades an asset on one blockchain for an asset on another through shared liquidity and a settlement process. If the swap is large enough to use the liquidity nearest the current price, its remaining amount may reach limit orders at worse prices.

What does it mean to exhaust range liquidity?

Range liquidity is supplied across a chosen band of prices, while a limit order offers an amount at a particular price. As a swap moves the pool price through a band, it uses the available range liquidity there; once that liquidity is used up, the swap continues to the next available price level.

For example, imagine a pool selling BTC near $60,000. A buy swap might use range liquidity from $60,000 up to $60,100, then continue to a sell limit order at $60,120. The key is price, not a blanket preference for one order type: closer liquidity is reached first, and the amount available at each price affects how much of the swap it fills.

Uniswap’s developer docs explain that range orders are liquidity positions that can approximate limit orders, rather than ordinary orders in a centralised exchange book. In some designs, a range position can also start converting back if the price reverses before it has been removed.

How does the swap reach a limit order?

In Chainflip’s model, a cross-chain deposit is first confirmed on its source chain and witnessed by the protocol. During that wait, market makers can update their range and limit liquidity; once the swap is ready, it processes against available pool prices, then the destination asset is sent to the wallet address supplied for the swap.

If you're swapping native BTC for ETH through Chainflip, for example, the route may use a BTC–USDC pool and then a USDC–ETH pool. Each leg encounters its own liquidity and price movement, so range liquidity may run out on one leg before the next limit order is reached. A displayed estimate is useful, but the final price depends on the liquidity available when execution happens.

What should you check before sending?

Check the estimated amount you will receive after fees, and set a minimum accepted price or other available slippage protection if the interface offers it. The execution price can worsen as the swap consumes liquidity at successive prices; network and broker fees may also be charged separately from the pool’s trading cost.

A common mistake is to treat the first quoted price like a centralised exchange fill price, then approve a large swap without checking how much liquidity sits beyond the range. Fix that by comparing quotes for the full amount, checking the minimum output, and splitting a large trade only if separate quotes show a better likely result after extra fees and delays. If protection is triggered, the protocol may retry or refund according to the swap’s settings.

Range liquidity can handle the first part of a swap, while a limit order may set the next price the rest can trade at. Check the full-size estimate and protection settings before depositing, especially for a multi-pool route.

Top comments (0)