Product

Swaps

View as Markdown

Crossing Multiple Ranges

A swap exhausts the liquidity in the currently active range first, then moves to the next range with liquidity if volume remains. Ranges with no liquidity are skipped.

Where positions overlap, they settle together. A swap crossing three overlapping ranges works through them in order: the first position alone, then that position together with the second where they overlap, then the second alone once the first has been left behind, and so on until the order is filled.

Position APosition BPosition C90,000110,000current price

Fee Allocation and Hook Intervention

Each settlement's fee accrues only to the liquidity that actually absorbed it, split by share.

Hooks can intervene before and after a trade, letting each pool attach its own rules — adjusting the settled amount or requiring extra settlement — without modifying the protocol core.

Fixing What You Pay vs. What You Receive

When requesting a swap, the user fixes exactly one side as an exact value: either "I will pay exactly this much" (exact input) or "I will receive exactly this much" (exact output). The other side is determined by the price and liquidity available at that moment.

This choice is encoded in the sign of a single value — negative means the amount paid is fixed, positive means the amount received is fixed.

Limiting Execution with a Price Bound

Passing through a shallow-liquidity range can move price significantly as a swap fills. When requesting a swap, the user can also specify a limit: stop settling once price reaches this point.

Execution halts the moment that limit is reached, and any remaining volume is simply left unsettled as the swap ends — even if the order still has volume in it. It is a safeguard the user controls directly against continuing to fill at a price outside their expectations.

Position APosition BPosition Climit90,000110,000current price