Verification checklist

  • feeGrowthOutside is a checkpoint against the global value. Which side of the tick the price is on decides whether the number is used raw or subtracted from global.
  • The lower tick is initialized at global 80 while the current tick is 60, so its outside is 80 and the upper outside is 0. The inside is 0, not 80.
  • Global reaches 100 while the price is still inside, and the inside is 20. After the upper cross the outside becomes 100, and the inside is still 20.
  • Above the range, global reaches 130. The above-side value is 30 and the inside is still 20. 130 minus 80 is 50, which counts that 30 as earned.

1. Outside is a checkpoint, and initialization decides which side owns the past

Tick.sol v1.0.0 does not read "fees earned outside this tick" inside getFeeGrowthInside. It subtracts three stored values: the global growth, the lower feeGrowthOutside, and the upper feeGrowthOutside. When the current tick is greater than or equal to the lower tick, the below-side value is the lower outside. Otherwise the below-side value is global minus the lower outside. When the current tick is less than the upper tick, the above-side value is the upper outside. Otherwise the above-side value is global minus the upper outside. The inside is global minus the below-side value minus the above-side value.

The same outside storage is used differently on the two sides of its tick. Above the tick, it stands for growth that has already happened below that tick. Below the tick, the value the formula actually wants is global minus that storage. Reading the field name outside as "the fee balance outside the range" uses the wrong branch on both sides.

The checkpoint is fixed the first time the tick is written. update sets outside only while that tick's liquidityGross is still 0. The comment says the convention is that all growth before a tick was initialized happened below the tick. So the current global is copied into feeGrowthOutside only when the tick is less than or equal to the current tick. When the tick is above the current tick, outside stays 0. A later mint on the same tick finds a nonzero gross, skips that block, and does not overwrite outside with a newer global.

The teaching position uses lower tick 0 and upper tick 120. At initialization the current tick is 60 and global growth is 80. 60 is greater than or equal to 0, so the lower outside is written as 80. 120 is greater than 60, so the upper outside stays 0. The price is still between the boundaries: 60 is greater than or equal to 0, and 60 is less than 120. The below-side value is 80, the above-side value is 0, and the inside is 80 minus 80 minus 0, which is 0. The new position does not receive the 80 from before it existed. Treating both outsides as 0 would write the inside as 80 and assign that history to a range that was not there yet.

2. Global moves from 80 to 100, and the inside is 20

The price stays at 60. No boundary is crossed, so both outsides stay put. Global increases from 80 to 100. The below-side value is still 80 and the above-side value is still 0. The inside is 100 minus 80 minus 0, which is 20. Those 20 units are the growth that happened after initialization, while the price was inside the range. They are not the global 100, and they are not the 80 stored on the lower tick.

80 and 20 add up to 100. Counting the whole global as position income counts the 80 again, the part that initialization already placed on the below side. Taking the lower outside of 80 as the income reverses the sign: that 80 is the part subtracted from global, not the part the position keeps.

The 80, 100, 130, 20, and 30 in this note are teaching integers for growth that is already in this fixed-point storage. The contract performs the same subtraction. Do not multiply 20 by 2^128, and do not read 20 as 20 tokens. How a pool fee is split into a protocol fee and the part left for liquidity providers, before growth is written, is the subject of Fee Check: The Pool Fee Tier Is Not the Cut LPs Keep. The 20 here is what remains after that split, once the outside checkpoints have cut the global value down to the inside of the range.

3. Crossing 120 upward sets the outside to 100, and the inside stays 20

cross replaces that tick's outside with global minus the old outside. The upper outside was 0, global at the cross is 100, and the new outside is 100 minus 0, which is 100. The lower tick is not crossed, so its outside stays 80. This 100 is not "the upper side just earned 100." The checkpoint has been flipped to the other side of the global value. Before the flip, 0 meant there was no growth above the upper tick that needed its own record. After the flip, 100 means: if the price returns below the upper tick, use 100 directly as the above-side value; if the price stays on this side of the upper tick, the above-side value is global minus 100.

The comparison is strict. When the current tick equals the upper tick 120, 120 is not less than 120, so the branch is global minus the upper outside, not the outside used raw. 120 is still greater than or equal to the lower tick 0, so the below-side value is still 80. The above-side value is 100 minus 100, which is 0. The inside is 100 minus 80 minus 0, still 20. Reaching the upper boundary does not turn the inside into 0, and it does not turn it into 100.

If the cross forgets the flip, the upper outside is still 0 while the price is no longer below the upper tick. The above-side value is then computed as 100 minus 0, which is 100. The inside becomes 100 minus 80 minus 100. That is not 20. The above side has been charged the whole global: the inside's 20 is removed, and the lower tick's 80 is subtracted once more. The flip is what makes the above-side value 0 at that moment and leaves the inside at 20.

Lower tick 0 and upper tick 120: global and the two outsides produce the inside
StageCurrent tickGlobalLower outsideUpper outsideInside
Just initialized60808000
Still inside6010080020
At the upper tick1201008010020
Above the range1801308010020
Back inside60130803020

4. Global reaches 130, and the extra 30 stays out of the range

The price stays at 180 and does not cross the upper tick again, so the upper outside remains the 100 written at the cross and the lower outside remains 80. Global increases from 100 to 130. 180 is greater than or equal to 0, so the below-side value is still 80. 180 is not less than 120, so the above-side value is 130 minus 100, which is 30. The inside is 130 minus 80 minus 30, still 20.

