Skip to content

Commit

Permalink
Explain that tick spacing affects which ticks can be initialized in t…
Browse files Browse the repository at this point in the history
…he ticks bitmap (#75)
  • Loading branch information
Jeiwan committed Nov 13, 2023
1 parent 1e51b7c commit 2ddcd1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion content/docs/milestone_2/tick-bitmap-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function flipTick(
}
```

> Until later in the book, `tickSpacing` is always 1.
> Until later in the book, `tickSpacing` is always 1. Please keep in mind that this value affects which ticks can be initialized: when it
equals 1, all ticks can be flipped; when it's set to a different value, only ticks divisible by the value can be flipped.

After finding word and bit positions, we need to make a mask. A mask is a number that has a single 1 flag set at the
bit position of the tick. To find the mask, we simply calculate `2**bit_pos` (equivalent of `1 << bit_pos`):
Expand Down
4 changes: 3 additions & 1 deletion content/docs/milestone_4/factory-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ Thus, each pool is uniquely identified by this set of parameters:
Factory contract uses this set of parameters as a unique identifier of a pool and passes it as a salt to generate a new
pool contract address.

> From now on, we'll assume the tick spacing of 60 for all our pools, and we'll use 10 for stablecoin pairs.
> From now on, we'll assume the tick spacing of 60 for all our pools, and we'll use 10 for stablecoin pairs. Please notice
that only ticks divisible by these values can be flagged as initialized in the ticks bitmap. For example, only ticks -120,
-60, 0, 60, 120, etc. can be initialized and used in liquidity ranges when tick spacing is 60.

## Factory Implementation

Expand Down

0 comments on commit 2ddcd1c

Please sign in to comment.