# Ticks

Overview of how Ticks work on Duality

Ticks serve as a way to index and store liquidity data as well and a convenient way to price liquidity. Each token pair consists of a unique tick for every integer between -X and +X. The price of liquidity being stored at tick

$i$

is determined by the function:$p(i) = 1.0001^{i}$

Some examples:

- Price of tick$0:$$p(0) = 1.0001^0 = 1$
- Price of tick$1$:$p(-4000) = 1.0001^{4000} \approx 1.4917$
- Price of tick 2: $p(-4000) = 1.0001^{-4000} \approx 0.6703$

Among other benefits, building ticks in this way is a natural way to scale tick growth based on the tick number. Additionally this is how Uniswap V3's ranged liquidity is spaced so it would be natural to add ranged liquidity in as an additional option to LPing if governance votes to do so.

Each tick number maps to liquidity that can be traded at that price.

Each token pair has two current ticks, one for each direction. The current tick tells the module what is the best priced liquidity that can be swapped through. On a swap, once the liquidity at the current tick is swapped through completely, the next best priced tick with liquidity in it is found and updated to be the current tick.

Last modified 4mo ago