Verification checklist
- Divide sqrtPriceX96 by 2^96, then square. That square is the raw token1/token0 price. The first step alone is the square root.
- A tick is an exponent of 1.0001. Many ticks compound. Dividing the tick count by 100 does not write a percent move.
- The swap fee, the tick spacing, the current tick, and the in-range sqrtPriceX96 are four fields. Fee 3000 is not spacing 60, and it is not a price.
- Scale the raw price by 10 to the power of decimals0 minus decimals1 before calling it token1 per token0 in human units.
1. The struct says price. The formula says square root
A note often continues from a printed slot0 with the sentence "that number is the price." UniswapV3Pool at v1.0.0 does label sqrtPriceX96 as the current price, and the next struct line as the current tick. Stopping at the comment stops before the square. TickMath states the operation: getSqrtRatioAtTick calculates sqrt(1.0001^tick) times 2^96. The return value is the square root of the token1/token0 ratio, as a Q64.96 fixed-point number.
The quote therefore takes two steps. Divide sqrtPriceX96 by 2^96. That quotient is the square root. Square it. That square is the raw price, token1 per token0 in raw units. A note that keeps only the first step has stored the square root under the name price. At tick 0 the library returns exactly 2^96, which is 79228162514264337593543950336. One division equals 1, and the square is 1 as well. The two readings coincide, so a check that uses only tick 0 will pass a broken decoder. The library also closes its ends: MIN_TICK of −887272 maps to MIN_SQRT_RATIO 4295128739, and MAX_TICK 887272 maps to the MAX_SQRT_RATIO in the same file. Matching the ends does not make one division the quote at a tick in between.
This is not the question in the spot-versus-fill note. That note compares a constant-product tangent with the chord of one input size. This note has not reached a size yet. It asks whether the slot0 word can be read as a quote at all. A square-root reading makes the later fill comparison meaningless, because neither side is the price. The feed-decimals note compares an oracle answer scale with a token decimals field. Q64.96 is the pool's own fixed point, not that oracle field.
2. Teaching tick 200: one division prints tick 100
The teaching tick is not a slot0 from 28 October 2026. At tick 200 the library's shifts and rounding return sqrtPriceX96 of 80024378775772204256025656563. Dividing by 2^96 and truncating to 18 decimals prints 1.010049662092876568. Squaring and truncating to 12 decimals prints 1.020200319893. Raising 1.0001 to the 200th power and truncating to the same 12 decimals prints 1.020200319893 as well. The library's rounding does not move this tick off the power at that width.
The one-division figure 1.010049662092876568 matches the squared price at tick 100 through 18 decimals. The square root halves the exponent, so the unsquared reading of tick 200 lands on the price of tick 100. Treating "divide by 2^96" as the quote writes the halfway tick. Treating 200 ticks as a 2.00% rise writes 1.02. The contract square is 0.000200319893 above that. The gap is the compound step, not a final-digit rounding choice.
| Read | Input | Written as | Contract ratio |
|---|---|---|---|
| Tick 0, one division | 2^96 | 1 | 1 |
| Tick 200, one division | 80024378775772204256025656563 | 1.010049662092 | 1.020200319893 |
| Tick 200, print sqrtPriceX96 | same integer | that integer | 1.020200319893 |
| 200 ticks as plus 2% | 200 | 1.02 | 1.020200319893 |
| 10000 ticks as plus 100% | 10000 | 2 | 2.718145926825 |
| Spacing 60 as plus 60% | 60 | 1.60 | 1.006017734268 |
The written-as column is the misread. The contract-ratio column squares sqrtPriceX96, divides by 2^192, and truncates to 12 decimals. Tick 1 truncates to 1.000100000000, so a single step really is one basis point. From the second step, basis points no longer add by count.
3. A tick count is not a percent
1.0001 to the first power, minus one, is 0.0001, one basis point. That identity is only the single step. N ticks price-ratio to 1.0001 to the N, not to one plus N basis points. Tick 100 ratios to 1.010049662092, not to 1.01. The extra is 0.000049662092. Tick 10000 ratios to 2.718145926825. Dividing 10000 by 100 and calling the result "up 100%" writes 2. That drops 0.718145926825. The figure 2.718145926825 is 1.0001 to the 10000, and on this library tick it matches that power through 12 truncated decimals. It is not a separate constant, and a resemblance to 2.71828 is not a reason to collapse it to a doubling.
A negative tick is not the positive move with the sign flipped. Tick 200 sits 0.020200319893 above 1. Subtracting that from 1 writes 0.979799680107. Tick −200 ratios to 0.980199653440. The two lines differ by 0.000399973333. The downward path is the reciprocal of the power, not the negation of the rise. One division fails on the negative side too: tick −200 divided once truncates to 0.990050328741 at 12 decimals, and the square is 0.980199653440.
On initialize, the pool recovers the tick with getTickAtSqrtRatio. The comment asks for the greatest tick whose ratio is still less than or equal to the input. slot0.tick is the index of that lower boundary, not a second copy of the price. When the price sits between tick 200 and tick 201, the tick field is 200, while sqrtPriceX96 is still above getSqrtRatioAtTick(200). Replacing the stored square root with the boundary price writes the lower number.
4. Fee, spacing, and the current tick do not stand in for each other
The UniswapV3Factory constructor at v1.0.0 stores three pairs: fee 500 with spacing 10, 3000 with 60, and 10000 with 200. enableFeeAmount can open further pairs later, so a note reads pool.fee, pool.tickSpacing, and the factory mapping. It does not memorize the constructor as a permanent list. The pool keeps fee and tickSpacing as two immutables. slot0.feeProtocol is a different field. Initialize writes it as 0. The comment describes a protocol share taken from the swap fee on withdrawal, as an integer denominator, not the swap fee itself.
The flash path sends the amount, the fee, and 1e6 into mulDivRoundingUp. With fee 3000 that step is 3000/1000000 = 0.003, or 0.30%. The swap passes that same fee into SwapMath.computeSwapStep. Reading 3000 as a tick, or as a price of 3000, skips this division. Spacing 60 is not the 0.30% either. The boundary ratio across 60 ticks is 1.006017734268, about 0.6017734268% above 1. That move is larger than the 0.30% fee and far smaller than the 1.60 written by reading 60 as 60%. All three numbers can sit on one pool, and they name different fields.
The current tick need not be a multiple of the spacing. Liquidity boundaries that can be initialized line up on tickSpacing. slot0.tick is the integer tick the price currently occupies. The teaching midpoint of the sqrt prices at tick 200 and tick 201 is 80026379335228862431824497642. It is above the square root at 200 and below the square root at 201, so the recovered tick is 200. One division truncates to 1.010074912703 at 12 decimals, and the square is 1.020251329272. The boundary square at tick 200 is 1.020200319893. Looking the tick up as a boundary understates the quote by 0.000051009379. Size is still zero in this comparison. Once size is not zero, the spot tangent is still not the fill. That is the other note's formula.
5. After the square, scale by the two decimal fields
The square is token1 per token0 in raw units. Human units multiply by 10 to the power of decimals0 minus decimals1. When both tokens use 18 decimals, the exponent is 0 and the teaching human quote at tick 200 is 1.020200319893. When token0 has 6 decimals and token1 has 18, the same raw price is divided by 10^12. Human token1 per human token0 is 1.020200319893 times 10 to the −12. The other direction, human token0 per human token1, is 10^12 times 2^192 divided by the square of sqrtPriceX96. Integer division returns 980199653440. Writing the unscaled 1.020200319893 as that direction's quote is off by twelve orders of magnitude, not by a last digit.
The square and the decimal scale are one chain. Skipping either one fails. Scaling decimals without squaring still starts from the square root in the 6-and-18 example. Squaring without the decimals writes 1.020200319893 as if it were already a human quote. The oracle note's answer scale does not replace 10^(decimals0 − decimals1) here. The pool's fixed point is Q64.96 first. Token decimals are a second field on the token contracts.
The minimum replay fields are the pool address, both tokens and their decimals, slot0.sqrtPriceX96, slot0.tick, the pool fee, the pool tick spacing, the factory spacing for that fee, the one-division square root, the squared raw price, the human token1 per token0 after the power of ten, and the inverse direction when the note needs it. Holding a small balance in order to compare a screen quote with a wallet receipt belongs in a fee footnote. It does not belong in the decision of whether one division equals the quote.
6. Square, then scale, and only then talk about tick distance
The weak sentences are "sqrtPriceX96 divided by 2^96 is the price" and "the tick moved 10000, so the price rose 100%." A usable sentence lists sqrtPriceX96, the one-division square root, the squared raw price, both decimals, human token1 per token0, fee divided by 1e6, tick spacing, and whether the current tick is sitting on its boundary. In the teaching set those tick-200 figures are 80024378775772204256025656563, 1.010049662092876568, and 1.020200319893. Writing 2 for 10000 ticks meets a contract ratio of 2.718145926825. The spacing-60 boundary ratio is 1.006017734268, and fee 3000 is 0.003 on the flash path.
This is a research framework. The square root times 2^96, the tick conversion, the factory's three initial pairs, and the flash division by 1e6 come from the v1.0.0 core cited above. The figures 1.010049662092, 1.020200319893, 2.718145926825, 1.006017734268, and 980199653440 are a teaching conversion. They were not measured on a live pool, and they are not investment advice.