Price, tick index and sqrt price correlation calculation
What's difference between price, tick index and sqrt price?
Concept
Definition
Features
Application
1. Tick index to price
import { TickMath } from '@cetusprotocol/cetus-sui-clmm-sdk'
// decimalsA and decimalsB means the decimal of coinA and coinB
const price = TickMath.tickIndexToPrice(tickIndex, decimalsA, decimalsB)2.Price to tick index
3. Tick index to sqrt price x64
4. Sqrt price x64 to tick index
5. Price to sqrt price
6. Sqrt price to price
7. Convert the tick index from i32 to u32
Last updated