infrastructure-upgrade/lib/v3-periphery/test/shared/ticks.ts
T-Hax 735546619e
init
Signed-off-by: T-Hax <>
2023-04-08 18:46:18 +00:00

10 lines
421 B
TypeScript

import { BigNumber } from 'ethers'
export const getMinTick = (tickSpacing: number) => Math.ceil(-887272 / tickSpacing) * tickSpacing
export const getMaxTick = (tickSpacing: number) => Math.floor(887272 / tickSpacing) * tickSpacing
export const getMaxLiquidityPerTick = (tickSpacing: number) =>
BigNumber.from(2)
.pow(128)
.sub(1)
.div((getMaxTick(tickSpacing) - getMinTick(tickSpacing)) / tickSpacing + 1)