Skip to main content
Let P be current Q128.128 square-root price. Let A < B be the lower and upper Q128.128 boundaries. Let L be liquidity. Amounts are native token base units.

Amounts from liquidity

Below the range:
Inside the range:
Above the range:
The contract applies explicit floor or ceiling rounding and saturation checks through wide helpers.

Liquidity cap

Pool creation calculates a net-liquidity-sum cap from the number of usable ticks and then selects the smaller value against LIQ_AMOUNT_SAFE_CAP = 702075911466779181339691826086. Read Slot.max_liquidity_per_tick from chain state. Do not reconstruct it from a legacy Q64 constant.

Mint and increase

The contract transfers the full desired amounts into public AMM custody, calculates the maximum supported liquidity, and then calculates the actual native base-unit amounts used. It credits desired - used to the position’s public tokens_owed balances. The returned token change records contain only input-record value above the desired transfer amounts.