Skip to main content
This page helps you add funds to a position you already hold, in the Shield Swap app or with the Typescript SDK, Python SDK, or CLI.

How an increase works

An increase adds liquidity at your position’s existing range and keeps its ID. The added liquidity can earn fees after confirmation while the range is active. To change the range, use Rebalancing. As with minting a position, any deposited amount the range does not use stays with the position for you to collect. Fees you have already earned also remain collectible; adding liquidity does not reinvest them. See Collecting and burning.

Find the position and add funds

Prerequisites: Your authenticated mainnet client for Typescript, dex for Python, or CLI profile from Setup, an existing position, and a confidential balance of both pool assets.Amounts are base-unit integers; use each token’s decimals to display them.Replace POSITION_TOKEN_ID with the ID of the position you intend to change. Define the confirmation helper for your SDK before running these examples.

Step 1: Find the position

Positions are discovered from the records your account holds, so this needs the scanner. There is no chain index of an account’s positions.
Each entry carries positionTokenId, poolKey, tickLower, tickUpper, withdrawal, and a state with the live liquidity, amount0, amount1, and uncollectedFees0 and uncollectedFees1. Name the position by positionTokenId whenever the account holds more than one in the same pool.

Step 2: Increase

The range is read from the position; only the amounts are new.
Replace AMOUNT0_BASE_UNITS and AMOUNT1_BASE_UNITS with base-unit bigint budgets for the pool’s token0 and token1. The call spends the current position record and issues a replacement with the same positionTokenId; wait for the scanner to serve the new record before the next operation on this position.

How it works on chain

increase_liquidity transfers your desired token0 and token1 amounts into the AMM and adds liquidity at the position’s existing range. Earned fees and any unused deposit stay owed to the position until you collect.

What changes

How liquidity and fees are recorded

  1. The contract calculates the added liquidity and the token amounts used at the current square-root price. Added liquidity must be nonzero, and each used amount must meet its token minimum, in base units.
  2. It updates the boundary ticks and checks the pool’s per-tick liquidity cap.
  3. It settles pending fees using the position’s liquidity before the increase. Those fees and the unused deposit are added to the existing owed balances.
  4. It records the combined liquidity and advances the fee checkpoints. The added liquidity earns only subsequent fee growth.
Fee settlement rounds down to whole base units at each checkpoint. See LP fee entitlements and rounding rules.

After a full decrease

The contract supports adding liquidity to an unburned, fully decreased position. If its boundary ticks were removed, the increase recreates them with fresh fee-growth-outside values. Fetch current insertion hints before submitting; a stale hint rejects the transaction.After acceptance, use the replacement PositionNFT for the next operation on this position.

Next steps