Position state
The publicPosition struct stores:
- Pool identifier
- Lower and upper ticks
- Liquidity amount
- Last fee-growth checkpoint for token0 and token1
- Token0 and token1 amounts owed
PositionNFT ownership record proves who may operate that position. Public market state can show the range and liquidity for a token_id without storing the owner’s address in the positions mapping.
Boundary accounting
Each initialized boundary stores bothliquidity_gross and signed liquidity_net.
liquidity_grossis the total position liquidity that references the boundary.liquidity_netdescribes the change to active liquidity when price crosses the boundary upward.
liquidity_gross falls to zero, the contract removes the boundary from the initialized-tick list. This keeps the tick walk from stopping at an empty boundary.
In-range and out-of-range inventory
The liquidity formulas produce different token requirements depending on the current square-root price:- Below the range, the position is funded with token0.
- Inside the range, the position uses both tokens.
- Above the range, the position is funded with token1.
desired - used as public tokens_owed; token change records contain only input-record value above the desired transfer.
Fee eligibility
Only active liquidity receives fees for a swap step. The position’s fee entitlement is derived from cumulative global fee growth and the fee-growth values stored outside its lower and upper ticks. Each step’s fractional fee growth is recorded immediately using the liquidity active during that step.Contract-specific limits
Shield Swap combines tick ranges and Q128.128 per-liquidity fee growth with fixed unrolled tick walks, wide arithmetic,PositionNFT ownership records, public finalizer mappings, freezelist proofs, and a separate claim transaction. Quotes and range-management tools must reproduce these rules.