TickMath
@uniswap/v3-sdk / Exports / TickMath
Class: TickMath
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• Private new TickMath()
Cannot be constructed.
Defined in
Properties
MAX_SQRT_RATIO
▪ Static MAX_SQRT_RATIO: default
The sqrt ratio corresponding to the maximum tick that could be used on any pool.
Defined in
MAX_TICK
▪ Static MAX_TICK: number = -TickMath.MIN_TICK
The maximum tick that can be used on any pool.
Defined in
MIN_SQRT_RATIO
▪ Static MIN_SQRT_RATIO: default
The sqrt ratio corresponding to the minimum tick that could be used on any pool.
Defined in
MIN_TICK
▪ Static MIN_TICK: number = -887272
The minimum tick that can be used on any pool.
Defined in
Methods
getSqrtRatioAtTick
▸ Static getSqrtRatioAtTick(tick): default
Returns the sqrt ratio as a Q64.96 for the given tick. The sqrt ratio is computed as sqrt(1.0001)^tick
Parameters
| Name | Type | Description |
|---|---|---|
tick | number | the tick for which to compute the sqrt ratio |
Returns
default
Defined in
getTickAtSqrtRatio
▸ Static getTickAtSqrtRatio(sqrtRatioX96): number
Returns the tick corresponding to a given sqrt ratio, s.t. #getSqrtRatioAtTick(tick) <= sqrtRatioX96 and #getSqrtRatioAtTick(tick + 1) > sqrtRatioX96
Parameters
| Name | Type | Description |
|---|---|---|
sqrtRatioX96 | default | the sqrt ratio as a Q64.96 for which to compute the tick |
Returns
number