Verification checklist

  • A position stores liquidity plus fee checkpoints. Token inventory is not in that struct. It is computed from the current square-root price and the two boundaries.
  • The same liquidity at the lower tick, at the midpoint, and at the upper tick holds different token0 and token1 amounts. Adding the two tokens does not recover the liquidity.
  • A current tick equal to the lower tick only says the price has not reached the next tick. Once the square root has left the boundary, token1 can be nonzero.
  • Desired amounts are cut down to the smaller liquidity they can support. A positive mint rounds up, so the floored periphery preview is short by 1.

1. The struct has no token balance

A position screen often labels one large integer as the tokens sitting in the range. Position at v1.0.0 stores five fields: liquidity, feeGrowthInside0Last, feeGrowthInside1Last, tokensOwed0, and tokensOwed1. The liquidity comment says this is the liquidity owned by the position. The tokensOwed comment says these are the fees owed to the position owner, denominated in token0 or token1. Fees and principal use different fields. Principal has no field at all.

A static read of the positions mapping therefore returns liquidity, the fee-growth values from the last settlement, and the fees already credited then. Later price movement, and the inventory shift that follows it, is not written back into the struct. Liquidity stays put until a mint or a burn. Inventory does not. Treating the unchanged word as a balance freezes the note on an old mix of tokens.

This is not the question in the square-root note. That note asks whether slot0.sqrtPriceX96 can be read as a price. This note assumes the square root has already been recovered in those two steps, then asks whether the liquidity word is a token amount. A bad quote still breaks the inventory, because the inventory formula consumes the square root, not the liquidity word. The spot-versus-fill note compares the chord of one input size. The amounts here are the stock inside the position boundaries, not the fill of one swap.

2. One liquidity, three prices, three inventories

The teaching position is not a live position from 30 October 2026. Liquidity is 10^18. The square root at tick 0 is 2^96, which is 79228162514264337593543950336. The square root at tick 200, from TickMath's shifts and rounding, is 80024378775772204256025656563. LiquidityAmounts at v1.0.0 chooses which token to compute from where the current square root sits. At or below the lower boundary it computes token0 only. Strictly below the upper boundary, and above the lower one, it computes both. Otherwise it computes token1 only. Division floors.

Price exactly on the lower boundary: token0 is 9949671258790518 and token1 is 0. Price exactly on the upper boundary: token0 is 0 and token1 is 10049662092876568. Liquidity did not change. Inventory moved from only token0 to only token1. The integer midpoint of the two boundary square roots is 79626270645018270924784803449, still inside the range. There token0 is 4949962902125938 and token1 is 5024831046438284. Their sum is 9974793948564222. That sum is not 10^18, and it is not the lower-boundary token0 either. Liquidity is not the sum of the two tokens, and it is not either token alone.

Teaching liquidity 10^18, ticks 0 through 200
Current square roottoken0token1
Lower, 7922816251426433759354395033699496712587905180
Lower plus 199496712587905180
Lower plus 7922816251599496712587905171
Integer midpoint of the boundaries49499629021259385024831046438284
Upper, 80024378775772204256025656563010049662092876568

Writing 10^18 as both balances overstates token0 by 990050328741209482 and overstates token1 by the whole 10^18. The gap is not a last digit. The lower-boundary token0 is about one hundredth of the liquidity, and the other token is 0, so the position is not a proportional split of that integer either.

3. Token1 can already be 1 while the tick is still the lower tick

UniswapV3Pool at v1.0.0 branches _modifyPosition on the current tick, not on the periphery's square-root comparison. Below the lower tick, the pool collects token0 only. Below the upper tick, it takes the inside branch and may collect both. Otherwise it collects token1 only. When the tick equals the lower tick, the first test fails and the inside branch runs. That branch then passes the current square root into SqrtPriceMath. If the square root is still the lower boundary's square root, the token1 gap is 0 and the inventory is still 0. Equality of the tick matches an all-token0 position only on that one reading.

One unit above the lower square root, the token1 product still does not clear 2^96. The floor stays 0, and token0 stays 9949671258790518. Token1 reaches 1 only when the square root is at least 79228162515 above the boundary. One less, a rise of 79228162514, still leaves token1 at 0, while token0 has already fallen by 1 to 9949671258790517. At 79228162515, token1 becomes 1 and token0 stays 9949671258790517. The square root of tick 1 is 79232123823359799118286999568. The increment 79228162515 is far smaller than the gap between those two square roots, so getTickAtSqrtRatio still returns 0. A note that says the position holds no token1 because the tick equals the lower tick erases that 1 raw unit and overstates token0 by 1.

