Documentation Index
Fetch the complete documentation index at: https://docs.orca.so/llms.txt
Use this file to discover all available pages before exploring further.
Price & Ticks
Tracking Price
Whirlpool tracks price using square-root price. Each pool supports a sqrt-price range between[2^-64, 2^64].
Tick
Users can deposit liquidity on a custom price range in a Whirlpool. The smallest unit of price measurement (tick) is 1bps. Whirlpool represents the price range as a sequence of ticks and stores accounting information in each initialized tick that hosts liquidity. Sqrt-price maps to a tick with the formula below. Each tick represents 1 basis point of change from the neighboring tick.[2^-64, 2^64], the tick range for a Whirlpool is [-443636, 443636].
The Whirlpool account tracks both the current sqrt-price and the current tick-index.
Understanding Tick Spacing
Due to compute cost and rent constraints, it is often not economical for a Whirlpool to allow users to deposit liquidity into every single tick. Whirlpools requires pool owners to define an additional “Tick-Spacing” parameter. This allows them to define the space between “initializable ticks”, where liquidity information can be stored. A tick-spacing of 5 means that liquidity can be deposited into tick-index that are a multiple of 5. (ex. […-10, -5, 0, 5, 10…]). As a general rule, the smaller the expected volatility of a pool is, the smaller tick-spacing should be. To help you decide on the best tick-spacing for your whirlpool, consider the following attributes.1. Granularity of user definable price ranges
The smaller your tick-spacing, the more granular the price users can deposit their liquidity in. For more stable pools, a more granular tick-spacing would let users define a tighter range to maximize their leverage. Tick Spacing = 1| Price | Initializable Tick Index |
|---|---|
| 1.0001^-2 = 1/1.00020001 | -2 |
| 1.0001^-1 = 1/1.0001 | -1 |
| 1.0001^0 = 1 | 0 |
| 1.0001^1 = 1.0001 | 1 |
| 1.0001^2 = 1.00020001 | 2 |
| Price | Initializable Tick Index |
|---|---|
| 1.0001^-200 = 1/1.0202003198939318 | -200 |
| 1.0001^-100 = 1/1.0100496620928754 | -100 |
| 1.0001^0 = 1 | 0 |
| 1.0001^100 = 1.0100496620928754 | 100 |
| 1.0001^200 = 1.0202003198939318 | 200 |
