Your deposit and withdrawal address
Your chosen range and the current pool price determine how much of each deposited asset becomes liquidity. Any amount the range does not use stays with the position until you collect it. If you deposit 100 units of an asset and the range uses 80, the remaining 20 are position funds you can collect. Those unused funds do not earn trading fees. Choose who manages the position and where its payouts go before you mint. The recipient address owns the position and can manage its liquidity. The withdrawal address receives every payout and is fixed for the life of the position, including after a rebalance. Both default to your connected wallet. The pool, the range, the liquidity, and the amounts in a position are public. Who owns the position is confidential. See Public data.In the app
Before you startYou’ll need:- Shield Wallet connected to Shield Swap, with a confidential balance of at least one of the pool’s two assets. See Fund.
- A range in mind. See Choosing a liquidity range.
Open the position
- Open Pools, then select the pool.
- In the panel on the right, keep New Position selected.
- Enter an amount for either asset. The app fills in the other amount for the current price and range. Private Balance above each field shows what you can deposit.
- Keep Full Range, or select Custom and choose a range. A custom range changes the second amount.
- Open Advanced Addresses and check Recipient address and Withdrawal address.
- Select Add Liquidity.
- In Review deposit, check both deposit amounts, the Selected price range with its lower, current, and upper prices, and both addresses. Select Confirm.
- In the Transaction request in Shield Wallet, check that the request is from swap.shield.fi and that the amounts match, then select Confirm. The network fee shows Covered by Shield.
Troubleshooting
Next steps
- Increasing liquidity to add funds to the position.
- Collecting and burning to collect the fees it earns.
- Rebalancing positions to move it to a new range.
Preview and mint
Prerequisites: Your authenticated mainnetclient for Typescript, dex for Python, or CLI profile from Setup, funded with a confidential balance of both pool assets. See Fund a trading account.Choose the pool before submitting. Replace POOL_KEY with its key from the pool list. For Typescript, replace AMOUNT0_BASE_UNITS and AMOUNT1_BASE_UNITS with bigint deposit budgets in the pool’s token order. The Python example converts decimal strings to integer base units using each token’s decimals.For Typescript, define the confirmation helper before running the examples. Python includes its confirmation checks below.- Typescript
- Python
- CLI
Step 1: Choose the pool, amounts, and range
previewMint aligns the range to the pool’s tick spacing, calculates the liquidity the budget supports, and reports the amounts the range will consume. Nothing is spent.tickLower and tickUpper instead of rangePercent to set exact bounds. preview.inRange is false when the range does not include the current price. Zero liquidity means one side of the budget is empty or the amounts are too small for the range; a mint would still cost a fee and open nothing.Step 2: Mint the position
Pass the amounts the preview reported, not the budget. That caps the mint at what the preview showed even if the price moves before the transaction finalizes.minted.positionTokenId identifies the position for every later operation. withdrawal is where every collect pays, and it cannot be changed afterwards.Step 3: Check the position
Save the transaction ID before waiting. The helper checks acceptance and waits for both the position state and its spendable record.position.state.liquidity is the position’s share of the range. position.state.tokensOwed0 and tokensOwed1 can be nonzero right after a mint: any part of the desired amounts the range did not use is credited to the position for you to collect.Wait between SDK operations
Continue with the authenticated mainnet client from Setup. Define the helper for your SDK before running the liquidity examples on this page and the pages that follow. Submit operations on a position one at a time.- Typescript
- Python
waitForPosition checks transaction acceptance, then waits for the scanner to return the position. After an increase, decrease, or collect, pass the previous record’s tag so a stale record cannot satisfy the wait.How it works on chain
mint transfers your desired token0 and token1 amounts into the AMM and creates a position. The amount used backs liquidity; any excess stays owed to the position until you collect it.What mint creates
How liquidity is recorded
- The contract calculates liquidity and the amounts used at the current square-root price. Liquidity must be nonzero, and each used amount must meet its token minimum.
- It updates the boundary ticks, inserting any new boundaries with your supplied hints.
- It records the liquidity, owed balances, and current fee-growth checkpoints. Your position earns only subsequent fee growth.
MIN_TICK <= tick_lower < tick_upper <= MAX_TICK. Fetch insertion hints immediately before submission; another accepted transaction can make a hint stale and cause your mint to be rejected.After acceptance, save the transaction ID, PositionNFT ciphertext, and change records before marking the input records spent. Live liquidity and owed balances are read from positions[token_id].Next steps
- Increasing liquidity to add funds to the position.
- Collecting and burning to collect fees and close the position.
- Rebalancing positions to move it to a new range, or Tracking position fills to inspect inventory changes.
- The Typescript mint example is the runnable version of the steps above.