The upper boundary has a second bad formula. Multiplying liquidity by the squared price minus one, and calling the product token1, floors to 20200319893934137 on this range. The contract token1 is 10049662092876568. The extra is 10150657801057569. Inventory uses the difference of square roots, not the difference of prices. In the previous note, one division at tick 200, minus one, is the square root's excess over 1. With both tokens at 18 decimals, the human reading of upper-boundary token1 is 0.010049662092876568, which lines up with that excess. The squared price sits about 0.020200319893 above 1, roughly twice as far, and that distance is not what gets multiplied by liquidity.

4. Desired amounts are cut to the smaller liquidity

LiquidityManagement at v1.0.0 reads the square root from slot0, takes TickMath at both boundaries, and calls getLiquidityForAmounts. At or below the lower boundary, liquidity comes only from the desired token0. The desired token1 never enters that call. Teaching deposits of 10^18 on each side produce liquidity 100505833206951600031. getAmountsForLiquidity then floors token0 to 999999999999999999 and token1 to 0. The entire desired token1 stays out, and the token0 preview is short by 1.

The pool rounds a positive liquidity delta up when it mints. For this liquidity and these boundaries, SqrtPriceMath's round-up token0 is 1000000000000000000 and token1 is still 0. The periphery preview and the principal the pool actually charges differ by 1 raw unit, and the preview is the smaller one. Setting amount0Min from the preview, 1 below what the pool charges, stops the mint at the slippage check. That 1 is not a fee. The fee has not entered this path.

Move the price to the integer midpoint of the two boundary square roots and both desired amounts participate. Liquidity is the minimum of the two sides, 199011666413903200063. The floored principal is token0 985100365839083542 and token1 999999999999999999. Against desired amounts of 10^18 each, token0 leaves 14899634160916458 behind and token1 leaves 1. The binding side is token1. A note that says both deposits entered in full overstates token0 by 14899634160916458 and token1 by 1.

5. Fee checkpoints, spacing, and decimals sit outside liquidity

Position.update multiplies the fee-growth increment by the liquidity then in the position, divides by 2^128, floors, and adds the result to tokensOwed. With liquidity still 10^18 and a teaching growth increment of 2^96, that step is 232830643. It is written to storage only when update runs. A read before that call still returns the old tokensOwed. If the old value is 0, the uncheckpointed 232830643 is invisible. Reading 0 as no fees drops that increment. Reading 232830643 as the lower-boundary token0 principal misses 9949671258790518. Fees and inventory are separate accounts.

The range also has to be initializable on that pool. When a tick flips, the pool passes tickSpacing into tickBitmap.flipTick. In the v1.0.0 factory, fee 500 maps to spacing 10, and 200 is divisible by 10. Fee 3000 maps to spacing 60, and 200 divided by 60 leaves 20. The same boundaries cannot be copied from a 500 pool onto a 3000 pool and still be treated as an aligned position. Spacing is an immutable on the pool. It is read with the fee. It is not visible in the liquidity integer.

The computed token0 and token1 are still raw units. When both tokens use 18 decimals, the human reading of lower-boundary token0 is 0.009949671258790518, not the 1 obtained by shifting 10^18 by 18 decimals. If token0 instead has 6 decimals and liquidity stays 10^18, the same raw integer 9949671258790518 is divided by 10^6 and the human reading is 9949671258.790518. Changing decimals moves the human unit by orders of magnitude without changing the liquidity field. The oracle note's answer scale does not replace token decimals here. Inventory comes from the square root and the liquidity first. Decimals are a second field on the token contracts.

6. Separate liquidity, inventory, and credited fees

The weak sentences are "liquidity equals the tokens in the range" and "the tick is still on the lower boundary, so there is no token1." A usable sentence lists liquidity, the square roots of both boundaries, the current sqrtPriceX96 and the current tick, token0 and token1 after the rounding direction, the desired side that was not selected, whether update has written tokensOwed, whether tick spacing divides both boundaries, and both decimals. In the teaching set, 10^18 on the lower boundary is token0 9949671258790518 and token1 0. On the upper boundary it is token0 0 and token1 10049662092876568. Once the square root is 79228162515 above the lower boundary, the tick is still 0 and token1 is already 1.

This is a research framework. The position fields, the getAmountsForLiquidity branches, the round-up on a positive mint, and the division by 2^128 inside update come from the v1.0.0 libraries cited above. The figures 9949671258790518, 10049662092876568, 79228162515, 100505833206951600031, and 232830643 are a teaching conversion. They were not measured on a live pool, and they are not investment advice.