Those 30 units are global growth that happened after the price left the range. They show up on the above side and not inside. Relative to the global value of 80 at initialization, global has increased by 50. Of that, 20 happened inside the range and 30 happened above the upper tick. 130 minus 80 is 50, which joins the two intervals into one. In this teaching the position corresponds only to the 20.

Reading the upper outside of 100 by itself is also wrong. 100 is the global value written into the checkpoint at the previous flip. It is not the 30, and it is not the position's 20. While the price is still above the upper tick, the above-side value is 130 minus 100. Treating 100 as the above-side value confuses the checkpoint with the gap between the checkpoint and the current global.

5. Crossing back sets the outside to 30, and the inside is still 20

The price crosses 120 downward after global has become 130. cross subtracts again: the new upper outside is 130 minus 100, which is 30. The lower outside is still 80. Back at tick 60, 60 is less than 120, so the above-side value is the outside 30 used raw, not global minus that outside. The below-side value is still 80. The inside is 130 minus 80 minus 30, still 20. Leaving the range and returning to it did not change the inside away from 20. What changed is the upper checkpoint: from 0 to 100, then from 100 to 30.

Two flips in a row do not always restore the old value. If global is unchanged at the second flip, 100 minus 100 is 0 and the checkpoint returns to its pre-cross value. If global has already become 130, 130 minus 100 is 30 and the checkpoint does not return to 0. That 30 is exactly the growth added while the price was outside. The checkpoint follows the global value. It is not a fee bill that restores itself.

The same subtraction is applied to the seconds fields. If the time at initialization is 1000, the lower tick is at or below the current tick, so secondsOutside is written as 1000, and the upper tick is above the current tick, so its seconds outside stays 0. At an upward cross when the time is 1300, the upper seconds outside becomes 1300 minus 0, which is 1300. That 1300 is not "the price spent 1300 seconds outside the upper tick." It is the time at the cross minus the old checkpoint. If the return cross happens at time 1600, the new checkpoint is 1600 minus 1300, which is 300. 300 is likewise not the number of seconds the position spent inside the range. Seconds, seconds per liquidity, and tickCumulative outside are each replaced by their own global value minus the old value, the same bookkeeping as the fee outside. This note does not turn 300 into a time-weighted price.

6. The 20 is not yet tokensOwed

getFeeGrowthInside returns the growth inside the range. It does not modify the position, and it does not increase tokensOwed. The position waits for the next Position.update, which subtracts the last recorded inside growth and multiplies by the liquidity then on the position, before anything is owed. That step is Fee Check: Growth Records 3000, and tokensOwed Is Still 0 Before the Poke. The 20 in this note cannot be added to that note's 3000. 20 is the inside growth produced by this checkpoint series. 3000 is a fee that the other note had already written into global growth.

Which tick can be crossed still depends on whether the bitmap initialized it. An uninitialized word edge does not call cross, and its outside does not flip. That is Bitmap Check: The Next Spacing Tick Is 60, and This Call Returns 180. This note assumes the upper tick 120 is initialized, so cross runs when the price reaches 120. If the bit for 120 is clear, the outsides 100 and 30 in the table above are never written.

A check writes four columns in time order: the current tick, global, the lower outside, and the upper outside. Choose the branch from the tick and the two boundaries, compute the below-side and above-side values, then subtract them from global. Just after initialization the inside is 0. With the price still inside and global at 100, it is 20. At tick 120 or 180 with global at 130, it is still 20. After the return, the upper outside is 30 and the inside is still 20. Any column that writes 130 minus 80 as 50 has counted the 30 from outside the range as the position's.

This is an analytical framework. The inside equals global minus the below-side value minus the above-side value, the side of the boundary chooses whether outside is used raw or subtracted from global, a tick copies global only the first time it is initialized, and a cross sets outside to global minus the old value. All of that comes from Tick.sol v1.0.0. 80, 100, 130, 20, 30, and the seconds checkpoints 1000, 1300, and 300 are teaching results of that integer arithmetic. They are not a pool reading from 12 November 2026, and they are not investment advice.

7. Common misreadings

Global is already 80 when the lower tick is initialized. Does the new position start with 80?

No. The lower tick is at or below the current tick, so its outside is set to the global value 80. The upper tick is above the current tick, so its outside stays 0. While the current tick is inside the range, the inside is 80 minus 80 minus 0, which is 0. Treating both outsides as 0 is what pulls the historical 80 into the new position.

Global rises from 80 to 130. Did the position earn 50?

No. While the price is still inside and global is 100, the inside is 100 minus 80 minus 0, which is 20. After the upward cross, global reaches 130. The above-side value is 130 minus 100, which is 30, and the inside is 130 minus 80 minus 30, still 20. The extra 30 is above the range. 130 minus 80 is 50, and that 50 counts the 30 as if the position had earned it.

After the upper cross the outside is 100. Did the upper side earn 100?

No. A cross replaces outside with global minus the old outside. Global is 100 and the old outside is 0, so the stored value becomes 100. That is a checkpoint, not fees newly earned on that side. At the upper tick or above it, the above-side value is global minus the checkpoint, 100 minus 100, which is 0, and the inside is still 20. Crossing back after global has reached 130 sets the outside to 130 minus 100, which is 30.