increase_liquidity adds capital to an existing range. It does not create a second position. The operation consumes the current PositionNFT record, transfers additional token value into the AMM, updates the public position, and returns a replacement PositionNFT record.
The contract settles fees earned by the old liquidity amount before adding new liquidity. That ordering keeps fee ownership aligned with the liquidity that was active when each fee was earned.
Outcome
The increase is complete when the transaction is accepted, the public position reflects the added liquidity, the old ownership record is spent, the replacementPositionNFT is stored, and both token change records are accounted for.
Before you start
Read the current public position and fee growth, verify entry controls, reserve the currentPositionNFT, select token0 and token1 funding records, and quote desired and minimum raw amounts for the position’s existing range.
Inputs and outputs
The transition accepts:- Current
PositionNFTrecord - Token0 and token1 records
- Public desired token amounts
- Public minimum token amounts
- Public token0 and token1 program IDs
- Public lower and upper insertion hints
- Public token ID
- Replacement
PositionNFTrecord - Token0 and token1 change records
desired - used funding excess remain in public tokens_owed accounting until collect. Returned change records contain only input-record value above the desired transfer amounts.
Preconditions
The public position must match the pool and ticks carried by the ownership record. The position must not be frozen. Entry controls apply:- Global pause must be off.
- The pool must be enabled.
- Neither pool token may be paused.
- The token pair may not be paused.
max_liquidity_per_tick.
Amount calculation
The increase follows the same inventory rules as mint:- Below the range, token0 supports the added liquidity.
- In range, both tokens may be required.
- Above the range, token1 supports the added liquidity.
desired - used excess to tokens_owed. Dynamic token transfers return change records only for input-record value above the desired amounts.
Settlement before addition
Before the position’s liquidity is increased, the contract derives fee growth inside the range and settles:- Adds the integer accrued fee to
tokens_owed. - Advances the position’s inside-growth checkpoint.
- Adds the new liquidity to the position.
- Adds each
desired - usedfunding excess totokens_owed. - Adds that liquidity to the slot if the range is active.
Existing and removed boundaries
If both range boundaries are still initialized, the contract increases their gross liquidity and updates signed net liquidity without changing their fee-growth-outside checkpoints. A position can have zero liquidity while its old boundary entries have been removed from the tick mapping. Increasing such a position reinitializes missing boundaries:- A new tick at or below the current tick starts with outside growth equal to current global growth.
- A new tick above the current tick starts with zero outside growth.
Active-liquidity update
If:Rounding effects
An increase has three separate rounding surfaces:- Liquidity and required token amounts are integer calculations.
- Pending fees settle down to whole native base units.
- Any fractional fee below one base unit is not carried after the checkpoint advances.
Record and custody handling
The inputPositionNFT and token records are spent by an accepted transaction. Persist the replacement PositionNFT record and both change records before marking prior records unavailable in an external custody ledger.
If the transaction is rejected, the submitted records are not replaced by successful outputs. Refresh record spent status rather than assuming a replacement exists.
For routed or institutional execution, associate the accepted transaction with:
- Program ID and checksum
- Position token ID
- Old and new public liquidity
- Raw desired and internal used amounts
- New
tokens_owedbalances - Input and replacement record identifiers
Common rejection causes
- Position is frozen.
- Pool or an entry control is paused.
- Token IDs do not match the pool.
- Current price and amounts calculate zero liquidity.
- A boundary exceeds the per-tick liquidity cap.
- A removed boundary is supplied with a stale or invalid hint.
- Minimum amount exceeds actual raw amount used.
- Input ownership or token records are spent or insufficient.